Pre loader

YAxis auto range

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

Closed
1
0

Hello,

we have a problem with the values on the Y-axis. We use autoRange: EAutoRange.Always, so in theory, the candles and lines should always be visible. The problem occurs when we have 1 candle or 1 OHLC and with the line chart when a new value goes beyond the current range – the value axis update only happens after the second new record. Below I am attaching the code we use; maybe something is missing or incorrect.

//create axis
 const yAxis = new NumericAxis(wasmContext, {
        autoRange: EAutoRange.Always,
        growBy: new NumberRange(0.1, 0.1),
        drawMajorBands: false,
        drawMajorTickLines: false,
        drawMinorGridLines: false,
        drawMinorTickLines: false,
        labelStyle: {
            fontSize: 11,
            fontFamily: 'Open Sans, sans-serif',
            padding: new Thickness(0, 3, 0, 0),
            color: this.theme.lineChartColor,
            alignment: ELabelAlignment.Right,
        },
        maxAutoTicks: 7,
        axisAlignment: EAxisAlignment.Right,
        labelProvider: this.getDynamicValueLabelProvider(),
    });
    const yAxisVolume = new NumericAxis(wasmContext, {
        id: USER_CHART.Y_AXIS_VOLUME_ID,
        growBy: new NumberRange(0, 4),
        isVisible: false,
        autoRange: EAutoRange.Always,
        allowFastMath: true,
    });
//create
this.getCandleSeries().dataSeries.append(this.xValues.length - 1, open, high, low, close);
//update
const currentIndex = this.getCandleSeries().dataSeries.count() - 1;
this.getCandleSeries().dataSeries.update(currentIndex, open, high, low, close);

Current view – https://ibb.co/BtCzdgS
Desired view – https://ibb.co/TknZQXG
Line – https://ibb.co/PxY0n3t – also the price annotation is invisible because the new value is out of the current range

If any other part of the code is needed, let me know.

Best regards,
Kamil

Version
3.4.652
  • Kamil Macura
    In the process of testing – it looks like it works in version 3.5.687.
  • You must to post comments
Showing 0 results