SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
I have a DateTimeAxis and the user can change the TextFormat. It has to be “mm/yyyy” or “dd/yyyy” or “ww/yyyy” but in the last case it does not work. To display in month or in the day format is working, but I have to display in week format to and I don’t know how to do it. Can you please help me with these?
Please have a look at our documentation on SciChart WPF Axis Textformatting.
All Axis obey standard .NET Formatting strings via the AxisCore.TextFormatting property.
For a full list of standard .NET Formatting strings take a look at the pages
Because SciChart’s axis obeys .NET Textformatting, and because there is no text formatting for dates, it is not possible to display Week number in an axis with SciChart’s TextFormatting property.
However, all is not lost! You can actually format labels as anything you want using SciChart’s LabelProvider API.
All Axis Types include the AxisCore.LabelProvider property, which allows a class to be attached to an axis for complete control over axis label output.
Use the LabelProvider when you want to:
Have fine grained control over Axis Text or Cursor Labels, depending on numeric (or date) values
Display strings on the XAxis, e.g. “Bananas”, “Oranges”, “Apples” not “1”, “2”, “3”
Dynamically change the Axis TextFormatting as you zoom in or out
Dynamically change the Axis TextFormatting depending on Data-value
Using the LabelProvider API you should be able to achieve Week number formatting on a scichart axis. Please try it, and let us know the results!
Please login first to submit.