Pre loader

Category: JavaScript

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

1 vote
5k views

I tried to apply offset on the data in a live updating multiple lines chart. But it doesn’t work for me. Below are my codes for adding trace and updating data:

Add a trace to the chart without data in the beginning:

const xyDataSeries = new XyDataSeries(wasmContext);
const offsetFilter = new XyScaleOffsetFilter(xyDataSeries, { scale: 1, offset: 50 });   
let trace1 = new FastLineRenderableSeries(wasmContext, {
    type: ESeriesType.LineSeries, 
id: 1,
stroke: #333,
strokeThickness: 1,
dataIsSortedInX: true, 
dataEvenlySpacedInX: true, 
containsNaN: false,
dataSeries: offsetFilter,
});
sciChartSurface.renderableSeries.add(trace1);

Update chart data later:

sciChartSurface.renderableSeries.items.forEach(serie => {
    serie.dataSeries.clear();
serie.dataSeries.appendRange(dataX, dataY);
});

I can’t see the offset 50 applied on the chart data. Not sure what’s wrong with my codes.

  • Quyen Sy asked 1 year ago
  • last active 1 year ago
1 vote
5k views

I am implementing a heatmap. The data size of the heatmap would be changed. I update the UniformHeatmapDataSeries with the updated zValues according to this post.

https://www.scichart.com/questions/js/failed-to-update-the-zvalues-size-of-uniformheatmapdataseries-in-heatmap

There is no problem if I update the UniformHeatmapDataSeries with a larger size zValues array. However, when I update it with a smaller size zValues array, the heatmap width will be decrease (Please refer to my screenshots). How can I keep the heatmap always 100% width?

  • Quyen Sy asked 12 months ago
  • last active 12 months ago
0 votes
5k views

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
1 vote
5k views

It seems to me that DateTimeNumericAxis has edge cases where it can’t calculate deltas for some ranges.
This results in a console error, and the chart not loading:

Error from chart in div date-axis-bug RangeError: Maximum call stack size exceeded
at get minTicks [as minTicks] (index.min.js:1:577149)
at a (index.min.js:1:577393)
at a (index.min.js:1:577567)
at a (index.min.js:1:577483)
at a (index.min.js:1:577567)
at a (index.min.js:1:577483)
at a (index.min.js:1:577567)
at a (index.min.js:1:577483)
at a (index.min.js:1:577567)
at a (index.min.js:1:577483)

Provided codepen: https://codepen.io/jrfv/pen/xxQawom

Any suggestions?
Thanks!

1 vote
5k views

I’m trying to add a axis label/marker to the yAxis of my chart.
This label should follow the intersection between a FastLineRenderableSeries (that i’m using to render a moving average filtered dataSeries) and the yAxis.

I tried to extend the “draw” method of the FastLineRenderableSeries to draw a label ontop of the yAXis, using the “drawModifiersAxisLabel” helper function. Like:

