Page 1 of 1

Custom MinorTicks

Posted: Tue Dec 16, 2014 9:56 am
by HariPrasad
Hi,
I would like to customize Y axis ticks. Using CustomAxisTick class I can manage to draw MajorTicks. But I couldnt figure out a way to draw MinorTicks.
Can you please describe how to add custom minor ticks to the axis?

Thanks in advance.
Hari

Re: Custom MinorTicks

Posted: Tue Dec 16, 2014 11:55 am
by ArctionPasi
Hi,

currently only MajorTicks can be rendered with CustomAxisTicks. They don't support minor ticks.

There's a workaround though. Use two Y axes. One with CustomAxisTicks for 'minor' ticks and other axis for 'major' ticks. In RangeChanged event handler of the axes, set the other axis range the same so they keep in sync with each other.

Also disable automatic axis placement, set chart.ViewXY.AxisLayout.YAxisAutoPlacement = YAxisAutoPlacement.Off. Then give same position for both axes, yAxes[0].Position = yAxes[1].Position = 0. Like this they will appear to look as one axis.

Something like this.

Re: Custom MinorTicks

Posted: Wed Dec 17, 2014 6:07 am
by HariPrasad
Thanks for your quick response.
Q1: I have one more query related to custom ticks. Can I enable custom ticks for both x and y axes simultaneously?

Q2: On Custom ticks disabled, sometimes only few major tick values are appearing in y axis. Is there any setting for fixed number of major & minor ticks provided the data range is dynamic

Thanks,
Hari

Re: Custom MinorTicks

Posted: Wed Dec 17, 2014 7:03 am
by ArctionPasi
1) Yes

2) Yes. First, set AutoDivSpacing = False. MajorDiv is interval of ticks, and MajorDivCount sets the number of them. Note that Minimum, Maximum are related to these. If KeepDivCountOnRangeChange is enabled, the MajorDiv adjusts when you adjust the range (Minimum...Maximum) of the axis. If KeepDivCountOnRangeChanged is disabled, MajorDiv doesn't adjust.

Re: Custom MinorTicks

Posted: Mon Jan 26, 2015 6:17 pm
by TRVRSE
I too desire a better method for adding alternate types of Tickmarks to the chart. We must use the Custom Tickmarks as a workaround, as the major gridline marks do not achieve everything we desire. Is there any chance in the future of adding a seperate collection for Minor Custom Tickmarks, so we don't have to do the work around? Or perhaps placing more tickstyle information in the Custom Tick Marks, such as Color, Visibility, etc.

Re: Custom MinorTicks

Posted: Mon Nov 28, 2016 8:33 am
by ArctionPasi
In v.7, there's a lot of new properties to address the needs presented here...
Custom axis ticks properties
Custom axis ticks properties
CustomAxisTicks.jpg (68.68 KiB) Viewed 14234 times
- give tick line length
- style as tick / grid / both
- color individually

E.g. by assigning a different color and line length, it's possible to show them as major & minor ticks.