I need to format the labels of the time axis in a MSChart like “CW21”, “CW22”, … I am struggling for a while and could not find any solution yet.
-
There is a
LabelStyle.Formatproperty but this does not support (AFAIK) calendar weeks. It uses the DateTime formatting strings. Is there a way to introduce a custom formatter? -
In the framework I found the
Calendar.GetWeekOfYearmethod, which would provide me with the right week number. Now the question is how to bring these together?
Is there any good strategy to setup one’s own labels on the axis in a generic manner? (without knowing in advance the min/max points of the axis)
Yes, you can use the Chart.FormatNumber event e.g.:
Here’s the result: