Page 1 of 1

Tick Marks not always labeled

Posted: Fri Aug 10, 2018 6:36 am
by AlexanderEmelyanenko
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

Re: Tick Marks not always labeled

Posted: Fri Aug 10, 2018 7:44 am
by ArctionPasi
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.

Re: Tick Marks not always labeled

Posted: Fri Aug 10, 2018 8:01 am
by AlexanderEmelyanenko
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?

Re: Tick Marks not always labeled

Posted: Fri Aug 10, 2018 8:07 am
by ArctionPasi
Are you using FormatValueLabels event handler?

Re: Tick Marks not always labeled

Posted: Fri Aug 10, 2018 8:57 am
by AlexanderEmelyanenko
No, I did't use this handler. Could you prompt me, how can i use it, if it possible?

Re: Tick Marks not always labeled

Posted: Fri Aug 10, 2018 10:21 am
by ArctionPasi
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?

Re: Tick Marks not always labeled

Posted: Fri Aug 10, 2018 10:36 am
by AlexanderEmelyanenko
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

Re: Tick Marks not always labeled

Posted: Fri Aug 10, 2018 1:42 pm
by ArctionPasi
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.