Pre loader

Forums

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

5 votes
13k views

Hello,

I am trying to create a XABCD pattern annotation. Currently, I am able to create the XA, AB, BC, CD legs using LineAnnotation then add the two remaining XB and BD lines programmatically. However, when creating the LineAnnotations, I am not getting the real-time feedback between the 1st and 2nd clicks. I have full source code but from what I can see, all SciChart annotations are at most, limited to 2 clicks. I’ve read through the Fibonacci composite annotations which are close to what I’m trying to achieve but only allow interaction by 2 clicks since they’re based on BoxAnnotation.

I am currently using full MVVM with a custom derived class from AnnotationCreationModifier per this article: Editing annotations and keeping track of them in an mvvm application combined with the Multi-Pane Stock Chart example. For the PatternAnnotationViewModel, I am using dependency properties for X, A, B, C, D so they are bindable if needed.

Huge thanks in advance,
Jason

Psuedo code
1st click
Place point X portion of XA LineAnnotation, begin visual feedback for point A
2nd click
Place point A
Set beginning of AB to A, begin visual feedback for point B
3rd click
Place point B
Set beginning of BC, begin visual feedback for point C
Draw XB LineAnnotation
PolygonFill XAB region
4th click
Place point C
Set beginning of CD, begin visual feedback for point D
5th click
Place point D
Draw BD LineAnnotation
PolygonFill BCD region

Desired Functionality

Undesired Functionality

4 votes
21k views

I am using WPF SciChart version 1.3.1.1107 under the MVVM pattern.
I’ve included some sample code from a couple of my view models for reference purposes but it identical to sample code I copied from your examples.

My problem is that the data values arrive in a non sorted date time order and as a result my chart line does not connect the points based on the xaxis datetime value, but instead connects the points based on when the codes adds the points to the data series.

Do you have a feature that will allow me to plot a line based on a date time values?

    IDataSeries dataSeries = ChartDataSeriesSet.AddSeries();

    private IDataSeriesSet _chartDataSeriesSet = new DataSeriesSet();
    public IDataSeriesSet ChartDataSeriesSet
    {
      get { return _chartDataSeriesSet; }
      set
      {
        _chartDataSeriesSet = value;
        NotifyPropertyChanged("ChartDataSeriesSet");
      }
    }

    private IDataSeries _dataValues = null;
    public IDataSeries DataValues
    {
      get { return _dataValues; }
      set
      {
        _dataValues = value;
        NotifyPropertyChanged("DataValues");
      }
    }
  • sdemooy asked 12 years ago
  • last active 10 years ago
4 votes
19k views

I am trying to add Zoom capability to application that is based on ECG Monitor sample. As ECG Monitor manages VisibleRange, I need to stop setting VisibleRange when zoom is started. I am setting flag in RubberBandXyZoomModifier.OnModifierMouseDown.

Is there any way to create a custom ChartModifier to be notified when the user clicks mouse down on the chart, or axis?

4 votes
19k views

Hi guys,

After adding a YAxis to the left of my SciChart I’ve noticed that this code no longer functions as I expect:

        public override void OnModifierMouseDown(ModifierMouseArgs e)
        {
            base.OnModifierMouseDown(e);

            if (ParentSurface.RenderableSeries.First().XAxis == null)
                return;

            if (!_mouseDragged && IsFunctional)
            {
                _mouseDragged = true;
                _selectionStart = (DateTime) ParentSurface.RenderableSeries.First().HitTest(e.MousePoint).XValue;
            }
        }

_selectionStart should be a Date under the cursor where the user has just clicked. Instead it’s a Date approx. 40pixels to the right of where the user has just clicked because the Left YAxis is approx. 40 pixels, and the ModifierMouseArgs.MousePoint is considering the YAxis space into it’s X coordinate value.

So when I take that point and perform a HitTest, I am not getting the expected result here.

I will write a fix for this to take into account a Left Y Axis if one exists and modify the point’s X coordinate value, but I thought to give you a heads-up in case this is outside of expected functionality and is indeed a bug.

Cheers,
Miles

  • bstapylton asked 12 years ago
  • last active 1 year ago
4 votes
14k views

Hi,

I would like to display simple equations as axis titles. For example cm^2 (with the 2 superscript) or g / mol with the “mol” under the g.

Is there a way to do that? At least being able to superscript or subscript any letter would be a must.

Thanks.

  • xhahn asked 11 years ago
  • last active 9 years ago
4 votes
14k views

I will continue to this question here, but with more details. So I need to be able to drag axis annotations separately. Is there any possible way to achieve this in iOS? Basically I subclassed SCIAxisMarkerAnnotation and implemented my own -onPanGesture:At: but it does not separate instances of the class when I try to drag one of the annoation. All moves to same place. How can I detect which annotation is being dragged?

CDAxisMarkerAnnotation.h

#import <SciChart/SciChart.h>
@class CDAxisMarkerAnnotation;

@protocol CDAxisMarkerAnnotationDelegate <NSObject>

- (void)axisMarkerAnnotation:(CDAxisMarkerAnnotation *)axisMarkerAnnotation
           didPanToAxisValue:(double)axisValue;

@end

@interface CDAxisMarkerAnnotation : SCIAxisMarkerAnnotation

@property (weak, nonatomic) id<CDAxisMarkerAnnotationDelegate> delegate;

@end

CDAxisMarkerAnnotation.m

#import "CDAxisMarkerAnnotation.h"

@implementation CDAxisMarkerAnnotation

- (BOOL)onPanGesture:(UIPanGestureRecognizer *)gesture At:(UIView *)view
{
    if (![view isKindOfClass:[SCIChartSurfaceView class]]) {
        return [super onPanGesture:gesture At:view];
    }

    switch (gesture.state) {
        case UIGestureRecognizerStateBegan:
        case UIGestureRecognizerStateChanged:
        case UIGestureRecognizerStateEnded: {
            CGPoint location = [gesture locationInView:view];
            id<SCIRenderSurface> renderSurface = [self.parentSurface renderSurface];
            CGPoint pointInChart = [renderSurface pointInChartFrame:location];
            id<SCICoordinateCalculator> yCalculator = [self.yAxis getCurrentCoordinateCalculator];
            double valueForYAxis = [yCalculator getDataValueFrom:pointInChart.y];
            [self.delegate axisMarkerAnnotation:self didPanToAxisValue:valueForYAxis];
            break;
        }
        default: {
            break;
        }
    }
    return YES;
}

@end

Thanks,
Irmak

4 votes
15k views

Hi,

I added VerticalLineAnnotation to my SciChartSurface with multiple FastLineRenderableSeries. This is working fine, but I can’t figure out how to show the corresponding Y values at side of vertical line. (Each Dataserie has its own YAxes.)

I Found a place in VerticalLineAnnotations template, where I can insert a stackpanel or something to show the values, but I don’t know how to make the data binding work.

I want to do something like in the attached picture.

Best Regards,
Martti

4 votes
24k views

How do I implement zooming in real time charts. The examples are all static data, and the zooming works, and a couple of links I found, do not explain it very well.

How can I accomplish zooming on a real time SciChart?

  • darlon asked 10 years ago
  • last active 6 years ago
4 votes
20k views

Hi,

I’ve got the following scenario that I need to implement and it would be very nice if you could give me a jump-start. I need to bind the x-axes values represented by 2 vertical lines and the y-axis values represented by 2 horizontal lines to a viewmodel, so that the values inside the viewmodel change when moving the lines per mouse on the screen and the other way around (see mockup for how it should look like). I think the rollover modifier could be usable for this, but I need some pseudo code or an example app on how to bind the rollover modifiers value to the viewmodel and how to display 4 rollover modifiers on the chart surface.

Thanks
Joerg

3 votes
18k 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?

  • bstapylton asked 11 years ago
  • last active 9 years ago
3 votes
16k views

Hi,

When we have 9 horizontal gridlines, we would also like to see 9 yvalues.

Is it possible to also show 300 and -500 on Yaxis1 and 500 and -300 on Yaxis2
(see attachment)

Thanks and best regards,
Egbert

3 votes
0 answers
7k views

Hi there!
I successfully build trader chart from nice example “2D Charts -> Create Stock Charts -> Using SciStockChart”.
Then I had to draw line on the chart with candles, but the problem was, that the line didn’t have data on some dates (there is data for lots of candles, but for the red line there is only 4 points: A,B,C,D), and result i want in shown here (solved):
Result i want image

Axes:
XAxis: CategoryDateTimeAxis (Dates)
YAxis: NumericAxis (Prices)

Series:
Candles: FastCandlestickRenderableSeries (OhlcDataSeries<DateTime, double>)
Red Line: FastLineRenderableSeries (XyDataSeries<DateTime, double>)

Problem:
CategoryDateTimeAxis type ignores the XAxis values for computation of x-coordinate, and choosing only the index of the value instead. CategoryDateTimeAxis vs DateTimeAxis. I have N-number of candles and only 4 values for red line. How to receive line with no gaps, with points on their places (dates on X-axis) ? I can’t use simple DateTimeAxis, because candles don’t draws.