class CustomFastLineRenderableSeries extends FastLineRenderableSeries {
draw(renderContext: WebGlRenderContext2D, renderPassData: RenderPassData) {
    super.draw(renderContext, renderPassData)
    const yAxis = getYAxis(this.parentSurface);
    drawModifiersAxisLabel(
        yAxis,
        renderContext,
        150, // testing values
        "#00ff00", // testing values
        "#00ff00", // testing values
    );
}

but the label don’t get drawn.

The attached image shows the desired feature (image from another charting lib)

How can I implement this?

0 votes
5k views

Hi there,

I encountered a problem that the labels, lineAnnotations and chart are not sharp, a little blurry. Is there any way to fix this?

1 vote
5k views

I have a use case for a chart, that is a heatmap, which may also contain multiple series drawn on top, with multiple internal axis as well.
I can’t transform the data I receive, because that would be too slow, and it needs to maintain a speedy feeling, even when appending more data.

For this reason, when building the chart, I just flip the axis. The bottom axis is the Y axis, and the left axis it the X axis.

The multiple series that can be added (XyDataSeries), provide one extra axis each, and use one of the main axis.
We can think of them as horizontal or vertical series, depending if they use the main X axis, or the main Y axis.

When hovering over the chart, I want to show a tooltip, that shows for each series, their own axis value.

The issue — The normal CursorModifier, can’t correctly present a tooltip, for this case of mixed horizontal/vertical series. I’m not sure if there are configurations I’m missing, or if it is an actual uncovered edge case, hoping to get an answer on this.

To show what the issue is, and how I’m currently fixing it, please have a look at the codepen I made -> https://codepen.io/jrfv/full/zYMjEzP

Any tips on this, is it something scichart will fix eventually?

1 vote
5k views

Hello,

Can you show this example(https://codepen.io/PodaRocheK/pen/yLGxGEL?editors=0011) and tell me, why metadata labels are not displayed in some cases? May be you can tell me how to do it correctly? A have similar chart with a lot of datapoints and can’t understand why labels show only in some time(20s or > 1m after start the chart)

Thank you!

0 votes
5k views

Hi there,

I am experiencing a problem with a license key error when I deployed the project to the staging environment.

Here are the steps I followed:

  • I registered the domain and test domain on scichart.com/profile.
  • I generated a runtime key.
  • I included that key in the code base and then deployed it.

I have attached a screenshot below that shows the errors.

  • Umer Nawaz asked 9 months ago
  • last active 9 months ago
1 vote
5k views

Hello, i want to customize tooltip in graph (SplineBandRenderableSeries), i can change the tooltip content but if i return svg like your example ( return <svg width="${width}" height="${height}">
<circle cx="50%" cy="50%" r="50%" fill="${tooltipColor}"/>
<svg width="100%">
<text y="40" font-size="13" font-family="Verdana" dy="0" fill="${tooltipTextColor}">
<tspan x="15" dy="1.2em">${tooltipTitle}</tspan>
<tspan x="15" dy="1.2em">x: ${seriesInfo.formattedXValue} y: ${seriesInfo.formattedYValue}</tspan>
</text>
</svg>
</svg>
))
It doesn’t work. I have this error in console: Error from chart in div band0 TypeError: valuesWithLabels.reduce is not a function
and
Error from chart in div band0 DOMException: Failed to execute ‘removeChild’ on ‘Node’: The node to be removed is not a child of this node.
at RolloverTooltipSvgAnnotation.delete …

My graph has 3 renderableSeries (1 XyDataSeries and 2 XyyDataSeries)

Please can you send me an example in (javascript) for modify tooltip styling ?

Thanks.

1 vote
5k views

Hi,

I am facing a issue with latest version of SciChart. Because of this type error not able to build the project. Can you check this error.

1 vote
5k views

Sorry for opening another question, but this followup to https://www.scichart.com/questions/js/series-labels got missed.

I’m looking to add a border and background to a TextAnnotation.

Back in the WPF days we had the ability to pretty easily add background colors and such to annotations, thanks to the existing WPF model. I’m assuming in the JS example this would be custom; do you have any existing code/examples for that? Looking for being able to use a colored box whose fill matches the renderable series stroke, along with a contrasting text color.

Dan

0 votes
5k views

Is there any way to provide custom axis label for cursor modifier or at least change label size? I could find only axis label stroke & fill properties in cursor modifier API.

1 vote
0 answers
5k views

Hello, help me please.

I have situations when all panels with different graphs are updated and after that all graphs are not displayed. The containers are not equivalent to the previous ones and I need to set up new divs. How can i do this?

1 vote
5k views

Hi, I have an issue where I am trying to create multiple xAxes where one is normal and the rest are horizontally stacked. Then I calculate the stacked length of each stacked axes, but the issue comes when I change the width of the chart or inspect element, which would alter the width of the chart somehow, I got error saying the total width of the stacked axes is bigger than available size.

I have a codesanbox example of it:
https://codesandbox.io/s/scichart-stacked-xaxis-stacked-length-issue-3knt23?file=/src/App.tsx

I am using percentage for the stacked xAxes length and then I added them up to be 100% total, but somehow it is saying that it is more than available size.

So, my question is, how can I listen or get the width/size changes event of the chart/xAxis, so that I can calculate accordingly?

