I would like to ask about the output format of the datacursor function.

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
wooseok2725
Posts: 2
Joined: Mon Oct 16, 2023 1:07 am

I would like to ask about the output format of the datacursor function.

Post by wooseok2725 » Mon Oct 16, 2023 1:17 am

hello. I have a question about the datacursor function.
Even though labelstimeformat is set to "HH:mm:ss", it is output as "am:time" on the datacursor. Is there any way to fix this?

thank you.

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: I would like to ask about the output format of the datacursor function.

Post by ArctionKestutis » Mon Oct 16, 2023 7:17 am

Not sure what you mean. Maybe you could share image for clarity and more complete description of how relevant properties are set?
DataCursor should show same label style as set for Axis. Axis.LabelsTimeFormat property is taken into account only if you disabled Axis.AutoFormatLabels and set Axis..ValueType = AxisValueType.Time (or DateTime).
Note, that "HH:mm:ss" just set major tick style, but DataCursor is intended to explorer data in between. Therefore, its precision should be higher (1 or 2 decimal places).

wooseok2725
Posts: 2
Joined: Mon Oct 16, 2023 1:07 am

Re: I would like to ask about the output format of the datacursor function.

Post by wooseok2725 » Tue Oct 17, 2023 12:42 am

Image

The photo doesn't seem to be posting properly. To replace it in writing, it is as follows.

----Some x-axis settings----
<lc:ViewXY.XAxes>
<lc:AxisX
ValueType="Time"
ScrollMode="Scrolling"
LabelsColor="Black"
AxisColor="Black"
AutoFormatLabels="False"
LabelsTimeFormat="HH:mm:ss">

---datacursor tooltips contents---
CH001
X 오전 12:09:39
Y 2669.5


On the graph, when the x-axis is 00:09:39, it is a datacursor.
'오전' is 'AM'. (Korean)

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: I would like to ask about the output format of the datacursor function.

Post by ArctionKestutis » Wed Oct 18, 2023 6:14 am

After more careful checking I realized that DataCursor is actually not using Axis.LabelsTimeFormat. Only axis labels are using this format-string. Internally DataCursor uses auto-formatting (depends on Axis range) and adds few digits to increase precision. Auto-format-string is based on Region Format (Windows settings).
If you don’t want AM/PM designator to appear in DataCursor label/table, then you should modify Windows regional settings accordingly. That is, ‘Short time’ and ‘Long time’ formats should be without am/pm designators.

Hope this helps.

Post Reply