Custom MinorTicks

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Arction_LasseP

HariPrasad
Posts: 4
Joined: Tue Dec 16, 2014 9:47 am

Custom MinorTicks

Post by HariPrasad » Tue Dec 16, 2014 9:56 am

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

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Custom MinorTicks

Post by ArctionPasi » Tue Dec 16, 2014 11:55 am

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.
LightningChart Support Team, PT

HariPrasad
Posts: 4
Joined: Tue Dec 16, 2014 9:47 am

Re: Custom MinorTicks

Post by HariPrasad » Wed Dec 17, 2014 6:07 am

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

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Custom MinorTicks

Post by ArctionPasi » Wed Dec 17, 2014 7:03 am

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.
LightningChart Support Team, PT

TRVRSE
Posts: 21
Joined: Fri May 30, 2014 1:27 pm

Re: Custom MinorTicks

Post by TRVRSE » Mon Jan 26, 2015 6:17 pm

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.

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Custom MinorTicks

Post by ArctionPasi » Mon Nov 28, 2016 8:33 am

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 9918 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.
LightningChart Support Team, PT