  • Nung Khual asked 9 months ago
  • last active 9 months ago
1 vote
5k views

Please tell me, is it possible to make sure that there is no empty space between records on those days when there is no trading on the stock exchange? It appears that the X-axis is linear and not transactional. How can I make it transactional?

1 vote
5k views

Hi,

I am creating an application where, we fetch data and display it in multiple heatmaps. The user can manipulate the heatmaps with changing colormap or changing ranges on the colormap.

Data from these multiple heatmaps is composited to another chart for visualization.

I was able to get a reference to the series, but adding the series to another chart errors with a message:

Invalid operation in sciChartSurface.attachSeries, this series has already been attached to a SciChartSurface. Please detach it from a SciChartSurface before attaching to another
at BaseRenderableSeries.onAttach (BaseRenderableSeries.js:634:1)
at __webpack_modules__../node_modules/scichart/Charting/Visuals/SciChartSurface.js.SciChartSurface.attachSeries (SciChartSurface.js:1385:1)

of course this means we cannot attach the same series to two different charts, but is there a way around this such as deepcloning?

renderable series: attached image

sample code: attached image

1 vote
5k views

I have upgraded the SciChart version to v3.2 and tried to use the memory debugging tools. https://www.scichart.com/documentation/js/current/webframe.html#MemoryLeakDebugging.html

Below are few issues I found:

  • The example in the Memory Leak Debugging page got typo. It should
    import the MemoryUsageHelper instead of MemoryUsageTracker.

import { MemoryUsageTracker } from “scichart”;
MemoryUsageHelper.isMemoryUsageDebugEnabled = true;

  • When I turn on the memory debugger, I always got this warning when I
    move the crosshair in my chart. Is this expected?

DeletableEntity.js:70 Failed to remove
CursorTooltipSvgAnnotation_42d65afd-b859-4e14-b82d-7cda881cf1eb from
the Object Registry Probably it has been already deleted!

  • I also got the warning in point 2 when I try to delete annotation
    from the chart. I think it’s because I am trying to do something
    like this:

sciChartSurfaceRef.chartModifiers.remove(markerAnnotation);
markerAnnotation.delete();

The warning will be gone if I remove the second line above. Is it true that if I remove an annotation/dataSeries from a chart, I don’t need to remove that annotation/dataSeries manually afterward (i.e. annotation.delete()) ? Also, if I deleted a chart, I don’t need to delete it’s annotation/dataSeries manally, right?

  • Quyen Sy asked 8 months ago
  • last active 5 months ago
1 vote
5k views

Hi, I want to create info boxes between xAxis and chart, info box will contain text, but the width/position of the box will be base on the xAxis and should sync with the chart (zoom etc). For example, if xAxis is from 1-100, and the first info box start from 1 to 10, then the width/position of the box should cover from 1-10, and if I zoom between 1-10, then info box should also sync and expand.

So far, I have created it using horizontal stacked xAxes and custom axis layout strategy provided by you. But the issue is that the stacked xAxes are not sync with the chart, for now, to make it seem sync, I am recalculating stacked axis length when zoom. But the issue comes when there should be gap between the info boxes, for example, if xAxis is 1-100 and the first box is 1-10 and the second box is 20-40, then there is a gap of 10 between the first and second. Right now, those gap are filled using empty xAxes, but they are not correct. When there is gap, the position of the boxes are wrong.

  • First image is my current implementation of it using custom axis layout and stacked xAxes.
  • Second image is how it look when zoomed
  • Third image is the gap issue with the current implementation
  • Fourth image is how the correct implementation should look like.

Codesanbox example:
https://codesandbox.io/s/scichart-stacked-xaxis-stacked-length-issue-3knt23?file=/src/App.tsx

  • Nung Khual asked 8 months ago
  • last active 8 months ago
1 vote
5k views

Dear Andrew,

Thank you for the past answers. I have a new question. I have a heatmap with 2 line charts at its left aand top position. the top line chart plot the horizontal values where the mouse if hovering and left chart displays vertical values from the mouse position.

This is working great, but the issue is the heatmap is not always square and I am trying the aligh the line charts with the heatmap dimensions

two issues,

