Tick Marks not always labeled

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
AlexanderEmelyanenko
Posts: 6
Joined: Thu Aug 09, 2018 4:37 pm

Tick Marks not always labeled

Post by AlexanderEmelyanenko » Fri Aug 10, 2018 6:36 am

Hello.

When I'm working with XY plotters I saw the issue. After zomming plot before four digits after decimal point and begining scale form using it left or right borders , some values on XAxes appear-disappear.(I attach photos with demonstration this problem)

If it isn't the bug, may be you can help how resolve this issue?

Thank,you
Attachments
2018-08-10_0932_002.png
2018-08-10_0932_002.png (78.71 KiB) Viewed 22108 times
2018-08-10_0932_001.png
2018-08-10_0932_001.png (78.95 KiB) Viewed 22108 times
Bugs photos
Bugs photos
2018-08-10_0932.png (79.12 KiB) Viewed 22108 times

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

Re: Tick Marks not always labeled

Post by ArctionPasi » Fri Aug 10, 2018 7:44 am

Hello,

set axis.AutoDivSpacing = True. It seems you have manually set the division spacing and if the divisions overlap, the labels won't be rendered.
LightningChart Support Team, PT

AlexanderEmelyanenko
Posts: 6
Joined: Thu Aug 09, 2018 4:37 pm

Re: Tick Marks not always labeled

Post by AlexanderEmelyanenko » Fri Aug 10, 2018 8:01 am

This flag is alreade setting. But if we set AutoDivSeparationPercent in default value(100%), when scale is small, xaxis values are not displaing. For resolve this issue, I change AutoDivSeparationPercent to 10, but after this move begining last bug :D
May be then you help how can i resolve problem with not displaing xaxis values?
Attachments
2018-08-10_1055.png
2018-08-10_1055.png (82.6 KiB) Viewed 22104 times
2018-08-10_1054.png
2018-08-10_1054.png (81.98 KiB) Viewed 22104 times

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

Re: Tick Marks not always labeled

Post by ArctionPasi » Fri Aug 10, 2018 8:07 am

Are you using FormatValueLabels event handler?
LightningChart Support Team, PT

AlexanderEmelyanenko
Posts: 6
Joined: Thu Aug 09, 2018 4:37 pm

Re: Tick Marks not always labeled

Post by AlexanderEmelyanenko » Fri Aug 10, 2018 8:57 am

No, I did't use this handler. Could you prompt me, how can i use it, if it possible?

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

Re: Tick Marks not always labeled

Post by ArctionPasi » Fri Aug 10, 2018 10:21 am

Hello,

OK... you are not using FormatValueChanged, therefore that can't be the reason. I investigated it a little bit and it seems a limitation floating point accuracy in axis labels computation. When decimal count is high, the label rectangle size is calculated inaccurately. We will investigate this in further detail soon and hopefully we can improve this in future versions.

Meantime, please set AutoDivSeparationPercent value higher. Like 200. Does it help in your case?
LightningChart Support Team, PT

AlexanderEmelyanenko
Posts: 6
Joined: Thu Aug 09, 2018 4:37 pm

Re: Tick Marks not always labeled

Post by AlexanderEmelyanenko » Fri Aug 10, 2018 10:36 am

Okey, I want to calculate width of xaxis, then calculate total width of current ticks, and if ticks dont fit in xaxis width, change AutoDivSeparationPercent value. How are you think, it's good approach? And may be you can help me, how can I calculate width of xaxis and what AutoDivSeparationPercent shows?

Thank you

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

Re: Tick Marks not always labeled

Post by ArctionPasi » Fri Aug 10, 2018 1:42 pm

AutoDivSeparationPercent only applies when using AutoDivSpacing = true.
When AutoDivSpacing is used, it’s always trying to find “nice numbers”, that is, based on numbers 10, 5 or 2 as Division.

When Percent = 0, based on the range, the labels come very close to each other. Practically label rectangles are next to each other.

When using larger value, like 200, it means they are at least rectangle height * 2 apart of each other.

That is the function of AutoDivSeparationPercent. Division separation in percents of the label rectangle height. Hopefully it clarifies.

With CustomAxisTicks, you can make your own custom logic for positioning the ticks as preferred. With LC source code option, you can modify the existing built-in logic.

Or you can set AutoDivSpacing = False, and control the spacing with MajorDiv, MajorDivCount and Min…Max range. Also remember these depend on each other, and we have a property KeepDivCountOnRangeChange. Setting that True, DivCount stays and MajorDiv is recalculated when axis range changes.

You can change division/ticks/labels settings e.g. based on range, in xAxis.RangeChanged event handler.
LightningChart Support Team, PT

Post Reply