SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Closed
0
0

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.

Version
3.6.1
  • You must to post comments
0
0

Hi Steffan,

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.

Best regards,
Andrew

  • You must to post comments
0
0

Hello Andrew,

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?

Images
  • Andrew
    As soon as you customize a tick provider, the culling no longer works. This is because our culling alg is dependent on the assumption tick provider is unmodified. The only way I’m afraid is custom tick provider and culling OFF. This will display all labels. It won’t cull if they overlap
  • Steffan Woltjer
    I want the ticks/gridlines to be shown, but I don’t want the labels to be shown when they overlap. I guess I will have to implement some “close to min/max” boundary culling with a custom label provider.
  • You must to post comments
Showing 2 results