Greetings,
i have three Series in a SciChart.js (Community-Version) Surface.
The Legend i added shows me all three of them and their names and checkboxes do hide or show the series.
Here is my problem: Is there a way to hide one Series (a FastCandlestickRenderableSeries) from the Legend? I only want to show the other two Series (FastLinerenderableSeries).
Somethin like a Parameter “showInLegend: false,”? I did not find something like this in the documentation(https://www.scichart.com/documentation/js/current/typedoc/classes/legendmodifier.html).
Thank you
- Sebastian Affeld asked 9 months ago
- last active 9 months ago
Hi, I want to color the axis label by its value,
eg.
value < 0 -> show red color
value = 0 -> show gray color
value > 0 -> show green color
similar to this question, but in javascript platform, it seems the LabelProvider has function related to the value(string) formatting only. Is there any ways to styling the label? Thanks!
- chinghung lai asked 2 years ago
- last active 2 years ago
Hello,
Is there a way to render textbox as an annotation in the chart ? The workaround i could think of is to use CustomAnnotation and supply SVG (svgString) with HTML input tag enclosed. Please let me know if there is a better way to perform this.
- vamsi kunchaparthi asked 3 years ago
- last active 3 years ago
I have a real time updated chart with very large data size and I am facing the slow client problem. i.e. The data sending speed is faster than the data receiving and handling speed which causes memory growing up issue. I am trying to use Web Workers to increase the data handling speed in frontend. I have found a related post:
https://www.scichart.com/questions/wpf/is-xydataseries-safe-to-being-changed-in-a-separate-thread
It seems possible to update XyDataSeries in the background thread with WPF. My UI is built with NextJS. I tried to use Web Workers to implement multiple threads. But I found that it can’t pass the SciChartSurface or XyDataSeries to the worker thread. Could you show me an example on how to update XyDataSeries in the worker thread with Web Workers?
- Quyen Sy asked 1 year ago
- last active 1 year ago
Hello to everyone. I want to take the starting point of my bar charts as 20, for example, rather than 0. If the data is 3, I want to create a bar chart going from point 20 to 23, and if it is -3, from point 20 to 17, can you help me?
- Can Ata Tekirdağlı asked 4 months ago
After moving from version: 1.4.1575 to version: 1.4.1611 we are seeing the the Cursor modifier replicating across all the charts in our dashboard. Obviously this is not desirable. I’ve attached screenshots to show this.
Please could you advise?
- Henrique Rodrigues asked 3 years ago
I am using NextJS with the SciChart trial license for development and suddenly got the error “SciChart: WebGL not supported! ” with Chrome. It worked fine before, and I didn’t change any codes for launching the chart. Also, it works fine with Firefox. The chrome version I am using is 107.0.5304.107.
BTW, the error is gone after I restarted my computer. Is it possible to be related to memory issue?
Below are my codes for initializing the chart:
const initSciChart = () => {
// LICENSING //
SciChartSurface.setRuntimeLicenseKey("xxx");
SciChartDefaults.enableResampling = true;
SciChartDefaults.asyncLabels = true;
SciChartDefaults.useSharedCache = true;
drawSpecChart();
};
async function drawSpecChart() {
// Create the SciChartSurface in the div 'scichart-root'
// The SciChartSurface, and webassembly context 'wasmContext' are paired. This wasmContext
// instance must be passed to other types that exist on the same surface.
let xAxesNumberRange = new NumberRange(0, 18);
let yAxesNumberRange = new NumberRange(-140, -40);
const chartDefinition = {
xAxes: [{
type: EAxisType.NumericAxis,
options: {
axisTitle: "Frequency (GHz)",
axisTitleStyle: {
fontSize: 12,
fontFamily: "sans-serif",
fontWeight: "bold"
},
labelStyle: {
fontSize: 12,
fontFamily: "sans-serif"
},
visibleRange: xAxesNumberRange,
zoomExtentsRange: xAxesNumberRange,
labelFormat: ENumericFormat.Decimal,
labelPrecision: 6,
cursorLabelFormat: ENumericFormat.Decimal,
cursorLabelPrecision: 6,
drawMajorBands: false,
}
}],
yAxes: [{
type: EAxisType.NumericAxis,
options: {
axisTitle: "Power (dBm)",
axisTitleStyle: {
fontSize: 12,
fontFamily: "sans-serif",
fontWeight: "bold"
},
labelStyle: {
fontSize: 12,
fontFamily: "sans-serif"
},
autoTicks: false,
majorDelta: 10,
minorDelta: 5,
axisAlignment: EAxisAlignment.Left,
visibleRange: yAxesNumberRange,
zoomExtentsRange: yAxesNumberRange,
labelFormat: ENumericFormat.Decimal,
labelPrecision: 2,
cursorLabelFormat: ENumericFormat.Decimal,
cursorLabelPrecision: 2,
drawMajorBands: false,
},
}],
series: [],
modifiers: [
{ type: EChart2DModifierType.MouseWheelZoom },
{
type: EChart2DModifierType.ZoomExtents,
options: {
isAnimated: false
}
}
]
};
const { sciChartSurface, wasmContext } = await chartBuilder.build2DChart("scichart-root", chartDefinition);
xAxesNumberRange = null;
yAxesNumberRange = null;
};
- Kelly Chan asked 2 years ago
- last active 2 years ago
Hello, I’d like to know how is possible to draw Axis Bands from one data point to another.
I’m currently creating real-time stock charts and I need to display the after-hours with a different band.
Thanks in advanced for your help,
- Eliezer Veras asked 2 years ago
- last active 2 years ago
I’m creating a web application in which I have a little bit over a million data points. When toggling annotations (about 4000) on one of my charts I noticed the memory usage of Chrome was doubled. I did some tinkering and found out this behaviour only occurred when I had “strokeDashArray” set in my VerticalLineAnnotations.
for (let i = 0; i < 5000; i++) {
const line = new VerticalLineAnnotation({
x1: i,
strokeDashArray: [5, 5] //If this is removed then the memory usage drops
});
sciChartSurface.annotations.add(line);
}
Is there a known memory problem with dashed lines or anything I might do wrong?
- Niklas Åkerlind asked 1 week ago
- last active 4 days ago
Hi everyone,
Wanted to check if there is an existing implementation of NonUniformGridDataSeries3D in js. Had a use case that requires plotting of a 3d mesh with non-uniform grid. I could only find UniformGridDataSeries3D. Can someone please help?
- Ayush Sarraf asked 2 weeks ago
I need help to make the SciChart surface grid to always look like squares instead of rectangles(like in the screenshot attached).
Does anyone have solved this yet ?
- dimitar chetelev asked 5 months ago
- last active 5 months ago
Hi Support Team.
I’m working on SciChart with React 16.9 . Licensed by EOG Resouces.
Can you guys please let me know how to custom tooltip/legend on SciChart (JS)?
My custom function is below. Thank all
export async function initSciChart(
chartDiv: string,
chartData: Array<{ x: Array<number>; y: Array<number> }>,
handleMouseMove?: (args: ModifierMouseArgs) => void,
) {
// Create the SciChartSurface in the div 'scichart-root'
const theme = {
...new SciChartJSDarkv2Theme(),
sciChartBackground: '#191F26',
};
const { sciChartSurface, wasmContext } = await SciChartSurface.create(
chartDiv,
{ theme },
);
const legend = new LegendModifier({
orientation: ELegendOrientation.Horizontal,
// placementDivId: 'legend-div-id',
showSeriesMarkers: true,
showLegend: false,
showCheckboxes: false,
isCheckedChangedCallback: (series, isChecked) => {
// isChecked callback only works if showCheckboxes=true
console.log(
`Option 1: Legend item ${series.type} isChecked=${isChecked}`,
);
},
});
sciChartSurface.chartModifiers.add(
// new ZoomPanModifier(),
new RolloverModifier({ placementDivId: 'legend-div-id' }), // enable tooltip
new RubberBandXyZoomModifier(),
new MouseWheelZoomModifier(),
new ZoomExtentsModifier(),
new XAxisDragModifier(),
new YAxisDragModifier(),
legend,
new CursorModifier({
//placementDivId: 'legend-div-id',
//tooltipDataTemplate: customTemplate,
//tooltipLegendTemplate: getTooltipLegendTemplate,
// tooltipSvgTemplate: tooltipSvgTemplate,
}), // enable cursor - yValue and xValue
);
sciChartSurface.xAxes.add(
new NumericAxis(wasmContext, {
drawMajorGridLines: false,
drawMinorGridLines: false,
drawMajorBands: false,
visibleRangeLimit: new NumberRange(
Math.min(...chartData[0].x),
Math.max(...chartData[0].x),
),
}),
);
sciChartSurface.yAxes.add(
new NumericAxis(wasmContext, {
drawMajorGridLines: false,
drawMinorGridLines: false,
drawMajorBands: false,
zoomExtentsToInitialRange: false,
autoRange: EAutoRange.Always,
}),
);
chartData.forEach((seriesData, index) => {
const lineSeries = new FastLineRenderableSeries(wasmContext, {
stroke: AUTO_COLOR,
strokeThickness: index % 2 === 0 ? 3 : 1,
dataSeries: new XyDataSeries(wasmContext, {
xValues: seriesData.x,
yValues: seriesData.y,
dataSeriesName: `series-${index}`,
}),
});
lineSeries.rolloverModifierProps.tooltipLegendTemplate = (
tooltipProps: RolloverModifierRenderableSeriesProps,
seriesInfo: SeriesInfo,
) => {
return `<svg width="340" height="25">
<rect width="100%" height="100%" fill="#000000DD" stroke="grey" stroke-width="2" />
<svg width="100%">
<text x="8" y="16" font-size="13" font-family="Verdana" fill="red">Custom Legend Tooltip</text>
<text x="180" y="16" font-size="13" font-family="Verdana" fill="lightblue">X: ${seriesInfo.formattedXValue}</text>
<text x="260" y="16" font-size="13" font-family="Verdana" fill="green">Y: ${seriesInfo.formattedYValue}</text>
</svg>
</svg>`;
};
sciChartSurface.renderableSeries.add(lineSeries);
//Custom event on chart
if (sciChartSurface && handleMouseMove) {
const customModifider = new FacilityBalanceChartModifier();
sciChartSurface.chartModifiers.add(customModifider);
customModifider.modifierMouseMove = handleMouseMove;
}
});
return { sciChartSurface, wasmContext };
}
- TRUONG LE asked 11 months ago
- last active 10 months ago
I am implementing a heatmap chart and would like to allow users to adjust the color mapping of the heatmap by adding sliders to the heatmap legend (Please refer to the attached screenshot). Does SciChart support color slider for HeatmapLegend?
- Quyen Sy asked 1 year ago
- last active 1 year ago
I have combed through KB articles and other documentations and samples here and SO, but I am not able to fix the issue. I am desperate for any help.
I have a react app that shows the chart, but at the top of the page, I have a header section and the remaining height is filled with Chart. All the samples and answers that I have seen thus far has no header section on the page. So the chart is 100% filled within it’s container. But, in my case the chart does not fit its container width & height and I end up with a scroll-bar. This is especially evident when you maximize the page (Chrome maximize window).
I am on Windows 10.
I have attached the code and a screen-shot of what the resulting page in Chrome. I have tried with and without CSS and it made no difference in terms of chart filling its container.
React Code:
import { useCallback, useEffect, useState } from 'react';
import { createRoot } from 'react-dom/client';
import './Chart-styles.scss';
import { SciChartSurface } from 'scichart/Charting/Visuals/SciChartSurface';
import { NumericAxis } from 'scichart/Charting/Visuals/Axis/NumericAxis';
import { getSciChartLicense } from '../common/chartUtils';
const Chart = () => {
const [chartId] = useState('line-chart');
const initChartAsync = useCallback(async () => {
const { sciChartSurface, wasmContext } = await SciChartSurface.create(chartId);
const xAxis = new NumericAxis(wasmContext);
const yAxis = new NumericAxis(wasmContext);
sciChartSurface.xAxes.add(xAxis);
sciChartSurface.yAxes.add(yAxis);
}, []);
useEffect(() => {
SciChartSurface.setRuntimeLicenseKey(getSciChartLicense());
initChartAsync()
.catch(error => {
console.error('ChartRenderer | useEffect | initChartAsync failed!', error);
});
}, [chartId]);
return (
<div className="App">
<div className='App-header'>
<h2>Chart Header</h2>
<h3>Chart Sub-Header</h3>
</div>
<div
id={chartId}
style={{width: '100%', height: '100%'}}
/>
</div>
);
};
const container = document.getElementById('app');
const root = createRoot(container!);
root.render(<Chart/>);
Chart-Style.scss
#app {
display: flex;
flex-flow: column nowrap;
margin: 0;
padding: 0;
}
.App {
flex: 1 1 auto;
display: flex;
flex-flow: column nowrap;
text-align: center;
}
.App-header {
flex: 0 1 auto;
display: flex;
flex-flow: column nowrap;
background-color: #855b24;
color: white;
h2 {
background-color: #2e2e2d;
flex: 0 1 auto;
margin: 0;
padding: 2px;
}
h3 {
background-color: #5c5c5b;
flex: 0 1 auto;
margin: 0;
padding: 2px;
}
}
#line-chart {
flex: 1 1 auto;
}
- sachin patel asked 2 years ago
- last active 2 years ago
Hi, so I need to get the data of an annotation when clicked, I have tried with addEventListener ‘mousedown’ event and it work for most case, but the issue comes when some annotations are overlapping.
codesandbox example: https://codesandbox.io/s/vertically-stacked-axes-forked-smkd8v?file=/src/App.tsx
In the codesandbox example, you will see that M1 and M2 are overlapping, if I were to click on M2, the click event will return both M1 and M2, but I only want M2 to be return since I only click on M2.
I couldn’t make the clicking to work on codesandbox but I’m sure you get the idea. I have tested it on my local and I got that issue.
Please let me know if you got any other question, thank you.
- Nung Khual asked 7 months ago
- last active 7 months ago
Hello, I just started evaluating your 2D JS chart library and am running into an error (below) and don’t know what I should do to continue forward:
Error:
wasm streaming compile failed: TypeError: Failed to execute ‘compile’
on ‘WebAssembly’: Incorrect response MIME type. Expected
‘application/wasm’.falling back to ArrayBuffer instantiation
failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0
CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0
Could not load SciChart WebAssembly module.
Check your build process and ensure that your scichart2d.wasm, scichart2d.data and scichart2d.js files are from the same versionUncaught (in promise) Could not load SciChart WebAssembly module.
Check your build process and ensure that your scichart2d.wasm, scichart2d.data and scichart2d.js files are from the same version
I am copying the scichart2d.data and scichart2d.wasm in my webpack config as follows (according to your tutorials):
config.plugins.push(
new CopyPlugin({
patterns: [
// {
// from: 'src/index.html',
// to: '',
// },
{
from: 'node_modules/scichart/_wasm/scichart2d.data',
to: '',
},
{
from: 'node_modules/scichart/_wasm/scichart2d.wasm',
to: '',
},
],
})
I have since then done the following but to no avail:
- Restart my webpack-dev-server -> In chrome, “Empty cache and refresh”
- Delete my node_modules folder -> yarn install -> yarn start
Can someone please help me with this issue at an earliest convenience.
- sachin patel asked 2 years ago
- last active 5 months ago
Good afternoon. Scichart WPF has two built-in small buttons in the top right corner of the panels for collapsing and closing charts. How can you add such buttons in Scichart javascript and how to correctly describe the functions?
- Alexksandr Shvabskiy asked 7 months ago
- last active 6 months ago
Hi,
Is it possible to either rotate a TextAnnotation, not necessarily by user interaction but even just in code to have text going vertically?
Cheers,
- Adam Stone asked 2 years ago
- last active 2 years ago
How to achieve the Sci Chat functionality in JavaScript . I want to update the list instead of removing a range of data from the dataseries.
- manoj prabakar asked 1 year ago
- last active 1 year ago
Hi,
I have a uniform heatmap with multiple ’tiles’ of data loaded in, by using multiple UniformHeatmapDataSeries / UniformHeatmapRenderableSeries.
The user is allowed to pan around/zoom around the heatmap.
I want to build two charts to display the ‘visible heatmap average’, one for each axis. For example, I would display a line chart underneath the heatmap. The first point on this line chart would represent the average value of all cells in the first column of the heatmap – I need this to take into account all of the UniformHeatmapDataSeries that are currently in the viewport, treating them as a singular heatmap.
I’ve seen the NumericAxis.getCurrentCoordinateCalculator(), which looks promising, but I’ve not yet worked out if that can do what I need.
Any thoughts on the best approach?
Thanks
Joe
- Henrique Rodrigues asked 3 years ago
- last active 3 years ago
Dear Andrew,
As mentioned in the previous question. we are getting ready to implement a comprehensive annotation and labeling functionality to our application. Although I know how to add scalable custom-annotations (your team guided us with the implementation in the past), an important part of of annotation functionality is. ability to edit the annotations. But I am having trouble accessing and interacting the the annotations.
How can I access the svg polygon nodes from the custom annotation and drag and move them? I have attched a video to show the existing functionality.
Best,
Pramod
- pramod butte asked 5 months ago
- last active 5 months ago
Hi,
In my application I am using two charts for represent different values. I am using LegendModifier on the first chart. Is it possible when i uncheck the series on first chart and the same color series on second chart also need to hide from the second chart. Any event callback function available in LegendModifier ?
- Arun Surendran asked 2 years ago
- last active 2 years ago
The scichart y axis is displayed as undefined after updating the data in timed interval. The y axis initially shows the value,but after the data is appended to the source, the y axis is shown as undefined in the chart.
I have attached the final scichart image with yaxis as undefined.
- Leo Leslin asked 1 year ago
- last active 1 year ago
I am implementing a waterfall chart with non-uniforma heatmap. I found that the live update doesn’t work. I keep updating the zValues with live data but the chart just show 1 row of data. If I resize the chart (my heatmap is inside a resizable container), I can see the updated data (i.e. Each time I resize the chart, the chart updated and show updated data). Do you have any example of live updated non-uniform heatmap? Below are my codes:
Draw the heatmap:
const SPECTROGRAM_HEIGHT = 256;
const SPECTROGRAM_WIDTH = 100;
const { sciChartSurface, wasmContext } = await SciChartSurface.create("spectrogram-chart-root");
const xAxis = new NumericAxis(wasmContext, {
axisTitle: "Frequency",
axisTitleStyle: {
fontSize: CHART_STYLE.AXIS_FONT_SIZE,
fontFamily: "sans-serif",
fontWeight: "bold"
},
labelStyle: {
fontSize: CHART_STYLE.LABEL_FONT_SIZE,
fontFamily: "sans-serif"
},
labelFormat: ENumericFormat.Decimal,
labelPrecision: 6,
cursorLabelFormat: ENumericFormat.Decimal,
cursorLabelPrecision: 6,
drawMajorBands: false,
});
const yAxis = new NumericAxis(wasmContext, {
axisTitle: "Time",
axisTitleStyle: {
fontSize: CHART_STYLE.AXIS_FONT_SIZE,
fontFamily: "sans-serif",
fontWeight: "bold"
},
labelStyle: {
fontSize: CHART_STYLE.LABEL_FONT_SIZE,
fontFamily: "sans-serif"
},
drawMajorBands: false,
});
// Add XAxis and YAxis
sciChartSurface.xAxes.add(xAxis);
sciChartSurface.yAxes.add(yAxis);
const colorMap = new HeatmapColorMap({
minimum: -200,
maximum: -50,
gradientStops: [
{ offset: 0, color: "Transparent" },
{ offset: 0.01, color: COLORS.DARK_BLUE },
{ offset: 0.4, color: COLORS.BLUE },
{ offset: 0.5, color: COLORS.GREEN },
{ offset: 0.6, color: COLORS.YELLOW },
{ offset: 0.8, color: COLORS.RED },
{ offset: 1, color: COLORS.DARK_RED },
]
});
// Create a Heatmap Data-series. Pass heatValues as a number[][] to the UniformHeatmapDataSeries
zValues = Array.from(Array(SPECTROGRAM_HEIGHT), () => Array(SPECTROGRAM_WIDTH).fill(-200));
const heatmapSeries = new NonUniformHeatmapRenderableSeries(wasmContext, {
dataSeries: new NonUniformHeatmapDataSeries(wasmContext, { zValues: zValues, xCellOffsets: getHeatmapXOffset, yCellOffsets: getHeatmapYOffset }),
colorMap: colorMap,
useLinearTextureFiltering: true,
fillValuesOutOfRange: true,
});
// Add heatmap to the chart
sciChartSurface.renderableSeries.add(heatmapSeries);
I simply return the index for testing in the getHeatmapXOffset and getHeatmapYOffset functions:
const getHeatmapXOffset = (index) => {
return index;
};
const getHeatmapYOffset = (index) => {
return index;
};
Reset zValues when number of data point changed:
spectrogramZValues = Array.from(Array(SPECTROGRAM_HEIGHT), () => Array(newWidth).fill(-200));
heatmapSeries.dataSeries.setZValues(spectrogramZValues);
sciChartSurface.zoomExtents();
Update the zValues array when there is new data (I tried to add call zoomExtens() after notifyDataChanged but still didn’t work):
spectrogramZValues.shift();
spectrogramZValues.push(newData);
heatmapSeries.current.dataSeries.notifyDataChanged();
- Quyen Sy asked 1 year ago
- last active 1 year ago
I updated schichart to the very last version and turn on the memory usage debug mode to see if there are any memory leaks in our application and ran into the following problem.
When MemoryUsageHelper.isMemoryUsageDebugEnabled = true;
and sciChartSurface has the following modifiers(RolloverModifier, CursorModifier) when moving the mouse over the chart I have the following console warnings.
From RolloverModifier instance
From CursorModifier instance
The message below is written on your docs about debugging, so I gues this is the case with the chart modifiers console warnings.
Usually this boils down to failing to call SciChartSurface.delete()
(or series.delete()
, annotation.delete()
when adding/removing objects) or plain JavaScript memory leaks where references to SciChart are held in the customer application & not garbage collected by the browser.
Steps To Reproduce
- Follow the codesandbox example by the link https://codesandbox.io/s/ts-band-chart-xwlxcm?file=/src/App.tsx;
- Once the chart is loaded and rendered, try moving the mouse cursor over the chart;
- Open the browser console ⇒ You will see the warnings I wrote about above.
The current behavior
Moving the mouse over the chart causes warning logs to appear in the browser console and possibly memory leaks.
The expected behavior
No warning logs while moving the mouse over the chart.
- Sergey Chernyakov asked 9 months ago
- last active 8 months ago
I would like to create an annotation in which users can have a multi-line text annotation which can be looks like text-box
- Ramesh Sippy asked 2 years ago
I have a simple need to display a horizontal heatmap based on values along the x-axis. So if value on x-axis is 1, color shown on the heatmap should be orange, if the next value is 2, red color bar appears to next the previous orange etc. Something like this (see attached graphic also):
Heatmap: [=orange=red=green]
values along x-axis: [22.05, 24.00, 30.00 ]
So the code I am trying is as follows:
export async function renderHeatMap(element)
{
const { sciChartSurface, wasmContext } = await SciChartSurface.create(element);
sciChartSurface.xAxes.add(new NumericAxis(wasmContext));
sciChartSurface.yAxes.add(new NumericAxis(wasmContext));
var heatMapData = zeroArray2D([1, 5]);
heatMapData[0][0] = 22.05; //should appear as color1 in heatmap
heatMapData[0][1] = 24.00; //...
heatMapData[0][2] = 30.00; //should appear as color2 in heatmap
heatMapData[0][3] = 26.75;
heatMapData[0][4] = 30.00; //should appear as color3 in heatmap
const heatmapDataSeries = new UniformHeatmapDataSeries(wasmContext, 0, 1, 0, 1, heatMapData);
const heatmapSeries = new UniformHeatmapRenderableSeries(wasmContext, {
dataSeries: heatmapDataSeries,
colorMap: new HeatmapColorMap({
minimum: 20, // min value in the zValues (data) to map to offset 0 in the colormap
maximum: 30, // max value in the zValues (data) to map to offset 1 in the colormap
gradientStops: [
{ offset: 0, color: "#00008B" },
{ offset: 0.3, color: "#7FFF00" },
{ offset: 0.7, color: "#FFFF00" },
{ offset: 1.0, color: "#FF0000" },
],
}),
});
sciChartSurface.renderableSeries.add(heatmapSeries);
}
But this only displays an empty grid. I don’t see a heatmap. Anyone can point out what may be wrong? Not even the axis is showing up correctly.
- Joel Roberts asked 2 years ago
- last active 5 months ago
Hello!
Tell me what I’m doing wrong?
Here’s the code
import { NumericAxis } from "scichart/Charting/Visuals/Axis/NumericAxis";
import { FastLineRenderableSeries } from "scichart/Charting/Visuals/RenderableSeries/FastLineRenderableSeries";
import { EllipsePointMarker } from "scichart/Charting/Visuals/PointMarkers/EllipsePointMarker";
import { RolloverModifier, TRolloverTooltipDataTemplate } from "scichart/Charting/ChartModifiers/RolloverModifier";
import { ZoomPanModifier } from "scichart/Charting/ChartModifiers/ZoomPanModifier";
import { ZoomExtentsModifier } from "scichart/Charting/ChartModifiers/ZoomExtentsModifier";
import { MouseWheelZoomModifier } from "scichart/Charting/ChartModifiers/MouseWheelZoomModifier";
import { SciChartSurface } from "scichart";
import { parseColorToUIntArgb } from "scichart/utils/parseColor";
import { XyDataSeries } from "scichart/Charting/Model/XyDataSeries";
import { CategoryAxis } from "scichart/Charting/Visuals/Axis/CategoryAxis";
import { TextLabelProvider } from "scichart/Charting/Visuals/Axis/LabelProvider/TextLabelProvider";
import { Thickness } from "scichart/Core/Thickness";
import { ELabelAlignment } from "scichart/types/LabelAlignment";
const dataData=[
"2022-10-22 00:09:41",
"2022-10-22 00:19:37",
"2022-10-22 00:29:16",
"2022-10-22 00:38:51",
"2022-10-22 00:49:49",
"2022-10-22 00:59:37",
"2022-10-22 01:09:25",
"2022-10-22 01:19:26",
"2022-10-22 01:28:35",
"2022-10-22 01:38:47",
"2022-10-22 01:48:29",
"2022-10-22 01:58:30",
"2022-10-22 02:09:11",
"2022-10-22 02:18:45",
"2022-10-22 02:28:41",
"2022-10-22 02:38:38",
"2022-10-22 02:48:53",
"2022-10-22 02:59:39",
"2022-10-22 03:08:51",
"2022-10-22 03:19:00",
"2022-10-22 03:28:30",
"2022-10-22 03:38:51",
"2022-10-22 03:49:01",
"2022-10-22 03:58:35",
"2022-10-22 04:08:47",
"2022-10-22 04:19:11",
"2022-10-22 04:29:05",
"2022-10-22 04:38:39",
"2022-10-22 04:48:46",
"2022-10-22 04:58:57",
"2022-10-22 05:08:22",
"2022-10-22 05:18:30",
"2022-10-22 05:29:09",
"2022-10-22 05:38:56",
"2022-10-22 05:48:35",
"2022-10-22 05:58:34",
"2022-10-22 06:08:26",
"2022-10-22 06:18:58",
"2022-10-22 06:28:33",
"2022-10-22 06:38:56",
"2022-10-22 06:48:42",
"2022-10-22 06:58:55",
"2022-10-22 07:08:59",
"2022-10-22 07:19:03",
"2022-10-22 07:28:28",
"2022-10-22 07:38:18",
"2022-10-22 07:48:35",
"2022-10-22 07:58:18",
"2022-10-22 08:08:22",
"2022-10-22 08:18:43",
"2022-10-22 08:29:01",
"2022-10-22 08:38:59",
"2022-10-22 08:49:16",
"2022-10-22 08:59:13",
"2022-10-22 09:09:24",
"2022-10-22 09:18:36",
"2022-10-22 09:28:56",
"2022-10-22 09:39:13",
"2022-10-22 09:48:35",
"2022-10-22 09:59:14",
"2022-10-22 10:09:18",
"2022-10-22 10:19:04",
"2022-10-22 10:29:34",
"2022-10-22 10:39:14",
"2022-10-22 10:48:53",
"2022-10-22 10:58:40",
"2022-10-22 11:08:58",
"2022-10-22 11:18:47",
"2022-10-22 11:28:39",
"2022-10-22 11:39:13",
"2022-10-22 11:49:00",
"2022-10-22 11:59:13",
"2022-10-22 14:20:05",
"2022-10-22 14:29:37",
"2022-10-22 14:39:49",
"2022-10-22 14:49:41",
"2022-10-22 15:00:10",
"2022-10-22 15:09:27",
"2022-10-22 15:19:49",
"2022-10-22 15:29:41",
"2022-10-22 15:39:16",
"2022-10-22 15:49:48",
"2022-10-22 15:59:52",
"2022-10-22 16:09:29",
"2022-10-22 16:19:48",
"2022-10-22 16:29:40",
"2022-10-22 16:39:20",
"2022-10-22 16:49:57",
"2022-10-22 16:59:11",
"2022-10-22 17:09:37",
"2022-10-22 17:19:00",
"2022-10-22 17:29:21",
"2022-10-22 17:39:52",
"2022-10-22 17:49:44",
"2022-10-22 17:59:50",
"2022-10-22 18:09:38",
"2022-10-22 18:19:24",
"2022-10-22 18:29:13",
"2022-10-22 18:39:05",
"2022-10-22 18:49:09",
"2022-10-22 18:59:13",
"2022-10-22 19:09:17",
"2022-10-22 19:19:06",
"2022-10-22 19:29:37",
"2022-10-22 19:40:11",
"2022-10-22 19:49:33",
"2022-10-22 19:59:14",
"2022-10-22 20:09:07",
"2022-10-22 20:20:02",
"2022-10-22 20:29:19",
"2022-10-22 20:39:13",
"2022-10-22 20:49:43",
"2022-10-22 20:59:28",
"2022-10-22 21:08:59",
"2022-10-22 21:19:03",
"2022-10-22 21:29:14",
"2022-10-22 21:39:19",
"2022-10-22 21:49:40",
"2022-10-22 21:59:04",
"2022-10-22 22:09:33",
"2022-10-22 22:20:00",
"2022-10-22 22:30:25",
"2022-10-22 22:39:43",
"2022-10-22 22:49:13",
"2022-10-22 22:58:58",
"2022-10-22 23:09:05",
"2022-10-22 23:19:12",
"2022-10-22 23:29:49",
"2022-10-22 23:38:55",
"2022-10-22 23:49:41",
"2022-10-22 23:59:32",
"2022-10-23 00:08:34",
"2022-10-23 00:18:43",
"2022-10-23 00:29:20",
"2022-10-23 00:39:13",
"2022-10-23 00:48:30",
"2022-10-23 00:59:44",
"2022-10-23 01:08:49",
"2022-10-23 01:19:00",
"2022-10-23 01:29:22",
"2022-10-23 01:39:06",
"2022-10-23 01:49:08",
"2022-10-23 01:59:19",
"2022-10-23 02:09:28",
"2022-10-23 02:18:57",
"2022-10-23 02:28:53",
"2022-10-23 02:38:44",
"2022-10-23 02:49:12",
"2022-10-23 02:58:41",
"2022-10-23 03:09:04",
"2022-10-23 03:19:28",
"2022-10-23 03:29:23",
"2022-10-23 03:38:38",
"2022-10-23 03:49:00",
"2022-10-23 03:59:16",
"2022-10-23 04:09:13",
"2022-10-23 04:18:54",
"2022-10-23 04:29:43",
"2022-10-23 04:39:27",
"2022-10-23 04:49:12",
"2022-10-23 04:59:07",
"2022-10-23 05:09:04",
"2022-10-23 05:18:50",
"2022-10-23 05:29:20",
"2022-10-23 05:39:06",
"2022-10-23 05:49:17",
"2022-10-23 05:58:48",
"2022-10-23 06:08:46",
"2022-10-23 06:18:36",
"2022-10-23 06:29:15",
"2022-10-23 06:38:57",
"2022-10-23 06:49:23",
"2022-10-23 06:58:55",
"2022-10-23 07:09:06",
"2022-10-23 07:19:01",
"2022-10-23 07:29:09",
"2022-10-23 07:39:10",
"2022-10-23 07:49:06",
"2022-10-23 07:59:06",
"2022-10-23 08:09:07",
"2022-10-23 08:19:23",
"2022-10-24 14:19:20",
"2022-10-24 14:30:23",
"2022-10-25 11:10:12",
"2022-10-25 11:20:56",
"2022-10-28 19:19:35",
"2022-10-28 19:30:53",
"2022-10-28 19:49:34"
]
const divElementId = "scichart-root"
class MyMetadata {
static create(title, previousValue, isSelected) {
const md = new MyMetadata()
md.title = title
md.previousValue = previousValue ?? md.previousValue
md.isSelected = isSelected ?? md.isSelected
return md
}
isSelected = false
palettedStrokeRed = parseColorToUIntArgb("red")
palettedStrokeGreen = parseColorToUIntArgb("green")
constructor() {}
}
const tooltipDataTemplateRS = seriesInfo => {
const valuesWithLabels = []
// Line Series
const xySeriesInfo = seriesInfo
if (seriesInfo.pointMetadata) {
const testMd = seriesInfo.pointMetadata
valuesWithLabels.push(
testMd.title + " Previous: " + testMd.previousValue.toFixed(1)
)
}
valuesWithLabels.push(
"X: " + xySeriesInfo.formattedXValue + " Y: " + xySeriesInfo.formattedYValue
)
return valuesWithLabels
}
const color = "#368BC1"
const drawExample = async () => {
const { sciChartSurface, wasmContext } = await SciChartSurface.create(
divElementId
)
const xAxis = new CategoryAxis(wasmContext);
const labelProvider = new TextLabelProvider({
// When passed as an array, labels will be used in order
labels: dataData,
maxLength: 188
});
xAxis.labelProvider = labelProvider;
xAxis.labelStyle.alignment = ELabelAlignment.Center;
xAxis.labelStyle.padding = new Thickness(2,1,2,1);
xAxis.axisRenderer.hideOverlappingLabels = false;
xAxis.axisRenderer.keepLabelsWithinAxis = false;
sciChartSurface.xAxes.add(xAxis)
const yAxis = new NumericAxis(wasmContext)
sciChartSurface.yAxes.add(yAxis)
for (let seriesIndex = 0; seriesIndex < 5; seriesIndex++) {
const firstSeriesData = createDataSeries(wasmContext, seriesIndex, {
dataSeriesName: "Sinewave"+seriesIndex
})
const renderableSeries1 = new FastLineRenderableSeries(wasmContext, {
stroke: color,
strokeThickness: 3,
dataSeries: firstSeriesData,
pointMarker: new EllipsePointMarker(wasmContext, {
width: 5,
height: 5,
strokeThickness: 2,
fill: "white",
stroke: color
})
})
renderableSeries1.rolloverModifierProps.markerColor = color
renderableSeries1.rolloverModifierProps.tooltipColor = color
sciChartSurface.renderableSeries.add(renderableSeries1)
renderableSeries1.rolloverModifierProps.tooltipDataTemplate = tooltipDataTemplateRS
}
sciChartSurface.chartModifiers.add(new RolloverModifier())
sciChartSurface.chartModifiers.add(new ZoomPanModifier())
sciChartSurface.chartModifiers.add(new ZoomExtentsModifier())
sciChartSurface.chartModifiers.add(new MouseWheelZoomModifier())
sciChartSurface.zoomExtents()
return { sciChartSurface, wasmContext }
}
// Generate some data, including metadata
const createDataSeries = (wasmContext, index, options) => {
const sigma = Math.pow(0.6, index)
const dataSeries = new XyDataSeries(wasmContext, options)
let prev = 0
for (let i = 0; i < 188; i++) {
const grow = 1 + i / 99
const metadata =i > 0 ? MyMetadata.create("Metadata " + i.toString(), prev) : undefined
const y = Math.sin((Math.PI * i) / 15) * grow * sigma
// metadata is an optional parameter on all data manipulation methods on dataseries,
// so it can also be added as an array eg dataSeries.appendRange(xValues, yValues, metadataArray);
dataSeries.append(i+1, y, metadata)
prev = y
}
return dataSeries
}
drawExample()
- js scichart asked 2 years ago
- last active 2 years ago
I am facing a little hurdle in plotting the date value to the chart.
How to add the date to chart x axis and numeric value to the y axis?
Please provide a example to add the date in x axis and numeric value in the y axis.
Please provide a example with one series in the y axis.
I have a requirement to plot the patient vital signs, the date value in x axis and vital signs in y axis.
x – Date when the vital sign is captured
y1, y2, y3, y4, y5 – BP, Heart rate & other vital signs
The model data looks like below.
{“x”:”29-Nov-2022 04:37″,”y1″:”119″,”y2″:”80″,”y3″:”15″,”y4″:”23.6″,”y5″:”86″},
{“x”:”29-Nov-2022 04:38″,”y1″:”119″,”y2″:”80″,”y3″:”15″,”y4″:”23.6″,”y5″:”87″},
{“x”:”29-Nov-2022 04:39″,”y1″:”119″,”y2″:”80″,”y3″:”15″,”y4″:”23.6″,”y5″:”86″}
- Sriram Kannan asked 1 year ago
- last active 1 year ago
Hi –
I could not find an example in the various examples your provide
I have several charts in different components
When a component is closed I want to ensure the chart is destroyed and there is not potential for memory leak
What is this best way of doing this?
Thanks
- Himura Kenshin asked 6 months ago
- last active 6 months ago
Looking into https://www.scichart.com/documentation/js/current/typedoc/classes/scichartverticalgroup.html I see I can add surfaces to the group, but what about removing them?
I’ve constructed a problematic codepen to show a potential issue:
https://codepen.io/jrfv/full/JjwraLK
Any reason for not being able to remove surfaces from the group?
Thanks!
- João Velasques asked 8 months ago
- last active 7 months ago
Hello,
tell me please, how can I add such indicators on yAxis. Maybe you have some example on sandbox for JS.
Thank you!
- Yevhenii Krasovskyi asked 10 months ago
- last active 9 months ago
Hello,
We have a heatmap where we can zoom in using the MouseWheelZoomModifier. Essentially we want to stop zooming at a certain visibleRange level and we cannot achieve it. Currently we have a heatmap that’s about 1500 pixels in width (with 1500 datapoints, 1-to-1), but the user can zoom so far you essentially see just 1 data point spread over the 1500 pixels.
We want to be able to zoom, but up to a certain limit, let’s say 100 datapoints visible. When visibleRange.max – visibleRange.min <= 100 we want to stop zooming.
We’ve tried suspendUpdates() and manually setting the visibleRange, but this doesn’t produce the desired results because suspendUpdates stops everything (including zooming out again) and resetting visibleRange solves it for a second, but the user is able to zoom in again. We also tried a custom mouseWheelModifier class and just removing the zoom in functionality at the treshold but that does not seem to work because scichart gives an error of having different mouseWheelModifiers.
I hope that this problem was expressed sufficiently. Please let us know if you have any questions.
- Zino As asked 11 months ago
- last active 11 months ago
I was used fifo(scrolling) chart in wpf scichart.
But.
I could not found fifo option in js scichart.
Maybe because there is no fifo option, if there is a lot of data accumulated, the chart is slow and cannot be used.
Can I use fifo(scrolling) chart in js scichart?
- 동윤 이 asked 3 years ago
- last active 3 years ago
I create custom annotation with nested input. In the code, I specify the autofocus property.
But autofocus only works once after page reload. With any manipulations with the chart (zoom, scrolling) – autofocus stops working.
Can you help me ?
- Taras Shevchenko asked 2 years ago
I have a chart with a box annotation. When I try to resize the box annotation by dragging the left or right border, I got the “Uncaught TypeError: Cannot read properties of undefined (reading ‘x’)”. It’s not always reproducible and cannot be reproduced by dragging the whole box. Also, it only occurs with SciChart version 3 but not SciChart version 2. Please check the screenshots for more details.
- Quyen Sy asked 1 year ago
- last active 1 year ago
- Big Sur 11.6.
- Monterey 12.2.1
- Catalina 10.15.7 (late 2013 model)
![enter image description here][1]
sciChart version 1.4.1611
If you open the chart in the Firefox browser, then, strangely enough, everything works.
Is it related to the version of the library?
- Alexandr Zhuk asked 2 years ago
- last active 2 years ago
I tried to use the trial version of SciChart with Next.js. But I got “SciChartSurface.setRuntimeLicenseKey is not a function” error. I don’t know what’s wrong, could you provide guideline for using SciChart with Next.js?
These are the codes in my next.config.js:
const CopyPlugin = require("copy-webpack-plugin");
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
webpack: ( config, { buildId, dev, isServer, defaultLoaders, nextRuntime, webpack } ) => {
config.plugins.push(
new CopyPlugin({
patterns: [
{ from: "node_modules/scichart/_wasm/scichart2d.data", to: "" },
{ from: "node_modules/scichart/_wasm/scichart2d.wasm", to: "" }
]
})
);
return config;
},
}
module.exports = nextConfig
And I have imported these files in pages/index.js
import {SciChartSurface} from "scichart/Charting/Visuals/SciChartSurface";
import {NumericAxis} from "scichart/Charting/Visuals/Axis/NumericAxis";
- Kelly Chan asked 2 years ago
- last active 2 years ago
Hello,
How can i convert my data to Y coordinate value in OhlsSeries?
Please advise. Thanks.
- Artem Smirnov asked 3 years ago
- last active 3 years ago
Tell me, please, how best to organize the graph in the case when on the time axis we can have more than 100-1000 records within 1 second. The problem seems to be that the X value must be accurate to at least 1 second? How to make records with even greater accuracy. and at the same time the time on the axis was shown correctly for this kind of data?
- Yevhenii Krasovskyi asked 11 months ago
- last active 11 months ago
On Vertical chart Label overlapping on smaller height. I have tried maxAutoTicks also and on the lower height, it’s getting one error. This error is occurring when the width is 0 sometimes. Can you please check this issues?
- Jerin Mathew asked 3 years ago
- last active 3 years ago
paletteProvider transparent colour is not working.
I tried with parseColorToUIntArgb(“#ffffff00”) and parseColorToUIntArgb(“#ffffff00”, 0) to replace the colour with transparent. But its not working.
I want ho hide the marker on the chart if the value is less than a limit. Is any other possibility to hide the marker based on value?
can you check the image, i want to show only the yellow marker.
one more error i am getting from typescript
“Type ‘undefined’ is not assignable to type ‘TPointMarkerArgb'”.
- Arun Surendran asked 3 years ago
- last active 3 years ago
I am considering applying server-side licensing for my javerScript application.
In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)
However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)
I wonder if there is a sample code implemented in C++ for server-side licensing.
Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?
- samini retnam asked 2 years ago
- last active 2 years ago
It’s impossible to zoom a candlestick chart (other types as well) on mobile browsers & WebViews.
I’m trying to use pinch-to-zoom with my fingers on chart, but it doesn’t react on it. Only sliding on the left & right is possible.
I’ve even tried demo from documentation:
https://demo.scichart.com/javascript-realtime-ticking-stock-charts
The same is with my chart as well
How can I fix it?
Thank you
- Roman Zio asked 3 years ago
- last active 3 years ago
Hi,
I would like to display the rollovermodifier line that must be parallel to the X axis and the Rollovermodifier line must be a dashed line. In the y axis I need to add a label annotation with svg .How can I fix the problem. Kindly provide me the solution.
This is the code I have given,
const horizontalline = new RolloverModifier({
IsEnabled: true,
DrawVerticalLine: true,
showTooltip: false,
rolloverLineStroke: “white”,
rolloverLineStrokeThickness : 1
})
sciChartSurface.chartModifiers.add(horizontalline);
- Ayana VS asked 2 years ago
- last active 2 years ago
Hi everyone! We have a problem, the chart does not start on macOS and Windows 11 operating systems – a black screen is displayed.
I have a license (javascript): The javascript license must work on all Windows/Linux/macOS browsers.
also for mobile browsers.
The problem is displayed in any browser.
The parameters of the MacBook on which the chart does not start are attached below in the screenshot.
What could be the problem?
- Alexandr Zhuk asked 2 years ago
- last active 10 months ago
I have a real time updated chart and users can add annotation to the chart. The position of the annotation will be updated with the chart data. I would like to stop updating the annotation position while user dragging the annotation. So I added a flag (e.g. isDragging) to the annotation dragStarted and dragEnded events. The isDragging flag will be set to true in dragStarted and then set to false in dragEnded. I will check this flag before updating the annotation position.
Here’s the problem, the annotation dragStarted event will be triggered when users do panning in the chart. But the dragEnded will not be triggered in this case. It breaks my plan to stop updating the annotation position as the isDragging will be incorrect. Is it a bug that the annotation dragStarted event (but not the dragEnded event) triggered when panning?
- Quyen Sy asked 1 year ago
- last active 1 year ago
This is my first time in this forum, and I am analyzing SCIChart. I am planning to use it in my software, but there are some questions I haven’t been able to answer yet.
My software is similar to an IDE, where the user can build their custom applications and run on windows environment, but we also provide an option to save all the interface in html and javascript. Since SCIChart provides not only WPF Charts but also javascript Charts, I would like to know the following:
1- Does the javascript charts have the same functionalities as the wpf charts? XY Charts or Pie charts for example, will they have the same functionalities in WPF and Javascript ?
2- Does the appearence of the charts in WPF and Javascript are the same? Do they look exatcly the same?
I believe these are my biggest doubts so far. Thanks in advance !!
- Fabio Pereira de Carvalho asked 1 year ago
- last active 1 year ago
Imagine I have a chart with a RolloverModifier, such that I see the point marker, and also a CursorModifier so I see the axis labels with the exact value I’m hovering.
This chart has the axis title hidden, and also the labels hidden, so I can really only see them trough the CursorModifier axis labels.
Since the axis title and labels are hidden, the axis labels spawn inside the chart, and the point marker from the RolloverModifier may be drawn on top of the labels.
I’d like to properly control drawing order here, so my axis labels get prioritised.
Is there a way to do so?
Codepen example: https://codepen.io/jrfv/full/VwqVBdo
- João Velasques asked 7 months ago
- last active 4 months ago
I have a live updating chart with multiple traces. After updated SciChart to v3.0.280, I got “Uncaught (in promise) RangeError: Maximum call stack size exceeded” error sometimes when I call XyDataSeries.appendRange(). This error will not be triggered if just initialize the chart and keeps updating the chart data. It seems happening after I modified the visibleRange of x-axis or y-axis. But the error is triggered on the line calling appendRange(). I have no clue for this issue. My codes didn’t change and only updated the SciChart version. Could you find the possible cause of my problem? Please refer to the attached screenshots.
Codes to update the chart data:
UpdateSuspender.using(sciChartSurfaceRef.current, () => {
console.time("Time - Update series");
for (tnum=0; tnum<MAX_TRACE; tnum++) {
traceObj = tracesInfoObj.current[tnum];
if (traceSeries.current[tnum] && traceObj.status === "Active") {
traceSeries.current[tnum]["xyDataSeries"].clear();
switch (traceObj.type) {
case 0:
traceSeries.current[tnum]["xyDataSeries"].appendRange(dataX, newSpecData);
break;
case 1:
traceSeries.current[tnum]["xyDataSeries"].appendRange(dataX, newMaxHoldData);
break;
case 2:
traceSeries.current[tnum]["xyDataSeries"].appendRange(dataX, newMinHoldData);
break;
case 3:
traceSeries.current[tnum]["xyDataSeries"].appendRange(dataX, averageData);
break;
}
}
};
console.timeEnd("Time - Update series");
});
- Quyen Sy asked 1 year ago
- last active 1 year ago