Solution:
1) Use double.NaN for each date (x-axis value) if no data for the red-line on date given.
2) In FastLineRenderableSeries set DrawNaNAs = LineDrawMode.ClosedLines (if don’t use this flag, you will receive something like this: WPF Chart Gaps (Nulls) in Series

Thanks a million to Julia Skorobogata from SciChart!

3 votes
19k views

Hi!

Got a wierd issue. My client is installing my application (built with Scichart) and everything works fine, except on the laptop of this one particular guy, where the zoom does a wierd thing. It zooms the axes, but the graph is not moving. I’m quite sure there is nothing wrong with my application as it works everywhere else, but can any of you think of anything that I should check on this guys machine? I am at a complete blank here…

Thanks for helping me out….

3 votes
15k views

Hi

I am trying to allow my user to hide/show annotations by binding the visibility property, but I can’t seem to get it to work. Actually when I manually set visibility to Hidden it’s still there. Is that just not implemented?

Lisbeth

3 votes
17k views

…sucks. Likely a programming error.

Trying to show a larger chart which has 16000 annotations on it. Besides that being a programming error at this point – we do / will have zoom out charts with that many data points.

I spend minutes, literally, in

Annotations.Add – no way to add an enumeration of them.

SuspendUpdates

has been called around this – so updates SHOULD not happen, but it seems there is a lot of overhead here.

What is adviced?

Besides that slowness in creating the chart, it is also (very) slow to change sizes etc.

Any advice for a heavily annotated chart?

3 votes
17k views

I have a realtime linear chart with multiple x/y axes. When I am zooming the surface, I am changing the X/Y AutoRange mode from AutoRange.Always to AutoRange.Never, which allows me to have Modifiers zooming and panning on a realtime AutoRange chart.

After, I want to re-enable AutoRange when ZoomExtents (double click) occurs.

See below:

    public class ZoomExtentsXAxesModifier : ZoomExtentsModifier
    {
        private Point _startPoint;
        private bool _isMouseDoubleClick;

        public override void OnModifierMouseDown(ModifierMouseArgs e)
        {
            base.OnModifierMouseDown(e);

            if(e.Modifier == MouseModifier.Ctrl) return;

            if (e.MouseButtons == MouseButtons.Left)
                _startPoint = e.MousePoint;

            _isMouseDoubleClick = false;
        }

        public override void OnModifierMouseUp(ModifierMouseArgs e)
        {
            base.OnModifierMouseUp(e);

            if (e.Modifier == MouseModifier.Ctrl) return;

            if (e.MouseButtons != MouseButtons.Left || _startPoint == e.MousePoint || _isMouseDoubleClick) return;

            using (ParentSurface.SuspendUpdates())
            {
                foreach (var axise in XAxes.Where(axise => axise.AutoRange != AutoRange.Never))
                {
                    axise.AutoRange = AutoRange.Never;
                    axise.Zoom(_startPoint.X, e.MousePoint.X);
                }

                foreach (var axise in YAxes.Where(axise => axise.AutoRange != AutoRange.Never))
                {
                    axise.AutoRange = AutoRange.Never;
                    axise.Zoom(_startPoint.Y, e.MousePoint.Y);
                }
            }
        }

        public override void OnModifierDoubleClick(ModifierMouseArgs e)
        {
            base.OnModifierDoubleClick(e);

            if (e.Modifier == MouseModifier.Ctrl) return;

            foreach (var axise in XAxes)
                axise.AutoRange = AutoRange.Always;

            foreach (var axise in YAxes)
                axise.AutoRange = AutoRange.Always;

            _isMouseDoubleClick = true;
        }
    }

For the one chart it is working ok, but when I have more then 2 charts, it is zooming incorect? What can I solve this? I need to recieve one event, when user is zooming, panning or resizing chart. Is it possible?

Thanks,
Arthur

3 votes
19k views

I’m wondering what the established methods would be for the following scenario:

You generate data in your own assembly and dump it into an XyDataSeries and point or line render series with an IChartSeriesViewModel object and bind that using the SeriesSource api.

But it is relatively common to have additional metdata about a given datapoint that is keyed to something other than an X or Y value. For example, the plot may be based on the a computed number that is independent of a time value, but you still want to display the time value for that chart in the rollover tooltip.

What are the options for dealing with this in scichart?

Best and thanks!

  • dsantimore asked 10 years ago
  • last active 1 year ago
3 votes
16k views

Request for enhancement to polar charts to allow for rotation of the X axis. I want to use this chart type with compass directions. Therefore a range of 0-360 with 0 at the top of the chart.

I was able to use the workaround for rotation here:
https://www.scichart.com/questions/question/polar-chart-x-axis-starting-point-and-direction

However as the OP on that question noted there are several drawbacks to simply rotating the entire chart surface.
Also I found that at run-time rotating the chart surface is inaccurate as in this example:

Polar chart example

As you can see the 100 degree mark is not in the correct location. Directly right should be 90.

In the designer the chart axis looks as it should:

enter image description here

  • wawr asked 9 years ago
  • last active 5 years ago
3 votes
18k views

Hi,

I am trying to build a chart with two series in it. One is an OHLC chart with the time on the X axis and price on the Y Axis. The other is an Bar chart with the price as the X Axis and an integer scale for the YAxis. The bar chart will need be have horizontal columns though which will need to align with the prices on the OHLC series. I have attached an image here with what the chart should look like, is there a way to achieve this ?

3 votes
17k views

I am using MVVM and am having problems and need you to have a quick look please as this is substantial

1)Run Solution

2)Click on Load, browse to folder Configuration\20120814 and select OK

3) 6 data series will load, the program then adds random data for each trace. The point count for each trace is shown on the form

4) After a few minutes, the update speed of the points reduces (this is not intended) the counter should update each second

5) when the count reaches about 16000 the program is pretty well locked up and non responsive.

It may well be a problem that I have introduced, at least I hope it is, as our intended application will be using very large data sets
Please could you have a look ASAP and get back to me

You have also not replied to the annotation problem I explained in another thread, I sent you example code to show you the problem

Thanks

  • wilx asked 11 years ago
  • last active 7 months ago
3 votes
17k views

Hi Guys,

My Sci Chart has dates along the X-Axis. So far my data is at week level (one point for each week).

Ideally I would like to have a subtle grid line at each week, a more noticeable grid line to represent the start of each month, and a major grid line to represent the start of each year.

I understand that the current implementation of the XAxis seems to only use Minor and Major gridlines.

I am interested in drawing grid lines such that:

one minor vertical grid-line is drawn on the start of each week
one medium vertical grid-line is drawn on the start of each month
one major vertical grid-line is drawn on the start of each year
And for these grid lines to be drawn regardless of the current visible range or “zoom” of the chart.

Is there a simple tutorial or some snippet of code illustrating what I need to overwrite in a custom class in order to get this functionality into my chart?

Thanks again,
Miles

3 votes
25k views

Hi,

I have a chart for a temperature line using FastLineRenderableSeries and a couple of HorizontalLineAnnotation to show some thresholds for that line.
When I call DataSeriesSet.InvalidateParentSurface(RangeMode.ZoomToFit) the chart zoom to fit the data from the data series (which is fine).
Now I would like to be able to zoom to the chart extents but including those threshold line. What would be the best way to accomplish this?

Screen shots attached.

Chart with RangeMode.ZoomToFit: c1
Chart manually zoomed out to show threshold line: c2
(the chart is that small green dot that is showing just bellow the lower threshold)

The goal is to be able to provide a feature that my users can zoom chart so that both data set and thresholds are shown. I guess a variation of the current zoom to fit but taking into account the annotation lines.

Thanks!

  • jsimoes asked 11 years ago
  • last active 6 years ago
3 votes
16k views

Hi,

Can you tell me if it is possible to make a contour plot like on the image i have attached?

I cant seem to find a way to do that.

Best regards,
Jeppe

3 votes
16k views

I was trying to figure out why I couldn’t get minor tick marks to appear on my axes and then I realized it’s because of the theme I was using (BrightSpark). Just a heads up to anyone else who may run into this.

IMO themes should not hide chart features such as tick marks.

3 votes
15k views

Is there a way to have axis X placed vertically and Y horizontally? Other words rotate chart 90 degrees to the left or right.

  • sdvinin asked 12 years ago
  • last active 8 years ago
3 votes
27k views

Hey guys,

I’m looking at changing the Numeric Axes on the Right and Left axes of my Chart, to right-align the Text within the Axis Labels.

