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 is a known issue due to the way we detect if the axis is in its default state. We are taking a look to see if there is a simple and safe way we can sort out.
Regards
David

1 vote

Any news on this?

1 vote

The FocusManager approach worked perfectly. Thank you.

0 votes

Hi Suzanne,

Firstly, we recommend providing code to reproduce this error. You can share this with us in a codepen, or a codesandbox. Instructions on how to do this can be found here: https://www.scichart.com/blog/codepen-codesandbox-and-jsfiddle-support-in-scichart-js

Next, we also recommend trying that same code to reproduce against the latest version of SciChart: v3.3. The version you are using (v3.0) is not the latest and could have bugs or issues in it.

We will await your update with code to reproduce before providing further assistance.

Best regards,
Andrew

1 vote

Hi Jamie,

Thanks for your inquiry.
This is the default behavior of WPF TextBox, which is used under the hood of our TextAnnotation.

We would suggest you try forcing Focus to any other control before saving the data. This can be done using WPF capabilities, for instance, FocusManager:
https://learn.microsoft.com/en-us/dotnet/api/system.windows.input.focusmanager.setfocusedelement?view=windowsdesktop-8.0

Alternatively, you can override the TextAnnotation Template to update it on a keypress:
https://learn.microsoft.com/en-us/dotnet/desktop/wpf/data/how-to-control-when-the-textbox-text-updates-the-source?view=netframeworkdesktop-4.8

Please let us know if you are interested in this option. We can share the default Template.

Kind regards,
Lex S., MSEE
SciChart Technical Support Engineer

  • Lex answered 3 days ago
  • last active 3 days ago
1 vote

The background pattern in the Overview can be removed by how?

1 vote

Hi Jeong,

This can’t really be done like this. RenderableSeries are FrameworkElements and shouldn’t be declared in a ViewModel.

There are two ways to bind to RenderableSeries in SciChart WPF:

Method 1: declare RenderableSeries in XAML and bind to DataSeries in ViewModel

e.g.

<!-- where xmlns:s="http://schemas.abtsoftware.co.uk/scichart" -->
<s:SciChartSurface>

    <s:SciChartSurface.RenderableSeries>
        <s:FastLineRenderableSeries DataSeries="{Binding DataSeries}"
                                    StrokeThickness="1" StrokeDashArray="2 2"
                                    Stroke="OrangeRed"/>
    </s:SciChartSurface.RenderableSeries>

    <!--  XAxis, YAxis omitted for brevity  -->

</s:SciChartSurface>

// Viewmodel
class ViewModel 
{
    public XyDataSeries DataSeries { get; set; }
}

With this method your number of RenderableSeries are fixed but you can modify the data from a view model.

Method 2: Declare RenderableSeriesViewModels in XAML and bind to SciChartSurface.RenderableSeries with the SeriesBinding Markup extension

e.g.

<!-- Declare a SciChartSurface with SeriesBinding -->
<!-- Where xmlns:s="http://schemas.abtsoftware.co.uk/scichart -->
<s:SciChartSurface RenderableSeries="{s:SeriesBinding RenderableSeriesViewModels}">

   <!-- XAxis, YAxis omitted for brevity -->

</s:SciChartSurface>

private ObservableCollection<IRenderableSeriesViewModel> _renderSeriesViewModels;
public ObservableCollection<IRenderableSeriesViewModel> RenderableSeriesViewModels
{
   get { return _renderSeriesViewModels; }
   set
   {
      _renderSeriesViewModels = value;
         OnPropertyChanged("RenderableSeriesViewModels");
   }
}

With this method you have full control over adding, removing renderable series as well as modifying the data from the view model.

0 votes

The result screen is missing so I am uploading it.

1 vote

Hi Lex,
I follow the suggestion, set GrowBy to “0.0, 0.0”, and update my xaml code

<s:SciStockChart.XAxisStyle>
    <Style TargetType="s:CategoryDateTimeAxis">
        <Setter Property="FontSize" Value="{DynamicResource GlobalFontSize10}"/>
        <Setter Property="DrawLabels" Value="True" />
        <Setter Property="DrawMinorTicks" Value="False" />
        <Setter Property="DrawMajorTicks" Value="False" />
        <Setter Property="DrawMajorBands" Value="False" />
        <Setter Property="DrawMajorGridLines" Value="False" />
        <Setter Property="DrawMinorGridLines" Value="False" />
        <Setter Property="TextFormatting" Value="{Binding XAxisTextFormatting}" />
        <Setter Property="VisibleRange" Value="{Binding ParentViewModel.XRange, Mode=TwoWay}" />
        <Setter Property="VisibleRangeLimit" Value="{Binding ParentViewModel.XRangeLimit}"/>
        <Setter Property="AutoRange" Value="{Binding ParentViewModel.AutoRangeX}"/>
        <Setter Property="GrowBy" Value="0.0, 0.0"/>
    </Style>
</s:SciStockChart.XAxisStyle>

But the result is same, do I missing something?

1 vote

Hi Chia Chun Tang,

Thanks for your question.
SciStockChart is a preconfigured SciChartSurface version having some properties on its elements set to default values. Please take a look at the corresponding article for more info:
https://www.scichart.com/documentation/win/current/webframe.html#SciStockChart%20-%20Simplified%20Financial%20Charts.html

The spaces you see on the sides are controlled by the Axis.GrowBy property:
https://www.scichart.com/documentation/win/current/webframe.html#SciChart.Charting~SciChart.Charting.Visuals.Axes.AxisCore~GrowBy.html

To get rid of these spaces you can override the default value by setting the GrowBy property for the XAxis to “0.0, 0.0”.

With best regards,

Lex S., MSEE
SciChart Technical Support Engineer

  • Lex answered 1 week ago
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 weeks 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 3 weeks ago
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 4 weeks ago
Showing 1 - 20 of 6k results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies