Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force axis to use given number of major tick marks in Visiblox chart

Tags:

c#

visiblox

When using a LinearAxis for the Y axis in a Visiblox chart, I would like to force the axis to use a given number of major tick marks while still having the toolkit automatically calculate the axis range and tick mark locations. For instance, I may have a primary and secondary Y axis and I want both axes to use the same number of major ticks so that their horizontal gridlines overlap. Is this possible?

like image 522
Abiel Avatar asked Jul 21 '11 18:07

Abiel


1 Answers

There are a couple of options. Firstly you can set the MajorTickInterval to force the distribution of major ticks. Depending on your use-case you may need to look at the actual range of the axis, and divide by the number of ticks you want to get a sensible interval.

The other alternative is to subclass the axis and override the GetMajorTickValues method which is what the axis uses to determine where to place ticks.

like image 137
wjbeau Avatar answered Oct 05 '22 09:10

wjbeau