I noticed this topic where Yuriy hinted that in 2.0 this would be a supported feature, but can’t seem to see what it would be:
http://http://www.scichart.com/questions/question/x-and-y-axis-formatting/
The “work around” featured in that topic doens’t seem to change anything in my situation.

I have tried setting FlowDirection to “RightToLeft”, which does the job, but has some ugly placement side-effects.

Is there something I’ve overlooked?

Thanks,
Miles

  • bstapylton asked 10 years ago
  • last active 8 years ago
3 votes
16k views

The issue I’m dealing with is that after setting up the SeriesSelectionModifier, I require a double-click (and a very, very precise double click, at that) to select a series. Naturally, this is also competing with the ZoomExtents() call that is the normal effect of a doubleclick.

<!-- Chart -->
        <scichart:SciChartSurface Grid.Column="1" Grid.Row="1" x:Name="sciChartSurface"
                                  SeriesSource="{Binding SeriesList, Mode=OneWay}"
                                  ChartTitle="{Binding Title}"
                                  >

            <scichart:SciChartSurface.XAxis>
                <scichart:NumericAxis x:Name="AxisX" Id="AxisX" AxisTitle="{Binding XTitle}" AxisAlignment="Bottom" />
            </scichart:SciChartSurface.XAxis>

            <scichart:SciChartSurface.YAxes>
                <scichart:NumericAxis x:Name="AxisY1" Id="AxisY1" AxisTitle="{Binding Y1Title}" AxisAlignment="Left"
                                      />
                <scichart:NumericAxis x:Name="AxisY2" Id="AxisY2" AxisTitle="{Binding Y2Title}" AxisAlignment="Right"
                                      IsEnabled="{Binding ShowY2Axis}"
                                      Visibility="{Binding RelativeSource={RelativeSource Self},
                                                           Path=IsEnabled,
                                                           Converter={StaticResource convBooleanToVisibility}}"
                                      />
            </scichart:SciChartSurface.YAxes>

            <!-- Modifiers -->
            <scichart:SciChartSurface.ChartModifier>

                <scichart:ModifierGroup>

                    <!-- TODO: Comment -->
                    <scichart:ZoomPanModifier ExecuteOn="MouseRightButton" />

                    <!-- TODO: Comment -->
                    <scichart:RubberBandXyZoomModifier IsEnabled="True" x:Name="rubberBandZoomModifier" IsXAxisOnly="False" ZoomExtentsY="False" IsAnimated="True"/>

                    <!-- TODO: Comment -->
                    <!--<scichart:RolloverModifier x:Name="rolloverModifier" DrawVerticalLine="False" UseInterpolation="True"  SourceMode="AllSeries" />-->

                    <!-- TODO: Comment -->
                    <scichart:CursorModifier x:Name="cursorModifer" SourceMode="AllSeries" UseInterpolation="True"/>

                    <!-- TODO: Comment-->
                    <scichart:ZoomExtentsModifier />

                    <!-- Exposes a LegendData property (of type ChartDataObject) which can be accesed via elementName from another control -->
                    <!-- ChartDataObject exposes a list of SeriesInfo -->
                    <scichart:LegendModifier x:Name="legend" GetLegendDataFor="AllSeries"/>
                    
                    <!-- Provides selection of series and custom styling options (to the selected series) -->
                    <scichart:SeriesSelectionModifier SelectedSeriesStyle="{StaticResource selectedSeriesStyle}" ExecuteOn="MouseLeftButton"
                                                      />
                    
                </scichart:ModifierGroup>
            </scichart:SciChartSurface.ChartModifier>

        </scichart:SciChartSurface>
3 votes
16k views

I am currently adding line to a chart to show when a value is ON and using the gap in a series feature to indicate when the value is OFF. In order for this to work I need to update the chart every few seconds when the value is ON; however, I do not want to add additional points; instead I want to either update a point in the line series or I want to remove a point and then add a new point. In my case its the x-axis value that I need to change.

Can you please suggest if this is possible?
If yes I am also wondering how to best find a specific point in a line series.

3 votes
0 answers
12k views

Zoom History

Ok, so as I had not had a reply,I have managed to slog this out and I have created a customRubberBandXyZoomModifier.

In this I keep a copy of all the VisibleRanges on the mouse down and on the mouse up ( if it was dragging) I copy these ranges into a list of ranges in my ViewModel (parent) see below.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Abt.Controls.SciChart;
using AVR_HMI.ViewModels;

namespace AVR_HMI.Charting
{
    public class customRubberBandXyZoomModifier : RubberBandXyZoomModifier
    {
        AnalogueChartViewModel _parent;

        IRange _tempOldXRange;

        List<IRange> _tempOldYRange = new List<IRange>();

        public customRubberBandXyZoomModifier(AnalogueChartViewModel parent)
        {
            _parent = parent;
        }

        public override void OnModifierMouseDown(ModifierMouseArgs e)
        {
            _tempOldXRange = XAxis.VisibleRange;

            _tempOldYRange.Clear();
            foreach (NumericAxis na in YAxes)
            {
                _tempOldYRange.Add(na.VisibleRange);
            }
            base.OnModifierMouseDown(e);
        }


        public override void OnModifierMouseUp(ModifierMouseArgs e)
        {
            if (IsDragging)
            {
                if (_tempOldXRange != null)
                {
                    _parent.OldXRange = _tempOldXRange;
                    _parent.XRangeHistory.Add(_tempOldXRange);
                    _tempOldXRange = null;
                }

                if (_tempOldYRange.Count != 0)
                {
                    int n = 0;
                    foreach (IRange ra in _tempOldYRange)
                    {
                        if (_parent.YRangeHistories[n] != null)
                        {
                            _parent.YRangeHistories[n].RangeHistory.Add(_tempOldYRange[n]);
                        }
                        else
                        {
                            break;
                        }
                        n++;
                    }
                }
                _parent.ZoomBack.RaiseCanExecuteChanged();
                _parent.AutoRangeEnable = false;
            }
            base.OnModifierMouseUp(e);
        }
    }
}

