import { MouseWheelZoomModifier } from "scichart/Charting/ChartModifiers/MouseWheelZoomModifier";
import { ZoomExtentsModifier } from "scichart/Charting/ChartModifiers/ZoomExtentsModifier";
import { ZoomPanModifier } from "scichart/Charting/ChartModifiers/ZoomPanModifier";
import { XyDataSeries } from "scichart/Charting/Model/XyDataSeries";
import { NumericAxis } from "scichart/Charting/Visuals/Axis/NumericAxis";
import { FastLineRenderableSeries } from "scichart/Charting/Visuals/RenderableSeries/FastLineRenderableSeries";
import { SciChartSurface } from "scichart/Charting/Visuals/SciChartSurface";
import { NumberRange } from "scichart/Core/NumberRange";
import { Point } from "scichart/Core/Point";
import { EAnimationType } from "scichart/types/AnimationType";
import { ShadowEffect } from "scichart/Charting/Visuals/RenderableSeries/ShadowEffect";
import { SciChartJSLightTheme } from "scichart/Charting/Themes/SciChartJSLightTheme";
import { SciChartJSDarkTheme } from "scichart/Charting/Themes/SciChartJSDarkTheme";
import { EAutoRange } from "scichart/types/AutoRange";
async function initSciChart() {
const { sciChartSurface, wasmContext } = await SciChartSurface.create(
"scichart-root"
);
// Create an X,Y Axis and add to the chart
const xAxis = new NumericAxis(wasmContext);
const yAxis = new NumericAxis(wasmContext, {visibleRange: new NumberRange(0, 11)});
//const yAxis = new NumericAxis(wasmContext, {visibleRange: new NumberRange(0, 10)});
// , {autoRange: EAutoRange.Once}
sciChartSurface.xAxes.add(xAxis);
sciChartSurface.yAxes.add(yAxis);
// Create some data and set on a line series
const xyData = new XyDataSeries(wasmContext);
for (let i = 0; i < 250; i++) {
xyData.append(i, 0);
// xyData.append(i, Math.sin(i * 0.1));
}
sciChartSurface.renderableSeries.add(
new FastLineRenderableSeries(wasmContext, { dataSeries: xyData })
);
}
initSciChart();
Visible Range is not working correctly. I found two cases getting the issue.
Case 1: visibleRange: new NumberRange(0, 10) -> if the values are 0 and 10 then the chart showing auto mode.
Case 2: xyData.append(i, 0) -> if all the values are 0 then its showing line on middle even the value is 0 to any number.
Please check the cases has some issues…
- Arun Surendran asked 2 years ago
- last edited 2 years ago
- You must login to post comments
Hi Arun,
this is a bug which has been reported already.
A VisibleRange of (0,10) is used as the default, and our internal auto ranging algorithm will try to autorange once if the visible range is equal to default. We’re working on this!
As a workaround, if you want to specify an axis visibleRange of 0,10 and never to autorange on startup, you can turn autoranging by setting EAutoRange.never
const yAxis = new NumericAxis(wasmContext, {
visibleRange: new NumberRange(0, 10),
autoRange: EAutoRange.Never
});
Best regards,
Andrew
- Andrew Burnett-Thompson answered 2 years ago
- You must login to post comments
Please login first to submit.