Line Chart DataMarkerLabelStyle Format and Label Placement

Hello, I have data in a line chart that contains numeric data that I want to have formatted to 3 decimal places at all times.  When I use the following:  LabelFormat="##.###" it does not work as I need.  

For instance, if I have a value of 9.000 and 8.75 I want them to be displayed in the label at "9.000" and "8.750", the trailing zeros are removed though and what is rendered in the label is "9" and "8.75".  How can I achieve a full 3 digits after the decimal point?

The other issue I am having is that when I use LabelPosition="Outer" if the data marker is at the top or bottom of the graph is does not scale it's axis size to accommodate the label, instead the label is rendered partially on the screen but cut off, and in some cases cut off all together.

Graphs_Example_1.PNG

Please let me know how I can fix these two issues, thank you!

Matt


3 Replies

SS Sowndharya Selladurai Syncfusion Team May 23, 2023 02:33 PM UTC

Hi Matt Lapora,


If you want to display data with three digits after the decimal point, you can modify the LabelFormat property as follows:

LabelFormat="##.000"



To prevent label cutoff, you can set Padding to the Y axis by appending an interval. The interval is automatically calculated, so the label will not be cut off. Another suggestion is to use PlotOffSetStart to offset the rendering of the y axis at the start position.


You can find more information and examples in the following references.



In below attached the sample for reference. I hope this information is helpful. Let me know if you need further assistance.


Regards,

Sowndharya.


Attachment: ChartSample_1d34e3c2.zip


ML Matt Lapora May 23, 2023 03:14 PM UTC

This worked great, thank you for the super quick reply!


Matt



SS Sowndharya Selladurai Syncfusion Team May 24, 2023 04:41 AM UTC

Hi Matt,

Thank you for the update. 

We are glad that the provided response meets your requirements. Please let us know if you need further assistance. As always, we are happy to help you out.

Regards,

Sowndharya.


Loader.
Up arrow icon