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
2k views

Hello,

I need to customize the text for some points on a XyScatterRenderableSeries graph. The problem is that the dataLabelProvider available for XyScatterRenderableSeries is BaseDataLabelProvider, but it doesn’t have a metaDataSelector method and I can’t do it with it. Interestingly, using LineSeriesDataLabelProvider I was able to add text for the points I needed using metadata, but another problem arose. In this case, if there is only one point on the graph, the text will not be drawn.

Here is a small example of how text is drawn for different numbers of points. https://codepen.io/PodaRocheK/pen/jOXYGMJ?editors=0011

Can you advise me on how to display text near points more correctly in the case when I use XyScatterRenderableSeries and often this text should disappear or appear near some points. Thanks a lot!

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

Hi!
Currently, I’m using Axis Layout – vertically stacked axes。When I use vertically stacked axes, click on a certain area, can I get on that axis? It’s from click on a certain area, not the series. I know the series can it.
can you give me some help?

1 vote
2k views

Good afternoon. Please tell me how can I change the Z index of the annotations so that the box annotation can overlap the text. Now no matter how I try to do it, the text is always above the rectangles. Does the JS version have some layers with annotations that can be changed by they Z like in this question – https://www.scichart.com/questions/wpf/changing-an-annotations-z-index

Unfortunately, I did not find this functionality in the JS version.

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

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 vote
2k views

Hi,
the Tooltip from the rolloverModifier shows for the Open-Values the Label “Open”.

I would like to be able to change that. There might be serveral reasons for that. Maybe the shown data are not “openValues” or the word “open” needs to be translated into another language.

I managed to edit the title of a FastCandlestickRenderableSeries by setting a title and get it into the variable like this:

rolloverTitle = newtitle;
renderableSeries0.rolloverModifierProps.tooltipTitle = rolloverTitle;

unfortunately i did not find a way to set the name/label for the open-,low-,close-, or high-values of this Series.

Can someone give ma a hint how to do this?

1 vote
0 answers
4k 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?

1 vote
2k views

Hi,

I’m trying to render a mountain series with different colors in specific ranges.
I understand that this could be done using the palette provider.

I have done that, but the chart is behaving in a very strange way.

When dividing the chart to 2 color parts, when panning and scrolling it to a point that some of the points are out of window, the coloring starts to go crazy.

I have attached a few images that show the problem, and have also attached a file with the source code.
I have tested this on chrome version 116

Here’s the code

import {FastMountainRenderableSeries, XyDataSeries,ZoomPanModifier,EXyDirection,MouseWheelZoomModifier,NumericAxis,SciChartJSLightTheme, SciChartSurface, parseColorToUIntArgb, DefaultPaletteProvider, EStrokePaletteMode} from 'scichart'

SciChartSurface.UseCommunityLicense();
SciChartSurface.useWasmFromCDN();

class PaletteProvider extends DefaultPaletteProvider {
  constructor() {
    super();
    this.strokePaletteMode = EStrokePaletteMode.SOLID;
  }

  overrideStrokeArgb(xvalue) {    
    return xvalue > 200 ? parseColorToUIntArgb('#ff0000') : undefined
  }

  overrideFillArgb(xvalue) { 
    return xvalue > 200 ? parseColorToUIntArgb('#ff0000') : undefined
  }
}

const init = async () => {
  const {wasmContext, sciChartSurface} = await SciChartSurface.create('container', {theme: new SciChartJSLightTheme()})

  const xAxis = new NumericAxis(wasmContext);
  const yAxis = new NumericAxis(wasmContext);

  sciChartSurface.xAxes.add(xAxis)
  sciChartSurface.yAxes.add(yAxis)

  sciChartSurface.chartModifiers.add(new MouseWheelZoomModifier({xyDirection: EXyDirection.XDirection}))
  sciChartSurface.chartModifiers.add(new ZoomPanModifier({xyDirection: EXyDirection.XDirection}))

  const array = new Array(500).fill(0).map(val => Math.max(Math.random(), 0));
  const array2 = new Array(500).fill(0).map((val, index) => index);

  const dataSeries = new XyDataSeries(wasmContext)
  dataSeries.appendRange(array2, array);

  const series = new FastMountainRenderableSeries(wasmContext, {
    stroke: 'blue',
    fill: 'blue',
    strokeThickness: 3,
    zeroLineY: 0,
    dataSeries,
    paletteProvider: new PaletteProvider()
  })

  sciChartSurface.renderableSeries.add(series);
}

init();

Thanks for the help!

  • haba haba asked 8 months ago
  • last active 8 months ago
1 vote
0 answers
2k views

We use a SciChartVerticalGroup instance to create multi-pane view and add additional charts for indicators under the main chart. After updating scichart 2.2.2407 -> 3.2.461 we face with the following error
(see the screen shot).

Error from chart in div cid1694501226340: TypeError: Cannot read properties of undefined (reading ‘invalidateElement’)

It occurs when we remove sub-pane and change the main chart line, for example from FastLineRenderableSeries to FastCandlestickRenderableSeries

There was no such error on version 2.2.2407

How we can I fix this?

1 vote
5k views

In our app we have a feature by which user can add indicators. These indicators can consist of 2 or a maximum of 4 lines.

We don’t want to render svg tooltips(which setted up by the default) with data for each line, instead of that we get point data and pass it to our app inner service that can render indicator legend.

To prevent default tooltips from being displayed we set for each renderable series of an indicator the following values.

rolloverModifierProps.width = 0; rolloverModifierProps.height = 0;

But of course tooltips are still rendered in the DOM and this leads to performance issues when we have 3 or more indicators of this type.

My question is the following

How we can render only circles svg for rollover modifier and completely dont render svg for tooltips in the DOM?

This is what the indicators look like

0 votes
4k 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?

0 votes
5k views

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 RolloverModifier instance

From CursorModifier instance
enter image description here
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

  1. Follow the codesandbox example by the link https://codesandbox.io/s/ts-band-chart-xwlxcm?file=/src/App.tsx;
  2. Once the chart is loaded and rendered, try moving the mouse cursor over the chart;
  3. 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.

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

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

Hello, I am using SciChartJS and have a new requirement from our users as follows that I need help with the implementation. Any pointers from anyone would be a great help.

**Requirements: **

  • Assume that x-axis is Time and y-axis is prices.
  • There are multiple series in the chart (e.g., Bid Price, Ask Price)
  • Allow user to select a time on xAxis using CTRL + CLICK
  • When the user selects the time, show the rollover line and the tooltip for all series at the selected time
  • This rollover line and tooltip should remain visible until the user selects a new time on the x-axis at which point the rollover tooltip should display the tooltip for the new point.

I started inheriting the RolloverModifier but couldn’t find an appropriate method to show the tooltip.

So, I started implementing the above feature using CustomModifierBase2d and adding a VerticalLineAnnotation for the rollover line. But again, struggling with the tooltip.

If someone could help me out or give me pointers, that would be highly appreciated.

Best Regards,
Sachin Patel.

1 vote
2k views

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

1 vote
2k views

I’m trying to add an AxisMarkerAnnotations for some line series on my chart.

I was following these questions answered here:
https://www.scichart.com/questions/js/adding-axis-markers-to-fastlinerenderableseries
https://www.scichart.com/questions/js/price-indicators-on-yaxis

I managed to render the axis marker for my series. Now I’m trying to the set the Y value of the marker annotation as the value where the line intersects the Y Axis.
I want the marker value to be the last value of the series, only if the xAxis.visibleRange.max > series.XdataRange.max.

The two attached images show the desired feature.
One shows the marker annotation with the Y1 being the one where the line intersects the YAxis.
The other shows the marker annotation with the Y1 being the last value of the line, because it is visible.

I read some answers here on the forum about using the HitTest API to do this, but I couldn’t make it work on my JS app

1 vote
5k views

I have a big problem with memory, i try many things but it’s doesn’t effect.
It’s my code for testing memory :

    const { wasmContext, sciChartSurface } = await SciChartSurface.create("bandTest", { theme: new SciChartJSLightTheme() });
    sciChartSurface.title = "Axis 1";
    sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { axisTitle: "Column number", axisTitleStyle: {fontSize: 12} }));
    sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { axisAlignment: EAxisAlignment.Left, axisTitleStyle: {fontSize: 12} }));
    setTimeout(sciChartSurface.delete(),2000);

sciChartSurface.delete() have no effect for memory
I run snapshot without this code and another snapshot with this code. (snap 14 is before call SciChart and snap 15 is after call the code bellow)

What can I do?

Regards

1 vote
2k views

Hello,
tell me please, how can I add such indicators on yAxis. Maybe you have some example on sandbox for JS.

Thank you!

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
2k views

I have a color heatmap legend that need to update the yAxis range on the fly. The colorMap doesn’t update as expected. Here’s my codes to update the y axis and colorMap min/max of the heatmap legend:

