SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
I’m sure I have seen this before on the forum or knowledge base, but I’m unable to find the page again.
I want the min and max of the visible range (DateRange) to be visible on the X-axis of a chart, no matter what. I tried to do this by overriding GetMajorTicks which simply added the min as first item inthe list and the max as last item. This works sometimes, but often the labels do not show up. How do I force SciChart to always show the min and max labels?
The visibility of the min and max labels should have precedence over any other label/tick.
Your approach with overriding the GetMajorTicks() / TickProvider is correct. However, if the labels sometimes do not show, it is likely that they are being culled. You can disable this by setting AxisBase.IsLabelCullingEnabled = false.
Disabling culling indeed prevents the labels from being removed, but this is not exactly what I want. Culling is allowed, but the min and max labels should always be there.
I do not understand the behavior shown in the attached image with label culling feature disabled. In the first image it removes all labels but one, while in the second image all labels are visible. For some reason the culling now removes both labels when they overlap?