  1. the heatmap X/Y dimension are not always same, in fact I have a function which listens to the changing heatmap zoom factor and makes sure the X/Y are always “square” as we want to show the heatmap with square pixels. (see video #2) https://youtu.be/wXStF-7bWsw

  2. As I dynamically chage the size of the plot the… the proportion of actual chart area to axis lable changes thus varying the overlap. (see video #1) https://youtu.be/loAVpYSRJ38

Let me know if you need more information,

Best,

Pramod

-1 votes
0 answers
5k views

Problem: Error in displaying 2 decimal places on Y axis, the displayed value will be greater than 1.

Requirements: The date displayed on the X axis of my data, and the date displayed on the Y axis are mostly 2 decimal places, but I need to click the broken line to highlight the broken line.

The code is as follows

import { SeriesSelectionModifier } from “scichart/Charting/ChartModifiers/SeriesSelectionModifier”;
import { XyDataSeries } from “scichart/Charting/Model/XyDataSeries”;
import { SciChartJSLightTheme } from “scichart/Charting/Themes/SciChartJSLightTheme”;
import { NumericAxis } from “scichart/Charting/Visuals/Axis/NumericAxis”;
import { EllipsePointMarker } from “scichart/Charting/Visuals/PointMarkers/EllipsePointMarker”;
import { FastLineRenderableSeries } from “scichart/Charting/Visuals/RenderableSeries/FastLineRenderableSeries”;
import { NumberRange } from “scichart/Core/NumberRange”;
import { EAxisAlignment } from “scichart/types/AxisAlignment”;
import { ELabelAlignment } from “scichart/types/LabelAlignment”;
import { SciChartSurface } from “scichart”;
import {RubberBandXyZoomModifier} from “scichart/Charting/ChartModifiers/RubberBandXyZoomModifier”;
import {MouseWheelZoomModifier} from “scichart/Charting/ChartModifiers/MouseWheelZoomModifier”;
import {ZoomExtentsModifier} from “scichart/Charting/ChartModifiers/ZoomExtentsModifier”;
import { TextLabelProvider } from “scichart/Charting/Visuals/Axis/LabelProvider/TextLabelProvider”;
import { Thickness } from “scichart/Core/Thickness”;

const dataData = [
“2022-12-21 13:12:45”,
“2022-12-21 12:22:46”,
“2022-12-21 11:32:47”,
“2022-12-21 10:42:41”,
“2022-12-21 09:52:38”,
“2022-12-21 09:02:32”,
“2022-12-21 08:12:28”,
“2022-12-21 07:22:26”,
“2022-12-21 06:32:26”,
“2022-12-21 02:32:17”,
“2022-12-21 01:42:20”,
“2022-12-21 00:52:12”,
“2022-12-21 00:02:15”,
“2022-12-20 23:12:15”,
“2022-12-20 22:22:17”,
“2022-12-20 21:32:44”,
“2022-12-20 20:42:41”,
“2022-12-20 19:52:43”,
“2022-12-20 19:02:42”,
“2022-12-20 18:12:44”,
“2022-12-20 17:22:42”,
“2022-12-20 16:32:37”,
“2022-12-20 15:42:34”,
“2022-12-20 14:52:34”,
“2022-12-20 14:02:35”,
“2022-12-20 13:12:29”,
“2022-12-20 12:24:37”,
“2022-12-20 10:42:37”,
“2022-12-20 09:52:37”,
“2022-12-20 09:02:19”,
“2022-12-20 04:52:00”,
“2022-12-20 04:02:29”,
“2022-12-20 03:12:29”,
“2022-12-20 02:22:30”,
“2022-12-20 01:32:31”,
“2022-12-20 00:42:25”
];
const divElementId = “scichart-root”;
const drawExample = async () => {
const { sciChartSurface, wasmContext } = await SciChartSurface.create(divElementId);
const xAxis = new NumericAxis(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);
sciChartSurface.yAxes.add(
new NumericAxis(wasmContext, {
growBy: new NumberRange(0.05, 0.05),
id: EAxisAlignment.Left.toString(),
axisAlignment: EAxisAlignment.Left,
labelPrecision: 0,
labelStyle: { alignment: ELabelAlignment.Left }
})
);
sciChartSurface.yAxes.add(
new NumericAxis(wasmContext, {
growBy: new NumberRange(0.05, 0.05),
id: EAxisAlignment.Right.toString(),
axisAlignment: EAxisAlignment.Right,
labelPrecision: 0,
labelStyle: { alignment: ELabelAlignment.Right }
})
);
sciChartSurface.applyTheme(new SciChartJSLightTheme());
sciChartSurface.chartModifiers.add(new SeriesSelectionModifier({ enableHover: true, enableSelection: true }));

const seriesCount = 3;
const seriesPointCount = dataData.length-1;

const s = sciChartSurface.suspendUpdates();
const xValues=Array.from(Array(dataData.length), (v,k) =>++k);
for (let i = 0; i < 5; i++) {
const alignment = i % 2 === 0 ? EAxisAlignment.Left : EAxisAlignment.Right;
const yValues=Array.from(Array(dataData.length), () =>Math.floor(Math.random()*100)/100);
const lineSeries = new FastLineRenderableSeries(wasmContext, {
dataSeries: new XyDataSeries(wasmContext, { xValues, yValues, dataSeriesName: “Series ” + i }),
strokeThickness: 2,
stroke: “Blue”,
opacity: 0.5,
yAxisId: alignment.toString(),
onSelectedChanged: (sourceSeries, isSelected) => {
sourceSeries.strokeThickness = isSelected ? 5 : 2;
sourceSeries.stroke = isSelected ? “Purple” : “Blue”;
sourceSeries.rolloverModifierProps.tooltipDataTemplate=isSelected ? “wezisadasdasdd” : ”;
sourceSeries.pointMarker = isSelected
? new EllipsePointMarker(wasmContext, {
width: 9,
height: 9,
strokeThickness: 1,
stroke: “White”,
fill: “Purple”
})
: undefined;
},
onHoveredChanged: (sourceSeries, isHovered) => {
sourceSeries.opacity = isHovered ? 1.0 : 0.7;
sourceSeries.strokeThickness = isHovered ? 2 : 1;
}
});
sciChartSurface.renderableSeries.add(lineSeries);
}
s.resume();
const mouseWheelZoomModifier = new MouseWheelZoomModifier();
const rubberBandZoomModifier = new RubberBandXyZoomModifier();
const zoomExtentsModifier = new ZoomExtentsModifier();
sciChartSurface.chartModifiers.add(zoomExtentsModifier);
// sciChartSurface.chartModifiers.add(rubberBandZoomModifier);
sciChartSurface.chartModifiers.add(mouseWheelZoomModifier);
return { sciChartSurface, wasmContext };
};

drawExample();

1 vote
0 answers
5k views

I have a chart with stacked xAxes, and I am trying to calculate the stackedLength of each xAxis base on the total length or width available for the xAxes.

The issue come when I am changing the size of the screen or changing the width of the chart using flex-basis. When I do that, I get the error message in the picture below.

My question is, is there a way for me to listen/subscribe to the width change or get the latest width?

  • Nung Khual asked 9 months ago
  • last active 9 months ago
1 vote
5k views

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!

1 vote
5k views

Hello, how do I remove the shadow from tooltips, generated by the VerticalSliceModifier?

Thanks!

0 votes
5k views

Do you have any examples with configurating sci chart component in asp.mvc project. Ideally I’d not want to use any of the node.js pipeline and I just want to add set of javascript files to my project.

1 vote
5k views

Hi,

EDataLabelSkipMode Customization is possible with some time range limit?
When i checked the documentation saw the options to skip the label for overlaping. Is it possible can add some index to skip the values. Eg: for Time chart One value is displayed in the chart at 10:30:00. So if i add some index value to skip the next 1 min data. So based on skip index next available value can ba displayed in chart. (10:31:00 or next available value). Can you implement this option to skip ?

1 vote
5k views

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?

  • haba haba asked 8 months ago
  • last active 1 month ago
1 vote
5k views

Hi,

Is it possible to toggle the DataLabels dynamically in the chart? Setting some values to true or false like isVisible property.

1 vote
0 answers
5k views

Hello,
I’m thinking to create a RenderableSeries on the React side for SciChart JS using XyDataSeries generated on my .NET backend. Is it possible to do so?

0 votes
5k views

I have a bubble chart with EllipsePointMarker as pointMarker and a custom palette provider to set the colors of the markers. I need to set a stroke in one of the markers but doesn’t matter what value I return as a stroke value from the overridePointMarkerArgb function, the stroke isn’t applied. Am I missing something?

-1 votes
5k views

Hi, I was trying your JavaScript 64-Chart Dashboard Performance Demo and noticed few problems about it.
It shows 60Fps and chrome Fps shows only ~15fps and that is obviously lag in my eye.

Another problem was when I resized window it started to jump up and down when fps was below 10 and after above 10 it resized it continuously. Also when labels is added in small window it start jump when try to resize charts…

When I zoomed close to mountain series it changed visual data after moved that to left so there is some problems on your algorithm what you use to group that data to screen in real time.

-Astrid

1 vote
0 answers
5k views

If I have a use case, where heatmap data can be sparse in time, and I’m zooming around and panning trough the chart, it is quite possible to end up missing heatmap data, because at certain zoom levels, the heatmap lines just disappear.

Any tips to make this not happen?

Codepen showing the issue: https://codepen.io/jrfv/full/KKbrBdN

Make sure to zoom out slowly, and/or pan around, you should see one, or both lines disappearing.

I would post a video, but doesn’t seem to be allowed here, I’ll post 2 images at slightly different zoom levels then

1 vote
5k views

Hi,

DataLabels Not Displaying in all cases in flippedCoordinates. Based on values only its showing. I have created a sample application with some dummy data.

  1. First Series is showing the labels properly
  2. If the first value in array changed then it will show the value.
  3. If all values are 0 then also its not showing the label.

Can you check the attached file for the sample code.

When the chart is not flipped then its works fine when i am checking.

1 vote
5k views

I have a chart in the center of the page and the chart will resize according to the browser window size. When I expand the browser window, the chart will expand to fit the browser size. In this case, the chart grows downward gradually (with animation). How can I remove this animation effect when resizing the chart?

In case it’s related to my style. Here are my markup and style for reference:

//Markup

//Style
.contentPanel {
flex: 1 1 auto;
width: calc(100% – 335px);
max-height: calc(100vh – 108px);
display: flex;
flex-direction: column;
}

.chartContainer {
position: relative;
margin: 10px 0;
display: flex;
flex-direction: column;
flex: 1;
}

.scichart-root {
width: 100%;
height: 100%;
}

1 vote
5k views

Working with SciChart/React/Webpack/Babel.

The Webpack Bundle Analyser shows that SciChart accounts for a massive chunk of the bundle’s size.

It is even more pronounced with the default settings, because SciChart uses the crypto package, which is widely known to introduce significant bloat and duplication, shown in the screenshot. Using Webpack to specify the following removes this bloat, and seems to still work, but it would be good to know the implications of including this config:

node: {
fs: "empty",
crypto: false,
}

Screenshots attached, showing the bundle analysis with and without this additional config.

0 votes
5k views

Hello!

Tell me what I’m doing wrong?
The error does not always appear (floating error).

enter image description here

In my code, along the stack, it will go to your product

enter image description here

0 votes
5k views

I have a chart with default majorDelta 10 for y-axis. Users are allowed to change the scale (majorDelta) of the chart. When it’s changed to 0.1, the y-axis labels are gone. The y-axis labels can still be seen when the majorDelta is 0.2. Please check my screenshots for details.

  • Quyen Sy asked 1 year ago
  • last active 1 year ago
1 vote
4k views

In a DateTimeNumericAxis, can I convert the number from VisibleRange to a formatted string HH:MM:SS?
For example, I’d like to convert this x1 to 12/1/1984, 3:00:00 PM, or 15:00:00.

let x1 = this.parentSurface.annotations.getById("hrv").x1;
// x1 =470761200, seconds since 1970.01.01 00:00:00

Thanks.

  • Gang Xu asked 1 year ago
  • last active 1 year ago
1 vote
4k views

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?

0 votes
4k views

Hi,

Currently when we scroll the mouse pointer the zoom level is increasing/decreasing and when we click and drag the pan the chart. I want is when we scroll the chart should change the visible range (Pan chart), and clicking and selecting the area need to zoom like RubberBandXyZoomModifier. But I need to zoom only the X axis. Y axis should be the same as before zoom. Is this possible with SCI chart??

1 vote
4k views

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
1 vote
4k views

I recently upgraded SciChart from version 2 to version 3.0.266. It was working fine. But I got error (please refer to the attached screenshot) when I try to run my application today. It’s so strange as it worked fine yesterday and I didn’t make any codes change today.

  • Quyen Sy asked 1 year ago
  • last active 1 year ago
1 vote
4k views

I have XyDataSeries with 50 data points and I’m trying to insert another 50 data points to index 5. The same values can be inserted as a range to the beginning of the data series or inserted one by one starting from index 5. But they fail with “RuntimeError: memory access out of bounds” whenever I try to insert them as a range from index 5.

Code snippet:

const { xValues, yValues } = generateData(50);
const dataSeries = new XyDataSeries(wasmContext, { xValues, yValues, isSorted: false });
sciChartSurface.renderableSeries.add(new FastLineRenderableSeries(wasmContext, { dataSeries }));

// this works
dataSeries.insertRange(0, xValues, yValues);
// this works
for (let i = 0; i < xValues.length; i++) {
  dataSeries.insert(i + 5, xValues[i], yValues[i]);
}
// this fails
dataSeries.insertRange(5, xValues, yValues);

Codesandbox link: https://codesandbox.io/s/scichart-js-boilerplate-forked-hokfcn

I wonder if I’m doing something wrong or if this is an actual issue?

Side note: Index 5 is just an example, because it seems I can use the insertRange method when inserting to index 0-2, but it fails when inserting to index 3+ (in case of a chart with 50 existing data points)

1 vote
4k views

How to update the text Annotation in JavaScript. I can add the new Text annotation but I can’t update the old text Annotation. whether we have any option in sci chart for JavaScript.

1 vote
4k views

Hi,

We use SciChart extensively in our WPF applications and make use of CustomRenderableSeries, writing all kinds of different lines and bitmaps directly to the IRenderContext2D depending on the point metadata.

We’re now looking at doing something similar in JavaScript, but can’t find any examples of this kind of customisation in the documentation. In the JavaScript library, is it possible to draw directly to a ‘canvas’ in the same way as in the WPF version? If so, could you please point to an example?

Many thanks,

Graham.

1 vote
4k views

How can we change the color(Red) of custom box annotation when it is clicked .
thanks

0 votes
4k views

Hello, I am running scichart in a blazorwasm app. On updating from 1.x to 2.2.2351 I am getting an uncaught error for a missing module on app startup before I make any calls to scichart to initialize.

The error is:
Uncaught Error: Cannot find module ‘../Charting/Model/Filters/HlcScaleOffsetFilter’
at webpackMissingModule (buildDataSeries.js:15:94)
at eval (buildDataSeries.js:15:215)
at Object../node_modules/scichart/Builder/buildDataSeries.js (strategyChart.js:133:1)
at webpack_require (strategyChart.js:21:30)
at eval (chartBuilder.js:45:25)
at Object../node_modules/scichart/Builder/chartBuilder.js (strategyChart.js:181:1)
at webpack_require (strategyChart.js:21:30)
at eval (SciChartSurface.js:30:22)
at Object../node_modules/scichart/Charting/Visuals/SciChartSurface.js (strategyChart.js:3253:1)
at webpack_require (strategyChart.js:21:30)

My webpack is:

 const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
const webpack = require("webpack");
module.exports = {
    mode: "development",
    entry: {
        strategyChart: './src/strategyChart.js'
    },
    module: {
        rules: []
    },
    resolve: {
        extensions: [".js"]
    },
    output: {
        path: path.resolve(__dirname, '../wwwroot'),
        filename: "[name].js",
        library: "[name]"
    },
    plugins: [
        new CopyPlugin({
            patterns: [
                { from: "node_modules/scichart/_wasm/scichart2d.data", to: "" },
                { from: "node_modules/scichart/_wasm/scichart2d.wasm", to: "" }
            ]
        }),
        new webpack.IgnorePlugin(/(fs)/)
    ]
};
  • Leland asked 2 years ago
  • last active 2 years ago
1 vote
4k views

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;
}
1 vote
4k views

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
1 vote
4k views

Hello.

The graph is automatically stretched in width. How to do the same in height?

Video

Showing 101 - 150 of 380 results