Pre loader

SciChart.js: How to prevent SciChartOverview from extending past the main view's visible range limit.

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
0

I’m developing an EEG medical application that has a main chart displaying an interval of sampling values from a EEG recording session. In addition, there is an overview chart displaying sampling values of the entire recording session. The overview chart which is an instance of the SciChartOverview object whose x-axis is bound to the main view.

FYI: A recording sessions typically span several hours (more than 20 hours is common) and thus data-series associated to the main chart contain an interval of the recording session in order to stay within reasonable memory resources.

The application adjust’s the main view’s x-axis visible range limit & visible range size (i.e. visibleRangeLimit & visibleRangeSize) properties based on what is loaded within the main view’s data-series.

Developers that are familiar with the SciChartOverview class, know that this allows users provides users with “grips” in the chart overview allowing them to extend/contract the main axis’ visible range property.

However, the main axis’ visible range properties aren’t being enforced.

In my humble opinion, the SciChartOverview class should restrict users from setting the overview’s “grips” that conflict with the main axis’ visible range limit & visible range size properties.

I’ve review the SciChartOverview & OverviewRangeSelectionModifier class https://www.scichart.com/documentation/js/current/webframe.html#SciChartOverview.html
and there is nothing that is evident that I’ve read that gives my expected behavior of the overview.

I’d appreciate any feedback or insight on this matter before I heading down having to write customized code as to restricting the chart overview’s “grips”.

Version
3.4.672
Images
  • Jim Risen
    Hello, sorry for the late response, it appears like the question got stuck in our system awaiting for the confirmation.
  • Jim Risen
    The suggestion makes sense we will log this as a task. Please, let us know if you have managed to create a workaround.
  • Steven Belbin
    Thanks Jim for inspecting the queue and unblocking it. I appreciate that’s my comment/request makes for a sensible behaviour of the SciChartOverview class. But, as a developer I’m aware that might take time to integrate into a SciChart.js release. In the meanwhile, is there something in which I could explore for myself to make this happen? This includes modifying SciChart.js in my development sandbox. Should I discover an avenue, I’m willing to make my findings and modifications available for others to follow.
  • Jim Risen
    I believe this behavior could be controlled from the Overview Annotation side. Currently the default component is OverviewCustomResizableAnnotation class which accepts min size of an annotation in pixels. So, I guess, to implement the solution we would need to: convert the main surface visible range limit to pixel coordinates on the overview; pass this value to a modiifed OverviewCustomResizableAnnotation which in its turn should handle the max size params.
  • You must to post comments
1
0

Hi David,

I’ve fetched the latest revision of 3.5.706 and unfortunately it’s still possible to extend the chart overview’s grips such that it doesn’t apply the mainAxisId‘s visible range properties constraints of the timeline axis (see code below) .

I’ve provided a visual image attached image (PNG) to help me more clearly explain to you (and others) the behaviour that I’m experiencing.

  • visibleRangeLimit property: spans from 10:43:12 AM – 10:45:12 AM –> 120 seconds
  • visibleRangeSizeLimit property has a min: 5 seconds & max: 60 seconds

The idea is that the cloud apps loads 2 minutes worth of sampling values into the data-series of the axes in the principal chart (below the chart overview) in which users can configure a viewable window via the visibleRangeSizeLimit property from 5 seconds up to 60 seconds.

During playback of the video or when users jump to a point-in-time, the charts current point-in-time changes and new sampling values are loaded as needed.

Unfortunately, users can use the chart overview’s grips to set viewable window beyond 60 seconds size constraint, as well as beyond the 120 seconds (which is the visibleRangeLimit).

When they do this they are presented in the principal chart with empty bookends on either side of that chart.

I hope that provides more guidance and enlightenment about this matter.

Regards,
Steven.


Here is the code used to create the chart overview.


private async createOverview(channelLanes: ChannelLane[]): Promise {
     const secondaryAxis = channelLanes.at(0)?.axis;

     if (!this.timelineAxis.id || !secondaryAxis) return;

     if (this.chartOverview) return;

     channelLanes.forEach((channelLane) => channelLane.isPartOverview = true);

     this.chartOverview = await SciChartOverview.create(
     this.chart.sciChartSurface,
          'overview',
          {
               mainAxisId: this.timelineAxis.id,
               secondaryAxisId: secondaryAxis.id,
               theme: new SciChartJsNavyTheme(),
               transformRenderableSeries: (renderableSeries) => {
                    if (renderableSeries.xAxisId !== this.timelineAxis.id) return undefined;

                    const channelLane = channelLanes.find((channelLane) =>
                    channelLane.axis.id === renderableSeries.yAxisId);

                    return (channelLane)
                         ? createOverviewRenderableSeries(channelLane.definition,
                              this.chart.wasmContext,
                              renderableSeries)
                         : undefined;
               },
               overviewYAxisOptions: { autoRange: secondaryAxis.autoRange }
          });

    if (this.chartOverview) {
          this.chartOverview.overviewYAxis.visibleRange = secondaryAxis.visibleRange;
          this.chartOverview.overviewYAxis.visibleRangeLimit = secondaryAxis.visibleRangeLimit;
          this.chartOverview.overviewYAxis.visibleRangeSizeLimit = secondaryAxis.visibleRangeSizeLimit;
     }
}

While the above code explicitly sets the Y-axis properties after the creation of the chart, that isn’t the issue at hand since it’s the X-axis whose visible range properties need to set the constraints with.

Images
  • You must to post comments
0
0

In version 3.5.706 just released we have made the overview automatically respect the axis.visibleRangeLimit on the main chart. Please let us know if this is now working as required. Full changelog is at https://www.scichart.com/changelog/scichart-js/

Regards
David

  • You must to post comments
0
0

Thanks,

I’ll give it a test later this week and let you know if it behaves as I expect it to.

Regards,
Steven

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.