Then in the view model, I have an unzoom button which takes the last set of Ranges off the list and restores these ranges as below

       List<IRange> _xRangeHistory = new List<IRange>();

        public List<IRange> XRangeHistory
        {
            get { return _xRangeHistory; }
            set { _xRangeHistory = value; }
        }

        List<YRangeHistory> _yRangeHistories = new List<YRangeHistory>();

        public List<YRangeHistory> YRangeHistories
        {
            get { return _yRangeHistories; }
            set { _yRangeHistories = value; }
        }


        DelegateCommand _zoomBack;
        public DelegateCommand ZoomBack
        {
            get
            {
                if (_zoomBack == null)
                {
                    _zoomBack = new DelegateCommand(
                        this.OnZoomBackCommandExecute,
                        this.OnZoomBackChangedCommandCanExecute);
                }

                return _zoomBack;
            }
        }

        private bool OnZoomBackChangedCommandCanExecute(object obj)
        {
            if (YRangeHistories.Count == 0 || YRangeHistories[0].RangeHistory.Count == 0)
            {
               return false;
            }
            return true;
        }

        private void OnZoomBackCommandExecute(object obj)
        {
            if (XRangeHistory.Count != 0)
            {
                XAxis.VisibleRange = XRangeHistory[XRangeHistory.Count-1];
                XRangeHistory.Remove(XAxis.VisibleRange);
            }

            if (YRangeHistories.Count != 0)
            {
                int n=0;
                foreach (NumericAxis na in YAxes)
                {
                    int offset =  YRangeHistories[n].RangeHistory.Count;
                    if(offset > 0)
                    {
                        na.VisibleRange = YRangeHistories[n].RangeHistory[offset - 1];
                        YRangeHistories[n].RangeHistory.Remove(na.VisibleRange);
                    }
                    n++;
                }
 
            }
            if (YRangeHistories.Count == 0 || YRangeHistories[0].RangeHistory.Count == 0)
            {
                AutoRangeEnable = true;
            }
            ZoomBack.RaiseCanExecuteChanged();

            VPManager.InvalidateParentSurface(RangeMode.None);
        }

On adding a new YAxis, I add a new YRangeHistory


                       YAxes.Add(numericAxis);
                       YRangeHistories.Add(new YRangeHistory());

YRangeHistory Class


using System.Collections.Generic;
using System.Linq;
using System.Text;
using Abt.Controls.SciChart;

namespace AVR_HMI.Charting
{
    public class YRangeHistory
    {
        List<IRange> _RangeHistory;

        public List<IRange> RangeHistory
        {
            get { return _RangeHistory; }
            set { _RangeHistory = value; }
        }

        public YRangeHistory()
        {
             _RangeHistory = new List<IRange>();
        }
    }
}

Hope this helps others, and if there is a better/easier way of doing this, please get back to me, I know I am on the demo version of SciChart at the moment, but we are intending to buy it and I worry about the lack of good documentation/support. I don't want to start looking elsewhere.

  • wilx asked 11 years ago
3 votes
3k views

Hi,

In my application I am using two charts for represent different values. I am using LegendModifier on the first chart. Is it possible when i uncheck the series on first chart and the same color series on second chart also need to hide from the second chart. Any event callback function available in LegendModifier ?

2 votes
11k views

I am implementing a feature to load more historical data when users pan to the left side on a CategoryDateAxis.
To load more, i need to have 2 Date which is the earliest data point i have and the Date that is shown on the X-Axis

For the earliest data point, i can get via IXyDataSeries#getXMin()
But for the other Date, i’m not sure how to get it. I can listen to range changes via IAxisCore#VisibleRangeChangeListener, but the range returns Double. I cant figure out to convert it into a Date

  • abc def asked 7 years ago
  • last active 7 years ago
2 votes
5k views

var lineData = new XyDataSeries<DateTime, double>();

if I have a XyDataSeries<DateTime, double> then I can get the sweeping animation to work. If I change the XyDataSeries to XyDataSeries<DateTime, int> it fails to produce the chart and gives an exception stating

SciChartSurface didn’t render, because an exception was thrown:
Message: Specified cast is not valid.

Stack Trace: at SciChart.Charting.Visuals.RenderableSeries.Animations.Transformations.Point2DSeriesTransformation1.SweepTransform(T pointSeries, Double currentProgress)
at SciChart.Charting.Visuals.RenderableSeries.Animations.Transformations.Point2DSeriesTransformation
1.O(IPointSeries D, Double I)
at SciChart.Charting.Visuals.RenderableSeries.Animations.SweepAnimation.Animate(IRenderPassData rpd, Double currentProgress)
at SciChart.Charting.Visuals.RenderableSeries.Animations.SeriesAnimationBase.OnRender(IRenderPassData rpd)
at SciChart.Charting.Visuals.RenderableSeries.BaseRenderableSeries.WFB(IRenderContext2D D, IRenderPassData I)
at A.IJ.T(ISciChartSurface D, RenderPassInfo I, IRenderContext2D J, Int32 M)
at A.IJ.M(ISciChartSurface D, RenderPassInfo I, IRenderContext2D J)
at A.IJ.RenderLoop(IRenderContext2D renderContext)
at SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()

Is this possible or does yaxis have to be a double? If I use fade animation it works properly. Thanks.

  • John asked 4 years ago
  • last active 4 years ago
2 votes
12k views

I’m currently using the MouseWheelZoomModifier to allow the user to zoom into charts (XyDirection=”XYDirection”), but I’ve now had a request to provide an way for the user to zoom X only, Y only, or both. I realise it’s possible to change the XyDirection property (e.g. using checkboxes, like in your demo), but the PM is asking if a more “user friendly” solution is possible.

One option might be to change the zoom direction based on where the mouse is, e.g. if it’s over the X-axis then zoom X only, over the Y-axis then zoom Y only, otherwise zoom XY.

Another option may be to use modifier keys, e.g. wheel + Ctrl = X only, wheel + Shift = Y only, wheel on its own = XY.

Can you offer some pointers towards a suitable solution, if such a thing is possible? Ideally it would be nice if I could implement a customer modifier, if it’s not too complicated, rather than combining the out-of-the-box modifier with mouse events.

  • andyste1 asked 10 years ago
  • last active 7 years ago
2 votes
14k views

attachment is one type chart used in our product. could the sciChart implement this functions?

great thanks.

  • darkgone asked 11 years ago
  • last active 8 years ago
2 votes
14k views

I am attempting to replace an existing chart (Infragistics) as we have now moved this application to a tablet with less processing power and the current solution is using 40 – 50% cpu on said tablet. I am hoping to create a replacement that is much more efficient.

The current chart has 4 wave forms, each displays 8 seconds (which is 4000 points) of data and wraps around on itself with a moving gap just like an ECG machine in a hospital room. The way I get this behavior currently is to create an ObservableCollection with 4000 elements all with NaN values and then update the collection by index resetting the index to 0 when the far right is hit. This is updated from a buffer of incoming datapoints that I create to ensure all points are equidistant by adding points if there are time gaps or dropping points if time overlapped. From what I have read in the forums and samples on how SciChart ECG charts are created that is not the method used. Can anyone suggest the absolute most efficient way to create such a chart using SciChart?

  • mdutra asked 10 years ago
  • last active 10 years ago
2 votes
6k views

Hi ,

I am currently using the DataPointSelectionModifier for StackedColumnRenderableSeriesViewModel and I am having an issue trying to have a single selection that is togglable.

I am currently not AllowingMultiSelection so the default value is SelectionMode.Replace, which, in case you click on the same column, it will deselect that column and then select it again. Is there a way around this?

Best Regards.

2 votes
8k views

Hello, I am currently importing and displaying a .obj file as a ObjectModel3D object similar to the following syntax of the code provided in the AddObjectsToA3DChart.xaml example:

object:ObjectModel3D TextureSource=”{StaticResource BlackTexture}” Source=”{StaticResource KnightLowObj3DSource}” Position=”0.0625, 0.6, 0.8125″ CoordinateMode=”Relative” Scale=”0.2, 0.2, 0.2″ Rotation=”{StaticResource ObjRotationState}”

Where ObjRotationState is : object:Rotation3D x:Key=”ObjRotationState” Axis=”YAxis” Angle=”180″

The above code excerpt sets the rotation angle at 180 degrees on the Y-axis only for the ObjectModel3D object.

However, I would like to set the rotation angle for the X, Y, and Z axis of the ObjectModel3D object at the same time. Is it possible to set the rotational angle for multiple axis as described? If not, are there suggested workarounds to achieve the same behavior?

Thank you for your assistance.

2 votes
11k views

Is there any documentation besides the tutorials? Something like the one found on MSDN, with all the Properties of the SciChart elements that can be styled.

  • catalin asked 12 years ago
  • last active 8 years ago
2 votes
14k views

Hi!

I want SciChart to display always the first and last value of an axis. I created a chart wich shows volume on the y-axis and time in seconds on the y-axis. The axis are initialized in the view model with fixed axis dimensions like this:

this.TimeAxis = new NumericAxis();
this.TimeAxis.VisibleRange.SetMinMax(0, 60);
this.TimeAxis.AxisTitle = "Time [s]";
((AxisBase)this.TimeAxis).Style =        (Style)Application.Current.FindResource("DefaultSciChartAxisStyle");

this.VolumeAxis = new NumericAxis();
this.VolumeAxis.VisibleRange.SetMinMax(0, 8);
this.VolumeAxis.AxisTitle = "Volume [l]";
this.VolumeAxis.AxisAlignment = AxisAlignment.Left;
((AxisBase)this.VolumeAxis).Style = (Style)Application.Current.FindResource("DefaultSciChartAxisStyle");

How is it possible to display the first and last value of the axis as shown with red numbers in the attached example.png which are not shown by default?

Best regards,
Joerg

2 votes
12k views

Hi Guys,

I am just wondering if you can help us with the following issue.
We are trying to create a scatter char. The data series set looks like :

public IDataSeriesSet<float, float> ChartDatafloat

The problem that we are having is that there are points that are missing on the chart when it gets generated. so, we would like if you guys could test with the points that I am attaching (scattercsv.csv) and figure out why this is happening… We have seen that points around 14 and between 2000 and 2050 in the Xaxis are not displaying.

<SciChart:SciChartSurface x:Name="SciChartSurface" SciChart:ThemeManager.Theme="BrightSpark"
                              DataSet="{Binding ChartDataXfloat, Mode=TwoWay}">

        <!-- Declare RenderableSeries -->
        <SciChart:SciChartSurface.RenderableSeries>
            <SciChart:XyScatterRenderableSeries>
                <SciChart:XyScatterRenderableSeries.PointMarkerTemplate>
                    <ControlTemplate>
                        <Grid Height="7" Width="7">
                            <Viewbox>
                                <Path Data="M0,0 L10,10 M0,10 L10,0 M0,5 L10,5" Stretch="Uniform" Stroke="Blue" StrokeThickness="1"/>
                            </Viewbox>
                        </Grid>
                    </ControlTemplate>
                </SciChart:XyScatterRenderableSeries.PointMarkerTemplate>
            </SciChart:XyScatterRenderableSeries>
        </SciChart:SciChartSurface.RenderableSeries>

        <!-- Create an X Axis with Growby -->
        <SciChart:SciChartSurface.XAxis>
            <SciChart:NumericAxis VisibleRange="0,2800">
                <SciChart:NumericAxis.GrowBy>
                    <SciChart:DoubleRange Min="0.1" Max="0.1"/>
                </SciChart:NumericAxis.GrowBy>
            </SciChart:NumericAxis>
        </SciChart:SciChartSurface.XAxis>

        <!-- Create a Y Axis with Growby -->
        <SciChart:SciChartSurface.YAxis>
            <SciChart:NumericAxis>
                <SciChart:NumericAxis.GrowBy>
                    <SciChart:DoubleRange Min="0.1" Max="0.1"/>
                </SciChart:NumericAxis.GrowBy>
            </SciChart:NumericAxis>
        </SciChart:SciChartSurface.YAxis>

    </SciChart:SciChartSurface>

