Pre loader

How to always display start point label and last point label on xAxis?

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

Answered
1
0

x-axis starting value ​​are not displayed if the decimal point.

I hope that even if the first point label and last point label is the decimal value displayed.

(x start point : 723.07)

(x last point : 735.07)

Version
scichart 4.0.6.8583
Images
  • You must to post comments
Best Answer
1
0

Hi there,

There are a few ways to do this. First, you could try our StaticAxis feature (also described here in this FAQ) which displays labels at equal distances across the chart.

Alternatively, if you prefer the built in axis label behaviour, you can override our built-in TickProvider to draw the edge ticks always.

// Declare a TickProvider
public class NumericTickProviderWithEdges : NumericTickProvider
{
    public override IList<double> GetMajorTicks(IAxisParams axis)
    {
        // With the default calculation
        var baseTicks = base.GetMajorTicks(axis);

        // Add first label at Axis VisibleRange Min
        baseTicks.Insert(0, axis.VisibleRange.Min.ToDouble());

        // Add last label at Axis VisibleRange Max
        baseTicks.Add(axis.VisibleRange.Max.ToDouble());
    }
}

// Assign to Axis
numericAxis.TickProvider = new NumericTickProviderWithEdges();

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