Regrding Padding between graph and axis


#1

I am android developer,please tell if there is any way to provide padding between the chart and the x axis


#2

Hello anilk2, 

Thanks for getting in touch!

Before i try to help you, could you please provide me with a little more information regarding your query. Do you require padding between the x axis and the plot area (so the padding would be inside of the x axis), or do you require more padding between the x axis and the chart itself (so the padding would be outside of the x axis)?

I look forward to hearing from you.

Thanks,

Kai.


#3

Hello Kai,

Thanks for the response.

Actually i want to have padding between the axis and the ploat area,so that the axis appears a bit seperate from the graph plot area,currently it appears to be a part of the plot area.

Thanks

Anilk


#4

Hello anilk2,

Thanks for the extra information.

Although ShinobiCharts for Android does not directly support this feature, there are several methods within the api which may help you to achieve this.

Firstly, you can set the axis tick gap and / or tick line length to be larger values:

http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.5.0/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/TickStyle.html#setTickGap(float)

http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.5.0/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/TickStyle.html#setLineLength(float)

Secondly, you could set the axis line itself to have a much greater thickness than the default, and then set it’s color to transparent:

http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.5.0/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/AxisStyle.html#setLineWidth(float)

http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.5.0/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/AxisStyle.html#setLineColor(int)

Thirdly, you could experiment with the setExpectedLongestLabel method of the axis. 

http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.5.0/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/Axis.html#setExpectedLongestLabel(java.lang.String)

The careful inclusion of ‘\n’ could also make the axis measure itself to accommodate multi-line tick labels. If you do not provide it with multi line tick labels then it should give the appearance of moving away from the plot area. For example on a number x axis (which I have tried today):

chart.getXAxis().setExpectedLongestLabel("\n10.00\n");

I hope that you find this information useful, please do not hesitate to get back in touch if you have any further queries.

Thanks,

Kai.