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

Message ListMessage List     Post MessagePost Message

  MinTickInc for X axis
Posted by Marko on Feb-03-2017 21:25
Attachments:
Hello

Is it possible to show vertical grid lines only for every 2nd category inside a Bar chart? I've tried $c->xAxis->setMinTickInc(2); but with no success. Any alternative?

Thanks.
Bar.png

  Re: MinTickInc for X axis
Posted by Peter Kwan on Feb-04-2017 03:16
Hi Marko,

The Axis.setMinTickInc only configures how ChartDirector auto-scale the axis. In your case, the axis is not auto-scaled, but is completely configured by your code, so Axis.setMinTickInc has no effect.

There are several methods to achieve what you need. The easiest one is to replace the labels "Jan", "Feb", "Mar", "Apr", .... with "-Jan", "Feb", "-Mar", "Apr" .... The "-" character in front of the label will cause the label to be associated with a minor tick. (The "-" character will not be visible in the chart.) You can then configure the minor grid color to be transparent.

#major vertical and horizontal grid lines are grey 0xcccccc, minor grid lines are transparent
$c->getPlotArea()->getGridColor(0xcccccc, 0ccccccc, Transparent, Transparent);

Hope this can help.

Regards
Peter Kwan

  Re: MinTickInc for X axis
Posted by Marko on Feb-06-2017 18:46
Excellent! Thank you.