Pre loader

Custom numeric format in Vertical slices XAxis label (decimal separator)

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums


I want to display a point as a decimar separator in numeric values. I have achieved this in chart axis and vertical slices tooltips, creating a custom NumericLabelProvider (see attached picture). How can I do the same with vertical slices xacis labels? (in the picture attached, note that every numeric value has a point as a decimar separator, but vertical slice label has a comma). I have defined LabelTextFormatting of the slice with “#.##E+0”, but it doesn’t work.

Thanks in advance

Regads, Juan

  • You must to post comments

Hi Manuel,

Thanks for your reply. The reason why the label gets formatted with comma as a decimal separator is because of your localization settings. This is the default behavior, and in this MSDN article you can find the explanation:

The “.” custom format specifier inserts a localized decimal separator into the result string.

To workaround it, you could bind the Text property of AnnotationLabel directly to the X1 property and provide the desired formatting in code using value converter:

            <s:VerticalLineAnnotation ...
                <s:AnnotationLabel LabelPlacement="Axis" Text="{Binding X1, Converter=...}" />

Please don’t forget to hide the default label setting ShowLabel to “False”.

Hope this helps!

Best regards,

  • You must to post comments

Hi Yuriy,

My problem is that I create vertical line annotations in my code behind. But your answer has inspired me a solution: I have set the default label with no LabelTextFormatting, so it takes the x axis format (with point as a decimal separator), and I have added an AnnotationLabel, with LabelPlacement = bottom, for the name (see attached figure)



  • Yuriy Zadereckiy
    Hi Manuel, you are welcome! Please feel free to ask if you have any other questions.
  • You must to post comments

Hi Manuel,

From the VerticalLineAnnotation Documentation:

// Changing the Label TextFormatting
By default, the label text is formatted by the axis. See the AxisBase.CursorTextFormatting property.

You can also override the textformatting by using a .NET Formatting string by setting the VerticalLineAnnotation.LabelTextFormatting property.

   <s:VerticalLineAnnotation X1="4" Stroke="Orange" StrokeThickness="2" LabelTextFormatting="$0.00">
         <s:AnnotationLabel LabelPlacement="Axis" Foreground="White" />                   

Does this help? If not, let me know and we can investigate.

Best regards,

  • You must to post comments

No, it doesn’t work.
As I told before, I set LabelTextFormatting in c# code, but it still shows a comma separator instead of point.

It’s true that label text is formatted according to x axis by default, but i need to add some extra information on label, so I set LabeltextFormatting. Am I doing something wrong?

var slice = new VerticalLineAnnotation()
         X1 = x,
         ShowLabel = true,
         LabelPlacement = LabelPlacement.Axis,
         FontSize = 8,
         LabelTextFormatting = "Slice" + (this.mSlicesList.Count + 1).ToString() + "\r" + "#.##E+0",
         IsEditable = true,
         Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(0, 0, 255)),


  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies