Pre loader

Week text format

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

0
0

Hi,

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?

Version
4.2.2.9744
  • You must to post comments
0
0

Hi Birigitta,

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
https://msdn.microsoft.com/en-us/library/dwhawy9k%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
and
https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx

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!

Best regards,
Andrew

  • You must to post comments
Showing 1 result
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