0

I have found examples on how to format values by applying a format to an axis, but i need to format each line that is applied to the same axis differently. The issue is that i will chart a point with a YValue of 100.5 but the cursor modifier will show 100.5xxxxx where x is a random decimal. So i need to be able to format these values by applying a format to the line itself and not the axis.

JayBate
  • 15
  • 3

1 Answers1

1

In SciChart there is the concept of TextFormatting and CursorTextFormatting. This is described in the documentation for SciChart.iOS and SciChart.Android

iOS

Axis CursorTextFormatting

The AxisCore.CursorTextFormatting property defines how text is formatted for cursor labels which appear on the axis. To change the CursorTextFormatting, use a standard NSString formatting string as follows:

// TextFormatting of cursor labels on SCINumericAxis to show two decimal places
var axis = new SCINumericAxis();
axis.CursorTextFormatting = "%.02f";

Android

Axis Overlays Formatting

Axis API allows to assign a formatting string for axis overlays, such as Cursor axis labels. Similarly to axis labels formatting, there is the setCursorTextFormatting() method for this. Likewise, it uses the same Java Format API internally, so everything aforementioned applies to the cursor labels as well.

yAxis.setCursorTextFormatting("'Price:'###.##' $'");

Remember that SciChart's Xamarin charts are a wrapper of the native iOS/Android charts, so the string formats are not .NET formats, but are NSString formats for iOS and Java formats for Android.

Dr. Andrew Burnett-Thompson
  • 20,980
  • 8
  • 88
  • 178