Pre loader

1

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

0 votes

This task is now done and released as of version 3.2.575. SciChartVerticalGroup will now copy LayoutStrategies from the existing LayoutManager onto it’s SynchronisedLayoutManager so custom synchronised layouts will just work.

Regards
David

0 votes

Is your question related to WPF (Windows charts) or JS (JavaScript charts)?

In SciChart.js there is a mechanism to get a callback on legend checkbox changed. See the LegendModifier documentation.

Subscribing to Checkbox Checked Changed

As well as subscribing to BaseRenderableSeries.isVisibleChanged, you
can now subscribe to LegendModifier.isCheckedChanged event. This can
be done either in the constructor options to LegendModifier or after
creation.

const legend = new LegendModifier({
      showCheckboxes: true,
      showSeriesMarkers: true,
      showLegend: true,
      // Subscribe to checked changed here
      isCheckedChangedCallback: (series, isChecked) => {
          console.log(`Option 1: Legend item ${series.type} isChecked=${isChecked}`);   
      }
  });
  // Or here after instantiation
  legend.isCheckedChanged.subscribe((args) => {
      console.log(`Option 2: Legend item ${args.series.type} isChecked=${args.isChecked}`);
  });
  // Add the legend to the chart
  sciChartSurface.chartModifiers.add(legend);
  
1 vote

Hi there,

Please find attached an example that demonstrates how to use SciChart API to achieve the desired behavior.

The example utilizes PointMetadata API to add Selectable and Hoverable state to data points and Palette Provider API to change Fill color of individual columns depending of the state of the underlying data point. Also, a simple custom Chart Modifier is used to implement state changing behavior on Mouse events and trigger a chart redraw when such change occurs.

Please let me know if you have any questions regarding the example or any SciChart APIs that are used.

Best Regards,
Joeri, BS Inf
SciChart Software Engineer

0 votes

Hi Yu Dexiu,

Thanks for your question.
There isn’t such a callback on the LegendModifier.

However, since Legend checkboxes can hide or show a RenderableSeries, you can subscribe to IsVisibleChanged event on a RenderableSeries. It will be fired when a user changes series visibility through the Legend.

Alternatively, you can re-template the default Legend and have a binding on Checkboxes that will be triggered when they are checked/unchecked.

You can find more info about Legend customization here:
https://www.scichart.com/documentation/win/current/webframe.html#LegendModifier.html

With best regards,
Lex S., MSEE
SciChart Technical Support Engineer

  • Lex answered 2 months ago
0 votes

For server side licensing, the underlying component is in C++ and can be integrated into other languages and run on linux. We are currently working on improving the api and examples for this. Detailed questions on this need to be submitted on support.scichart.com as there are additional contractual requirements.
Regards
David

0 votes

Thank you for getting in touch. The first thing we tend to ask for is steps or code to reproduce issues.

For SciChart.js (JavaScript) this can be created as a Codepen or CodeSandbox (here’s how).

This makes it really easy to share with the tech team & resolve problems fast.

Thanks for your understanding! We look forward to hearing back from you.

0 votes

Hello Max, we are investigating the error on our side and here are some updates on the issue.
The error occurs specifically with Next 14.1, and seems to be related to module resolution during compilation. Specifically while compiling CommonJS modules. (BTW, running the boilerplate app in dev mode with “–turbo” seems to work fine)

Unfortunately, SciChart sources are built in CommonJS, and the library doesn’t support ES Modules, at the moment. (v3.3.570)

But the recently released library version provides a bundle with ESM support – “scichart/_wasm/scichart.browser.mjs”.

So as a temporary workaround you could use it like this:

import { SciChartSurface, NumericAxis } from "scichart/_wasm/scichart.browser.mjs";

To enable type checking you may add

import * as SciChartValue from "scichart/_wasm/scichart.browser.mjs";
import * as SciChartType from "scichart";
const SciChart = SciChartValue as typeof SciChartType;
const { SciChartSurface, NumericAxis } = SciChart;

