ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Size of bar chart indent
Posted by Fredrik Nyberg on Aug-11-2015 20:47
Hi,

Is there some way to obtain the size in pixels of the margin between the y-axis and the
first bar in a bar chart that is automatically inserted when axis.indent is set to true, e.g. in
a bar chart?

Best Regards,
Fredrik

  Re: Size of bar chart indent
Posted by Peter Kwan on Aug-12-2015 00:13
Hi Fredrik,

The indentation is equal to 0.5 x-axis unit.

For a simple bar chart, 1 x-axis unit is equal to the plotAreaWidth / numberOfBars. For
example, if the plotarea is 500 pixels in width, and there are 10 bars, one x-axis unit is 50
pixels, so the indentation is 25 pixels.

The indentation is the distance between the y-axis and the first x-axis tick, with is at the
center of the first bar or that of the first bar cluster (for bar chart with side layout). If you
want to obtain the distance between the y-axis and the edge of the first bar, then you
have to subtract the indentation by half the bar width. The bar width is configurable using
BarLayer.setBarGap or BarLayer.setBarWidth. The default is 0.75 x-axis unit.

Hope this can help.

Regards
Peter Kwan

  Re: Size of bar chart indent
Posted by Fredrik Nyberg on Aug-14-2015 14:45
That helps a lot! Thank you.

/Fredrik