I am attaching as well an image that shows how the chart should looks like. I am only trying to display the blue points. So, chart number 1 displays all the points that I am attaching in the spreadsheet and chart number 2 is the one that I am trying to create with the same points and as you can see is missing some of the points.

Hope you can help us….

Thanks very much

2 votes
11k views

Hi,
I have a SciChartSurfacewith one xaxis an four yaxis and a dynamic number of series which are added at runtime.
Also I have some modifiers especially the ZoomExtentsModifier( ExecuteOn=”MouseDoubleClick” XyDirection=”XDirection”) and for each yaxis a yaxisdragmodifier.
Is it possible to double click on a single yaxis and ZoomExtends only this yaxis?

Regards Markus

2 votes
10k views

Hi SciChart Team,

Thank you all for your help and support.

I finally got the multiple symbols on the stock chart with reference to this and with this clear explanation
IAnnotation annotation = builder.newCustomAnnotation().withContent(R.layout.example_custom_annotation_view).withYAxisId(PRICES).withPosition(i, prices.getHighData().get(i)).withVerticalAnchorPoint(VerticalAnchorPoint.Bottom).build();
this.annotations.add(annotation);

The above code worked for me and hope it helps to others too who all are trying this.

Thanks,
Ghousia

2 votes
10k views

Basically I want to do something like this:
https://finviz.com/map.ashx?t=sec

It’s a hierarchical dataset, displayed visually. Is there a way to do this with SciChart?

  • kelias asked 5 years ago
  • last active 5 years ago
2 votes
10k views

Hi guys,

I’ve been trying to select data points in my heat map for the whole without success. I’ve read, re-read and re-re-read the documentation, but I can’t figure out what I’m doing wrong.

Here’s the XAML.

...

<s:SciChartSurface.RenderableSeries>
    <s:FastUniformHeatmapRenderableSeriesForMvvm
        x:Name="heatmapSeries" 
        Opacity="0.9" 
        DataSeries="{Binding UniformHeatmapDataSeries}"
        s:DataPointSelectionModifier.IncludeSeries="True" >

        <s:FastUniformHeatmapRenderableSeriesForMvvm.ColorMap>
            <s:HeatmapColorPalette Maximum="60" Minimum="6">
                <s:HeatmapColorPalette.GradientStops>
                    <GradientStop Offset="0" Color="Transparent"/>
                    <GradientStop Offset="0.1" Color="DarkBlue"/>
                    <GradientStop Offset="0.2" Color="CornflowerBlue"/>
                    <GradientStop Offset="0.4" Color="DarkGreen"/>
                    <GradientStop Offset="0.6" Color="Chartreuse"/>
                    <GradientStop Offset="0.8" Color="Yellow"/>
                    <GradientStop Offset="1" Color="Red"/>
                </s:HeatmapColorPalette.GradientStops>
            </s:HeatmapColorPalette>
        </s:FastUniformHeatmapRenderableSeriesForMvvm.ColorMap>

        <s:FastUniformHeatmapRenderableSeriesForMvvm.PointMarker>
            <s:XPointMarker Fill="Pink" Width="5" Height="5"/>
        </s:FastUniformHeatmapRenderableSeriesForMvvm.PointMarker>

        <s:FastUniformHeatmapRenderableSeriesForMvvm.SelectedPointMarker>
            <s:TrianglePointMarker Fill="White" Width="12" Height="12"/>
        </s:FastUniformHeatmapRenderableSeriesForMvvm.SelectedPointMarker>

    </s:FastUniformHeatmapRenderableSeriesForMvvm>

    ...

</s:SciChartSurface.RenderableSeries>
...

Here’s the MVVM code.

...
class SelectedPointMetadata : IPointMetadata
{
    public bool IsSelected { get; set; }

    public event PropertyChangedEventHandler PropertyChanged;
}
...

double[,] heatMap = new double[heatMapHeight + glowRadius * 2, heatMapWidth + glowRadius * 2];
double[,] glowMatrix = this.getGlowEffectMatrix(glowRadius);

SelectedPointMetadata[,] selectablePoints = new SelectedPointMetadata[heatMapHeight + glowRadius * 2, heatMapWidth + glowRadius * 2];

for (int i = 0; i < spectrogram.SpectrogramAtoms.Count; i++) {
    var atom = spectrogram.SpectrogramAtoms[i];
    int x = Math.Min((int)(atom.Frequency.Hertz / frequencyStep) + glowRadius, heatMapHeight - 1);
    int y = Math.Min((int)(atom.Time.Seconds / xStep) + glowRadius, heatMapWidth - 1);
    this.applyEffectMatrix(x, y, atom.SNR, ref heatMap, ref glowMatrix, glowRadius);

}

var xBound = heatMap.GetLength(0);
var yBound = heatMap.GetLength(1);

Random rnd = new Random();

for (var i = 0; i < xBound; i++)
{
    for (var j = 0; j < yBound; j++)
    {
        var x = rnd.Next(1, 10);

        selectablePoints[i, j] = new SelectedPointMetadata() { IsSelected = false };

        if (x == 5)
        {
            selectablePoints[i, j].IsSelected = true;
        }

    }
}