const newRange = new NumberRange(newMin, newMax);
const yAxis = heatmapLegendRef.current.sciChartSurface.yAxes.items[0];
yAxis.majorDelta = newScale;
yAxis.minorDelta = newScale / 5;        
yAxis.visibleRange = newRange;
yAxis.visibleRangeLimit = newRange;
yAxis.zoomExtentsRange = newRange;

colorMapRef.current.minimum = newMin;
colorMapRef.current.maximum = newMax;
heatmapLegendRef.current.colorMap = colorMapRef.current;

The y axis range has been updated. But the colorMap didn’t. It seems that the colorMap of the heatmap legend cannot be changed. Is it true that I can only recreate the heatmap legend if I want to change the colorMap?

  • Quyen Sy asked 8 months ago
  • last active 8 months ago
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 8 months ago
  • last active 8 months ago
0 votes
4k views

Dear team. We have a need to draw footprint chart, but your library didnt’t have opportunity to draw it. It will be good if you help us with recommendations in which direction we should move to build it. Thanks you a lot !

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’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?

1 vote
2k views

Hi Scichart Team.

I am working on the MouseWheelZoomModifier (EActionType.Pan).
But my users are using a trackpad (apple magic trackpad).
Currently, they are using 2 fingers and move up or down (vertically) to pan the chart. But they are asked to pan the chart by using 2 fingers and move left or right (horizontally) instead.

Do we have any setting for MouseWheelZoomModifier that help me pan the chart by that way?

  • TRUONG LE asked 9 months ago
  • last active 9 months ago
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
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
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
2k views

I want to create two xAxis, the first one will be a normal xAxis and the second one will be an array of date ranges, but the issue then is that since all the xAxis are inside one array together, they all are stacked on top of each other.

I tried sciChartSurface.layoutManager.bottomOuterAxesLayoutStrategy = new BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy(); but that only create all xAxis into one line of xAxis.

I want two line of xAxis, where the first one is normal, but second xAxis should be Horizontally Stacked Axis Layout.

The first image is before horizontal stacked is applied and the second after.

The third image show the xAxes array from sciChartSurface.xAxes, the index(0) of the array is the first xAxis, which should be normal, and the rest (index 1 – 8) should be horizontally stacked.

The horizontal stacked xAxis should be right below the first xAxis.

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

How to setup SciChart.js in React native frame work?

  • Subin Raj asked 2 years ago
  • last active 9 months ago
1 vote
2k views

Hello,

I want to render a base64 image in ScichartJS without actually rendering it in DOM. I saw that you have these guides in WPF:
https://support.scichart.com/index.php?/Knowledgebase/Article/View/17213/34/
https://www.scichart.com/documentation/win/current/webframe.html#Screenshots,_Printing_and_Export_to_XPS.html

However it is difficult to achieve it in Typescript. Is there a guide or any ideas on how to do it? I would appreciate any answer.

  • Zino As asked 9 months ago
  • last active 9 months ago
1 vote
6k views

Hi,

Our website is running on a web hosting service supported by the university. To work with the SciChart JS, do we have to install the npm and configure it accordingly? If so, we probably have to contact IT department for assistance, since we don’t have permission to do so.

Please advise. Thanks.

  • Gang Xu asked 3 years ago
  • last active 9 months ago
0 votes
3k views

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?

enter image description here

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!

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

I need to set range for stock chart from some records(first today’s record, first record of day before yesterday, etc for week, month, start of current year and the first record of chart) to last record.

To set the range i need to get indexes of this rows. Tell me please how can i do this for stock xValues. May be i can mark some records to find if faster or i need to check every records from 0 to MAX and then select the range?

Thank you!

1 vote
7k views

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?

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
2k views

Hello,

When annotations and the rollover modifiers are displayed on the very left side of a chart they align with the center of the candlesticks on the chart. However, as they get displayed toward the right side of the chart they get more and more offset to the right side of the candlestick.

Can anyone point me in the right direction to figure out how to fix this issue seemingly with my xAxis?

See attached screenshots,

  • Leland asked 11 months ago
  • last active 11 months ago
1 vote
2k views

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
0 votes
7k views

I was looking over Tutorial 07 – Tooltips and Legends and the Chart Legends API demo, and noticed that the checkboxes and legend font had some styling applied. But, when I implement a legend on my own it uses the default font (or whatever global font style I used) and the default HTML checkbox styling. I was wondering if you had modified the styling using an outside CSS file, if there is an API endpoint for modifying the styling of the legend, or if this is possibly a bug. I did see that there was an applyTheme() method available, but I thought that it might not apply to this situation. I also tried to look through the example code provided for the Chart API Demo, but I couldn’t find anything that pointed one way or the other.