We will be posting updates here. And, let us know if that works on your side.

1 vote
In reply to: axis tick label "-0"

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?

  • Lex answered 2 months ago
1 vote
0 votes
In reply to: Absolute Zoom in/out

Hi Ziv,

We discussed your inquiry.
Unfortunately, SciChart doesn’t provide this behavior out of the box.

However, it can be implemented on the user side by overriding the PerformScale(Point currentPoint, Point lastPoint, bool isSecondHalf) method of the YAxisDragModifier.
This method is called on every MouseMove event and calculates a new VisibleRange for an Axis based on the dragged distance. Please take a look:
https://www.scichart.com/documentation/win/current/webframe.html#SciChart.Charting~SciChart.Charting.ChartModifiers.AxisDragModifierBase~PerformScale.html

The default implementation is straightforward:

        protected virtual void PerformScale(Point currentPoint, Point lastPoint, bool isSecondHalf)
    {
        var axis = CurrentAxis;
        var scaledRange = CalculateScaledRange(currentPoint, lastPoint, isSecondHalf, axis);
        axis.VisibleRange = scaledRange;
    }

so you should just calculate the VisibleRange according to your desired behavior and assign it to the axis.VisibleRange instead of the scaledRange.

Hope this helps.

With best regards,
Lex S., MSEE
SciChart Technical Support Engineer

  • Lex answered 3 months ago
0 votes

Hello, I have the same problem, I see that Maksim described it in great detail,
I’m using the latest version of SciChart (v8.3.0.28019), TargetFramework net7.0-windows.
Could you please take a look at this issue.

0 votes
In reply to: Axis range

Hi Andrew,

Thank you for your answer!

In our case, we do not want to clip the visible range. What I am trying to achieve is the following: I have a series with some number of data points. Let us assume that in this series the lowest value is 67 and the highest value is 71. If we plot this normally with autorange = once, it will auto-range the Y axis to the visible range (67, 71). What I would like is to use the autorange feature so it automatically calculates the maximum range of Y axis but I would like to minimum range for Y axis to be 0 not 67 when we use ZoomExtentsModifier. The rest of the behaviors I do not want to affect: zooming, panning, dragging. What I am trying to say is that when I play with the zoom I do not want to restrict it. For example, if I play with the zoom I would like the range to modify to let’s say (68, 70) but also (-20, 100) (no clipping). But when we double-click the chart to trigger the ZoomExtentsModifier I would like to visible range to go to (0, 71) instead of (67, 71).

I am in an MVVM environment.
As I said in my comment I got it working the way I want by taking advantage of the GrowBy property. What I did was:

DoubleRange dr = axis.GetMaximumRange().AsDoubleRange();
axis.GrowBy = new DoubleRange(dr.Min / dr.Diff, dr.Max * 0.1 / dr.Diff);

This ensures that we have a 0 value as the min value of the visible range and we have a padding of 10% on the maximum side when we trigger the ZoomExtentsModifier. When I did this, I was not in an MVVM environment and I was using the NumericAxis type.

Since then, I moved to an MVVM environment and I am now using the NumericAxisViewModel type instead. But now, with this type do not have access to the GetMaximumRange() function. I need this function because in my example above it would return the visible range computed by the auto range which would be (67, 71).

Is this something we could achieve?

0 votes
In reply to: Annotations in MVVM

Hello Nicolas,

As for your question, I’ve investigated it and here are some results:
[1] First of all, MeasureXYAnnotation is the custom Annotation that is not part of SciChart library. The purpose of this in our official SciChart.Examples.Demo is to demonstrate the possibility and flexability of creating custom types of annotations based on our existing ones.
This Annotation was made without supporting MvvM, as it wasn’t a requirement for the exact example.

[2] You can try to implement your custom annotation ViewModel and add the Update() logic there
– You can start with this documentation:
https://www.scichart.com/documentation/win/current/webframe.html#Tutorial%2007b%20-%20Adding%20Annotations%20with%20MVVM.html
*** Note that your annotation(real one not viewModel) should be derived from CompositeAnnotationForMvvm not just CompositeAnnotation(to save all the style bindings for all properties)