this.UniformHeatmapDataSeries = new UniformHeatmapDataSeries<double, double, double>(
    heatMap,
    (-xStep * glowRadius),
    xStep,
    (-frequencyStep * glowRadius),
    frequencyStep,
    selectablePoints
    );

...

What am I missing?

2 votes
10k views

hello

I have problems with RolloverModifier while dataseries are UnsortedXyDataSeries. If I change to (sorted)XyDataSeries everything OK. I didn’t find any information in documentation that this modifier has such restriction.
Second question about sorted series: does Append(x,y) of XyDataSeries require to be last point of x range or it can append to any place of existing range?

2 votes
6k views

Hi, I am currently working with the DataPointSelectionModifier with StackedColumnRenderableSeriesViewModel series. I currently am able to get the data point with the correct values whenever I click on a column but it seems that I am not able to change the selection fill of the column.

All I can seem able to do is changing the color of the whole series, but that is not what I am looking for.

Best Regards.

2 votes
19k views

Hi,

I am trying to create a chart with additional information, similarly as discussed in this question:
https://www.scichart.com/questions/question/correlating-metadata-with-datapoints/
It works fine for simple information, such as enums, that I can cast into a double (see also the example provided in the question mentioned above).

However it seems that there is a restriction on the generic class XyzDataSeries.
Whenever I try to use a different data types for TY and TZ

XyzDataSeries<DateTime, double, int>

I get the following exception at runtime:

SciChartSurface didn’t render, because an exception was thrown:

Message: Das Objekt des Typs "Abt.Controls.SciChart.Wpf.StoreEditor1[System.Int32]" kann nicht in Typ "System.Collections.Generic.IList1[System.Double]" umgewandelt werden.

  Stack Trace:    bei Abt.Controls.SciChart.Wpf.NetworkResolver1.Execute(ResamplingMode resamplingMode, IndexRange pointRange, Int32 viewportWidth, Boolean isFifo, Boolean isCategoryAxis, IList xColumn, IList yColumn, Nullable1 dataIsSorted, Nullable1 dataIsEvenlySpaced, Nullable1 dataIsDisplayedAs2d, IRange visibleXRange)
   bei Abt.Controls.SciChart.Model.DataSeries.XyzDataSeries`3.ToPointSeries(ResamplingMode resamplingMode, IndexRange pointRange, Int32 viewportWidth, Boolean isCategoryAxis, Nullable1 dataIsDisplayedAs2D, IRange visibleXRange, IPointResamplerFactory factory)
   bei Abt.Controls.SciChart.Wpf.MethodManager.ListStream(AxisCollection urlAvailable, IRenderableSeries lockInitialized, RenderPassInfo valuesHeader, IPointResamplerFactory addressMap, IDataSeries& nextName, IndexRange& previousValues, IPointSeries& syncObjectHandle)
   bei Abt.Controls.SciChart.Wpf.MethodManager.ListStream(ISciChartSurface urlAvailable, Size lockInitialized)
   bei Abt.Controls.SciChart.Wpf.MethodManager.RenderLoop(IRenderContext2D renderContext)
   bei Abt.Controls.SciChart.Visuals.SciChartSurface.DoDrawingLoop()

Sorry for the german. The message translates to:

The object of type [...] cannot be casted into type [...]

I’m quite confused about this. It works nicely, if I use the same data types for TY and TZ .

XyzDataSeries<DateTime, double, double>
XyzDataSeries<DateTime, int, int>

This is not what I would expect from a generic type with three types.
If the types for Y and Z values need to be of the same type, the class should rather look something like this: XyzDataSeries<TX, TYZ>.
The API documentation does not mention anything about this. It only states that the types need to be IComparables, which seems not the full truth.

This is a problem for me, because I have more complex metadata than a double, which I want to reference over the Z value.
But I don’t want to use an index of type double. I’d rather use a GUID or even add the metadata object itself as Z value.

Is this by design or is this something that could be fixed in the future?

Do you have a suggestion how to best reference point related metadata (without having to implement my own DataSeries)?

2 votes
10k views

Hello, SciChart team,
i’m trying to ZoomExtents a chart, which is in in one tab of TabControl, from another tab, but it doesn’t change visible ranges.

i wanted to attach an example project, but every time i try i get “Forbidden” popup & nothing attaches (file size is 900 KB, format – “.zip”)
here’s link for an Example
please help with this not so large but unpleasant issue,
thanks heaps,
Alexander

2 votes
8k views

I managed to spearate the legend from the SciChartSurface, however the way I did it is very hackish. I couldn’t find any documentation on how it is supposed to be done correctly.

The way I did it (Kotlin code):

val legend = SciChartLegend(context)
legendModifier = LegendModifier(legend)
legendModifier.setOrientation(Orientation.VERTICAL)
legendModifier.setLegendPosition(Gravity.START or Gravity.TOP, 0)
legendModifier.setSourceMode(SourceMode.AllVisibleSeries)
legendModifier.setShowSeriesMarkers(true)
legendModifier.setShowCheckboxes(true)


val modifierGroup = chartBuilder.newModifierGroup().build()
modifierGroup.childModifiers.add(legendModifier)
chartSurface.chartModifiers.add(modifierGroup)

if(legend.parent != null)
{
    (legend.parent as ViewGroup).removeView(legend)
}

val linearLayout = LinearLayout(context)
linearLayout.orientation = LinearLayout.VERTICAL
linearLayout.addView(legend)
linearLayout.addView(chartSurface)

I was surprised that passing the legend to LegendModifier constructor also adds it to it’s layout. So I had to manually remove it and add it to my LinearLayout. It does work, but as I said, it is a hackish way of doing it. My question is, how is it done correctly?

2 votes
14k views

Hi!

I would like to add a margin to the x-axis number so that they don’t stick on the axis anymore. See attached screenshot for detailed explanation.

Is that possible?

Best regards,
Joerg

Showing 1 - 50 of 4k results