Hello,
I am new to SciChart and wanted to try to implement one in a new test project for later projects.
I want to add a new chart to the normal blazor homepage.
I almost got it done and it currently looks like in the attached picture.
But I still get this error message: Unhandled exception rendering component: Cannot read properties of undefined (reading ‘SCRTDoubleVector’)
TypeError: Cannot read properties of undefined (reading ‘SCRTDoubleVector’).
I want the SciChart to initialize in my Home.razor file.
This is the code in my .js:
window.initializeSciChartWithSettings = async function () {
const {
SciChartSurface,
NumericAxis,
FastLineRenderableSeries,
XyDataSeries,
NumberRange
} = SciChart;
const { sciChartSurface, wasmContext } = await SciChartSurface.create("sciChartSurface");
sciChartSurface.xAxes.add(new NumericAxis(wasmContext));
sciChartSurface.yAxes.add(new NumericAxis(wasmContext));
const dataSeries = new XyDataSeries(sciChartSurface.engine, {
xValues: [1, 2, 3, 4, 5],
yValues: [1, 2, 3, 4, 5]
});
const lineSeries = new FastLineRenderableSeries(sciChartSurface.engine, {
dataSeries: dataSeries,
strokeThickness: 2,
stroke: "#2596BE"
});
sciChartSurface.renderableSeries.add(lineSeries);
window.sciChartSurface = sciChartSurface;
window.sciChartDataSeries = dataSeries;
return { sciChartSurface };
};
I really don´t know what to do and would be thankful for every awnser!
- Fabian Mutschler asked 5 months ago
- last edited 5 months ago
- You must login to post comments
Update: We’ve just released an official SciChart.Blazor wrapper which uses SciChart.js v4.0.933
This incorporates most of the 2D chart types and has a Razor like syntax. It also handles full lifecycle of the component and deletes SciChart memory either on dispose / or finalizer. This is currently in beta and under active development.
You can try it out here on Github, at
github.com/abtsoftware/scichart.blazor.examples
- Andrew Burnett-Thompson answered 2 months ago
- You must login to post comments
I don’t think there is sciChartSurface.engine property.
Try passing wasmContext instead.
This line
const lineSeries = new FastLineRenderableSeries(sciChartSurface.engine, {
dataSeries: dataSeries,
strokeThickness: 2,
stroke: "#2596BE"
});
Should be this
const lineSeries = new FastLineRenderableSeries(wasmContext, {
dataSeries: dataSeries,
strokeThickness: 2,
stroke: "#2596BE"
});
You can also access the wasmContext via sciChartSurface.webAssemblyContext2D so this will also work:
const lineSeries = new FastLineRenderableSeries(sciChartSurface.webAssemblyContext2D, {
// ...
});
- Jim Risen answered 5 months ago
- last edited 5 months ago
- You must login to post comments
I was able to fix the issue later that week. It indeed had something to do with the sciChartSurface.engine property. I don’t know why but it was recommended to me by the SciChartAi.
- Fabian Mutschler answered 5 months ago
- last edited 5 months ago
- You must login to post comments
Please login first to submit.