I have attached screenshots of what the legend looks like in the two examples, as well as a screenshot of what the legend looks like when I implement it on my own. I have also included a zip file with the demo application I created.

Thanks,
Drew

1 vote
2k views

Hello All,

Is there a way to have a cursor modifier display on a mouse left/center/right click instead of automatically showing when the mouse is over the chart? I tried setting the ExecuteOn property but had no effect.

Thanks in advance,
Sergio.

1 vote
7k views

I am using a axis line chart from the js scichart. I want to change the font size of a legend. How do I change the font size of a legend?

  • info vcanus asked 11 months ago
  • last active 11 months ago
1 vote
2k views

Currently, I am creating a line chart and appending a lot of fetched data to the data series. The problem is that I have to recreate the chart when I move to another page that is using the same chart from the previous page. Therefore, I have to fetch the data and append it to the chart data series again.

Is there any way to reuse the chart itself without recreating the whole chart on another page?

  • info vcanus asked 11 months ago
  • last active 11 months ago
0 votes
8k views

I am trying to implement a waterfall chart with uniform heatmap. The data is updated from the top of the chart and keeps pushing the old data down. I would like to show the y-axis with time. How can I update the y-axis with updated data?

Assume the heatmap is 256 height, I created the zValues array with min value when draw the heatmap:

const SPECTROGRAM_WIDTH = 256; 
const minPower = -200;
spectrogramZValues.current = Array.from(Array(SPECTROGRAM_HEIGHT), () => Array(SPECTROGRAM_WIDTH).fill(minPower));

Update zValues array when new data come:

    spectrogramZValues.current.shift();
        spectrogramZValues.current.push(newData);

When the first data pushed to the chart. There will be one row shown in the axis with timestamp t1. When the second data comes, the top row of the y-axis should be t2 and the t1 is pushed down. When the waterfall chart is filled with 256 data, the bottom of the y-axis should be t1 and the top of the y-axis should be t256. Is it possible to implement this?

Now I am using the uniform heatmap to implement it with yStart=0 and yStep=1. I tried to add the labelProvider to the y-axis to show the timestamp of each row. I am keeping an array locally to store the timestamp of each row which will be updated with the new data. I tried to map this array and return the timestamp in the y-axis labelProvider. But it doesn’t work. The y-axis will not be refreshed when data updated.

        yAxis.labelProvider.formatLabel = (dataValue) => {
        const ts = timestampArray[dataValue];
        if (ts) {
            const timeObj = new Date(ts);
            const hours = ('0' + timeObj.getHours()).slice(-2);
            const minutes = ('0' + timeObj.getMinutes()).slice(-2);
            const seconds = ('0' + timeObj.getSeconds()).slice(-2);
            const milliseconds = ('0' + timeObj.getMilliseconds()).slice(-3);
            return `${hours}:${minutes}:${seconds}.${milliseconds}`;
        } else {
            return "";
        }
    };
  • Quyen Sy asked 12 months ago
  • last active 11 months ago
0 votes
0 answers
4k views

My application supports two themes (dark/light) for the charts. The background of the chart will be set to black if the dark mode is applied, and white if the light mode applied. It works well with the line chart. But there is strange grey background appeared in the heatmap chart when light mode is applied (Please check the attached screenshots). The color of gradient stop of offset 0 (min. heatmap zValues) is set to transparent and it works well with the dark mode. Do you know what’s wrong in my case?

Dark theme object applied to the chart:

{...new SciChartJSDarkTheme(), ...{
        sciChartBackground: "#1c1c1c",
        axisTitleColor: "#dee2e6",
        labelBorderBrush: "#dee2e6",
        tickTextBrush: "#dee2e6",
        majorGridLineBrush: "#1F3D68",
        minorGridLineBrush: "#102A47",
    }

Light theme object applied to the chart:

{...new SciChartJSLightTheme(), ...{
        sciChartBackground: "#fff",
        axisTitleColor: "#333",
        labelBorderBrush: "#333",
        tickTextBrush: "#333",
    }}

Heatmap graditentStops:

[
    { offset: 1, color: COLORS.DARK_RED },
    { offset: 0.8, color: COLORS.RED },
    { offset: 0.6, color: COLORS.YELLOW },
    { offset: 0.5, color: COLORS.GREEN },
    { offset: 0.4, color: COLORS.BLUE },
    { offset: 0.01, color: COLORS.DARK_BLUE },
    { offset: 0, color: "Transparent" },
]
0 votes
5k views

Is it possible to change the heatmap legend from vertical to horizontal?

  • Quyen Sy asked 12 months ago
  • last active 12 months ago
Showing 101 - 150 of 379 results