public partial class MeasureXyAnnotation : CompositeAnnotationForMvvm

  • The next thing will be to store somehow an object of real one annotation(you can use different ways to achieve this by using Interfaces etc)
  • Then you’ll have to create a method that will call Update()method functionality on ‘a real’ annotation that is stored inside it. Simple method that will get two doubles as a parameters and set’s it accordingly to the X2Y2 props

***** Also you might need to use the AnnotationCreationModifierViewModel
For general idea you can take a look at our TradingAnnotations implementation.

If you still have questions regarding implementation, please ask.

0 votes
In reply to: Overlapping Bar Chart

I have tried the dynamic way by overriding getDataPointWidth and it did fix the problem where the data points were sparse but broke (showing overlapping bars) for other scenarios where it used to work before the fix.

1 vote

Hi Ben,

Thanks for your inquiry.
You can use our DataPoint Selection modifier to select separate columns/data points. Please take a look at the corresponding documentation for more info:
https://www.scichart.com/documentation/win/current/webframe.html#DataPoint%20Selection.html

You can also find our “PointMarkers Selection” example useful. Here is a link:
https://www.scichart.com/example/wpf-chart/wpf-chart-example-pointmarkers-selection/

The execution conditions of Chart Modifiers in SciChart are controlled by the ExecuteOn property.
I’ll discuss the possible options with our team and will get back to you.

Please let me know if you have any further questions.

With best regards,
Lex S., MSEE
SciChart Technical Support Engineer

  • Lex answered 3 months ago
1 vote

Hi,
Can you please clarify what exactly you want to extract ?

  • case1 : Do you want coordinates only when the user touches the centre line?
  • case2 :Do you want nearby centre line coordinates when the user is anywhere on the surface?

For Case 1, you can refer below code.

@objc fileprivate func handleSingleTap(_ recognizer: UITapGestureRecognizer) {
        let location = recognizer.location(in: recognizer.view!.superview)
        let hitTestPoint = surface.translate(location, hitTestable: surface.renderableSeriesArea)

        let hitTestInfo = SCIHitTestInfo()
        let rSeries = surface.renderableSeries[0]
        rSeries.hitTest(hitTestInfo, at: hitTestPoint)

        if hitTestInfo.isHit {
            var coordinates = String(format: "Touch at: (%.0f, %.0f)", hitTestPoint.x, hitTestPoint.y)
            print("coordinates ==", coordinates)
        }
    }
1 vote

Hi
Presently this feature is not supported.
we created a Task SCIOS-1177 make custom annotation like axis marker annotation which we will investigate later.

0 votes

When the background color is white (0xFFFFFF), colors with low Alpha values ​​appear very blurred or invisible in FastLineRenderableSeries. On the other hand, FastColumRenderableSeries shows clearly well even in colors with low alpha values. Please check again.

0 votes

Hi,

I tried the same code above provided, but I am unable to reproduce the issue.
Can you please share screenshot of your result.

Here is the screenshot of my result.
enter image description here

0 votes

Hello all
I got the answer from tech support. It is simple

VM

private ChartDataObject _seriesData;
public ChartDataObject SeriesData
{
    get { return _seriesData; }
    set
    {
        SetProperty(ref _seriesData, value, nameof(SeriesData));
    }
}

User control with SciChartSurface

<s:LegendModifier x:Name="SciChartLegendModifier" SeriesData="{Binding SeriesData, Mode=TwoWay}" GetLegendDataFor="AllSeries" ShowLegend="False" />

User control with SciChartLegend

<s:SciChartLegend x:Name="SciChartLegendControl" s:ThemeManager.Theme="Chrome" Margin="5,5" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" LegendData="{Binding SeriesData, Mode=OneWay}" ShowVisibilityCheckboxes="True" />
Showing 61 - 80 of 6k results