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
Custom MinorTicks
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Custom MinorTicks
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.
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.
LightningChart Support Team, PT
-
- Posts: 4
- Joined: Tue Dec 16, 2014 9:47 am
Re: Custom MinorTicks
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
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
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Custom MinorTicks
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.
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.
LightningChart Support Team, PT
Re: Custom MinorTicks
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.
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Custom MinorTicks
In v.7, there's a lot of new properties to address the needs presented here...
- 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.
- 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.
LightningChart Support Team, PT