Estoy usando SciChart Library para mostrar JS Heatmap Chart.
De acuerdo con la siguiente documentación, la variable zValues se genera mediante la función de iteración , pero cuando intento usarla en mi sitio web basado en HTML y CSS, no funciona.
https://demo.scichart.com/javascript-heatmap-chart
El error que estoy recibiendo es:
Uncaught SyntaxError: Unexpected token ':'He escrito el siguiente Código:
Código:
var {sciChartSurface, wasmContext} = await SciChart.SciChartSurface.create("line_chart_3"); // Add XAxis and YAxis sciChartSurface.xAxes.add(new SciChart.NumericAxis(wasmContext)); sciChartSurface.yAxes.add(new SciChart.NumericAxis(wasmContext)); // Create a Heatmap Data-series. Pass heatValues as a number[][] to the UniformHeatmapDataSeries var initialZValues: number[][] = iterate(WIDTH, HEIGHT, 200, 0, MAX_SERIES); var heatmapDataSeries = new SciChart.UniformHeatmapDataSeries(wasmContext, { xStart: 100, xStep: 1, yStart: 100, yStep: 1, zValues: initialZValues }); // Create a Heatmap RenderableSeries with the color map. ColorMap.minimum/maximum defines the values in // HeatmapDataSeries which correspond to gradient stops at 0..1 var heatmapSeries = new SciChart.UniformHeatmapRenderableSeries(wasmContext, { dataSeries: heatmapDataSeries, colorMap: new SciChart.HeatmapColorMap( { minimum: 0, maximum: 200, gradientStops: [ { offset: 0, color: "#00008B" }, { offset: 0.2, color: "#6495ED" }, { offset: 0.4, color: "#006400" }, { offset: 0.6, color: "#7FFF00" }, { offset: 0.8, color: "#FFFF00" }, { offset: 1.0, color: "#FF0000" } ] }) });El código anterior está generando un error en: var initialZValues: number[][] = iterate(WIDTH, HEIGHT, 200, 0, MAX_SERIES);
Por favor ayuda.
La siguiente línea de código es Typescript
var initialZValues: number[][] = iterate(WIDTH, HEIGHT, 200, 0, MAX_SERIES); elimine el : number[][] y debería ejecutarse.