SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

0 votes
47k views

I want to add annotations programmatically. I need to add line with arrow and textbox at Y1 and X1 of a line. It creates pointed annotation.

3 votes
19k 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 8 years ago
  • last active 5 years ago
3 votes
17k 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 8 years ago
  • last active 3 years ago
0 votes
17k views

I have the following code and want to move this portion to code-behind but have problems understanding how I can programmatically set the properties in Style:

<s:SciChartSurface.ChartModifier>

                <!-- Provides Interactivity -->
                <s:RubberBandXyZoomModifier IsAnimated = "False" IsXAxisOnly = "True" ExecuteOn = "MouseRightButton"/>
                <s:ZoomPanModifier XyDirection="XYDirection" ClipModeX = "ClipAtExtents" ExecuteOn ="MouseLeftButton" />
                <s:MouseWheelZoomModifier XyDirection = "XYDirection"/>
                <s:ZoomExtentsModifier IsAnimated = "False" ExecuteOn = "MouseDoubleClick" />
                <s:XAxisDragModifier  DragMode = "Scale"/>
                <s:CursorModifier SourceMode="AllSeries"  UseInterpolation="True"/>

                <!-- Provides selection of series and custom styling to the selected series -->
                <s:SeriesSelectionModifier ReceiveHandledEvents="True" SelectionChanged="SeriesSelectionModifier_OnSelectionChanged">
                    <s:SeriesSelectionModifier.SelectedSeriesStyle>
                        <Style TargetType="s:BaseRenderableSeries">
                            <Setter Property="SeriesColor" Value="White"/>
                            <Setter Property="PointMarkerTemplate">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <s:EllipsePointMarker Fill="#FF00DC" Stroke="White" Width="7" Height="7"/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </s:SeriesSelectionModifier.SelectedSeriesStyle>
                </s:SeriesSelectionModifier>

                <!-- Provides a data source for the legend control -->
                <s:LegendModifier ShowLegend="True" GetLegendDataFor="SelectedSeries" Margin="10"/>

            </s:ModifierGroup>
        </s:SciChartSurface.ChartModifier>

Particularly the SeriesSelectionModifier and its property setters seem difficult for me to implement in code-behind. Can you please provide some sample code how I would actually implement the SeriesSelectionModifier with above Property Setters above in C# code rather than in XAML?

Thanks

  • bbmat asked 6 years ago
  • last active 6 years ago
1 vote
17k views

I currently catch the MouseLeftButtonDown event like this:

<s:SciChartSurface 
                    s:SciChartGroup.VerticalChartGroup="SharedChartGroup"
                    MouseLeftButtonDown="UIElement_OnMouseLeftButtonDown"
                    SeriesSource="{Binding ChartSeriesViewModels}">

But the event only fires when I click outside the chart area in an empty area (where the title goes). How can I modify the code so that the event fires when I click anywhere on the surface on the chart?

Also, how can I determine on which chartsurface the mouse click occurred?

  • bbmat asked 6 years ago
  • last active 6 years ago
4 votes
16k 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 7 years ago
  • last active 4 years ago
4 votes
16k 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 9 years ago
  • last active 7 years ago
0 votes
15k views

When displaying a graph in a chart, I would like to set my own range and tickmark values. So when setting a range from -0.15 to 0.65 with the majortickmark set to 0.1, I would like to see Yvalues of 0.65, 0.55, 0.45, 0.35 till -0.15.
When using it now, it will move the axis to display nice round numbers
(see green graph in the attachment).
How can I do this?

Thanks,
Egbert

1 vote
15k views

I looked at the Multi-pane stock charts example and fail to understand how I can have the height of my panes change dynamically during runtime as function of updated window size (SizeChanged event) or when adjusting the number panes in the chartgroup? Problem with the below code is that when I resize the window only the first pane in chartgroup is changed not any of the other panes. What am I missing? Do I need to also bind the SciChartSurface.Height within the ItemTemplate to Height for each individual pane height? (I commented out the Height property binding in SciChartSurface. Would I need that?). Either way the panes do not resize when the whole window resizes. I made sure the events all fire and “ChartGroupHeight” is properly updated each time the window is resized.

I implemented the following in my view:

<i:Interaction.Triggers>
    <i:EventTrigger EventName="SizeChanged">
        <mvvm:EventToCommand 
            Command="{Binding UserControlResizedCommand, Mode=OneWay}"
            EventArgsConverterParameter="{Binding ElementName=LayoutRoot}"
            PassEventArgsToCommand="True" />
    </i:EventTrigger>
</i:Interaction.Triggers>

<UserControl.Resources>

    <!-- This allows setting the Height of a pane from a viewmodel -->
    <Style x:Key="ChartPaneStyle" TargetType="s:SciChartGroupPane">
        <Setter Property="Height" Value="{Binding ChartGroupHeight, Mode=TwoWay}"/>
    </Style>

    <!-- A number of converters which change parameters of charts based on the IsFirstChartPane property -->
    <resources:BoolToValueConverter x:Key="MinorsPerMajorConverter" TrueValue="4" FalseValue="2"/>
    <resources:BoolToValueConverter x:Key="MaxAutoTicksConverter" TrueValue="8" FalseValue="4"/>
    <resources:BoolToValueConverter x:Key="GrowByConverter" >
    <resources:BoolToValueConverter.TrueValue>
        <s:DoubleRange Min="0.02" Max="0.02"/>
    </resources:BoolToValueConverter.TrueValue>
    <resources:BoolToValueConverter.FalseValue>
        <s:DoubleRange Min="0.02" Max="0.02"/>
    </resources:BoolToValueConverter.FalseValue>
    </resources:BoolToValueConverter>

</UserControl.Resources>

<Grid>

    <Grid.RowDefinitions>
        <RowDefinition Height="32" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <StackPanel Grid.Row="0" Orientation="Horizontal" Background="Black">
        <TextBlock Text="Dataseries Type:" Margin="5,0" VerticalAlignment="Center" FontSize="12" Foreground="White"/>
        <ComboBox x:Name="ComboBox_ChooseSeriesType" MinWidth="140" Margin="5,3" VerticalContentAlignment="Center"/>
        <TextBlock Text="Theme:" Margin="5,0" VerticalAlignment="Center" FontSize="12" Foreground="White"/>
        <ComboBox x:Name="ComboBox_ChooseTheme" MinWidth="140" Margin="5,3" VerticalContentAlignment="Center"/>
    </StackPanel>

    <s:SciChartGroup
        Grid.Row="1" 
        ItemsSource="{Binding ChartPaneViewModels}"
        s:ThemeManager.Theme="{Binding ElementName=ComboBox_ChooseTheme, Path=SelectedItem}"
        ItemContainerStyle="{StaticResource ChartPaneStyle}">

        <s:SciChartGroup.ItemTemplate>

            <DataTemplate>

                <s:SciChartSurface
                    s:SciChartGroup.VerticalChartGroup="SharedChartGroup"
                    SeriesSource="{Binding ChartSeriesViewModels}">
                    <!--Height = "{Binding Height}">-->

                    <s:SciChartSurface.XAxis>
                        <s:DateTimeAxis Visibility="Visible" 
                                        LabelProvider="{Binding XAxisFormatting}" 
                                        VisibleRange="{Binding ParentViewModel.XVisibleRange, Mode=TwoWay}"
                                        GrowBy="0.02, 0.02"/>
                    </s:SciChartSurface.XAxis>

                    <s:SciChartSurface.YAxis>
                        <s:NumericAxis AxisAlignment="Right"
                                       Visibility="Visible" 
                                       TextFormatting="{Binding YAxisTextFormatting}" 
                                       GrowBy="0.02, 0.02" 
                                       AutoRange="Always"/>
                    </s:SciChartSurface.YAxis>

                    <s:SciChartSurface.ChartModifier>
                        <s:ModifierGroup s:MouseEventGroup="SharedMouseGroup">

                            <!-- Provides Interactivity -->
                            <s:RubberBandXyZoomModifier IsAnimated = "False" IsXAxisOnly = "True" ExecuteOn = "MouseRightButton"/>
                            <s:ZoomPanModifier XyDirection="XYDirection" ClipModeX = "ClipAtExtents" ExecuteOn ="MouseLeftButton" />
                            <s:MouseWheelZoomModifier XyDirection = "XYDirection"/>
                            <s:ZoomExtentsModifier IsAnimated = "False" ExecuteOn = "MouseDoubleClick" />
                            <s:XAxisDragModifier  DragMode = "Scale"/>
                            <s:CursorModifier SourceMode="AllSeries"  UseInterpolation="True"/>
                            <s:LegendModifier ShowLegend="True" LegendPlacement ="Inside" GetLegendDataFor="AllSeries" Margin="10"/>

                            <!-- Provides selection of series and custom styling to the selected series -->
                            <!--<s:SeriesSelectionModifier ReceiveHandledEvents="True">
                                <s:SeriesSelectionModifier.SelectedSeriesStyle>
                                    <Style TargetType="s:BaseRenderableSeries">
                                        <Setter Property="SeriesColor" Value="White"/>
                                        <Setter Property="PointMarkerTemplate">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <s:EllipsePointMarker Fill="#FF00DC" Stroke="White" Width="7" Height="7"/>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </s:SeriesSelectionModifier.SelectedSeriesStyle>
                            </s:SeriesSelectionModifier>-->

                            <!-- Provides a data source for the legend control -->


                        </s:ModifierGroup>
                    </s:SciChartSurface.ChartModifier>

                </s:SciChartSurface>












            </DataTemplate>
        </s:SciChartGroup.ItemTemplate>
    </s:SciChartGroup>

</Grid>
  • bbmat asked 6 years ago
  • last active 6 years ago
0 votes
15k views

On my x axis, how can I keep from showing duplicate ticks?
On my y axis, how do I right justify all my values?

1 vote
15k views

I’m using the latest version of the chart. when I run everything works fine, but when I open a XAML file with a chart the error window has:

The name “ZoomPanModifier” does not exist in the namespace “clr-namespace:Abt.Controls.SciChart;assembly=Abt.Controls.SciChart.Wpf”

And I get one of these for each control such as ZoomPanModifier, TextAnnotation, SeriesSelectionModifier etc…

How do I fix this issue?

  • kelias asked 8 years ago
  • last active 6 years ago
4 votes
15k 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

0 votes
15k views

Hi,
I have a very strange problem. When starting my application with referenced SciChart DLL in “Release” mode all works fine.

If I start in DEBUG (Any CPU) mode, I get an error when loading the DLL’s and the application crashes:
“‘SeverVisual.exe’ (Managed (v4.0.30319)): Loaded ‘p:\Projects_ITS\project_sever\SeverVisual\bin\Debug\Abt.Controls.SciChart.Wpf.dll’
First-chance exception at 0x7550b9bc in SeverVisual.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x00148e74..
‘SeverVisual.exe’ (Managed (v4.0.30319)): Loaded ‘Abt.Controls.SciChart.Wpf&’
First-chance exception at 0x7550b9bc in SeverVisual.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x0014ab60..”

In Debugx86 the error message also appears in the output window, but the application can start.

Thanks for help!

3 votes
14k 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 8 years ago
  • last active 5 years ago
0 votes
14k views

Hey super helpful and awesome SciCharts gurus,
I’m trying to create a graph that has usable data in a specific range, say 80-100, and I’m wondering if there is a way to lock the y axis range absolutely? This would override any kind of updating that ZoomPan or other modifiers might try to do.

Thanks!
Ryan

2 votes
14k views

Hi I’m just wondering if there is anyway to force Y values to show up on the chart for all data points like a Histogram. I’ve attached screenshots to show what I would like the final screen to look like (ChartTest) so you have an idea. Hoping there is a way to force rollover to always show, or maybe have axis markers on the bottom that can display the y value at each x point. Hopefully you understand what I’m trying to achieve. Thanks.

  • Kohins asked 8 years ago
  • last active 4 years ago
0 votes
13k views

I am creating custom controls and when I inherit from any annotation class (not AnnotationBase), public override void OnApplyTemplate() is called but any this.Template.FindName always returns null. If I inherit directly from ContentControl everything works correctly. I have tried inheriting from CustomAnnotation, BoxAnnotation, AnchorPointAnnotation and several others, all give the same result. I have checked the annotation classes and they all eventually inherit from ContentControl.

0 votes
13k views

Hi all,
I want to capture the XY coordinate related to XY axis of my scichartsurface after a MouseLeftButtonDown. At first I try this:
Point mousePoint = e.GetPosition(((SciChartSurface)sender));
but the coordinates are in pixel? instead I want my xy that are double…

Then I try this code from an example:

Point mousePoint = e.GetPosition(((SciChartSurface)sender).GridLinesPanel as UIElement);
var hitTest = ((SciChartSurface)sender).RenderableSeries[0].HitTest(mousePoint);

now hitTest.XValue and hitTest.YValue are the correct data of the nearest point, but I want the exactly coordinates of the point where I clicked, not the nearest. It is possible? How can I do?
Thanks for reply

1 vote
13k views

I am using the MVVM pattern.

I trying to manage the number of YAxes in my chart in a dynamic manner by binding the YAxes in the chart to a collection so that each time I add a new line series that line series gets its own axis.

When I do this I am getting a null reference expection.
If I hard code the YAxes or YAxis my chart loads.

Here is the xaml:

<SciChart:SciChartSurface x:Name="historicalChart" 
    RenderableSeries="{Binding HistoricalRenderableSeries, Mode=TwoWay}"
    YAxes="{Binding ChartYAxes, Mode=TwoWay}"
    SciChart:ThemeManager.Theme="ExpressionLight">
   ...
</s:SciChartSurface>

Here is the ViewModel

I tried both an ObservableCollection and a AxisCollection in my view model.

private ObservableCollection<NumericAxis> _chartYAxes = new ObservableCollection<NumericAxis>();
public ObservableCollection<NumericAxis> ChartYAxes
{
  get { return _chartYAxes; }
  set
  {
    _chartYAxes = value;
    NotifyPropertyChanged("ChartYAxes");
  }
}

private AxisCollection _chartYAxes = new AxisCollection();
public AxisCollection ChartYAxes
{
  get { return _chartYAxes; }
  set
  {
    _chartYAxes = value;
    NotifyPropertyChanged("ChartYAxes");
  }
}

Can anyone suggest a way to manage a variable number of YAxes in a chart?

  • sdemooy asked 9 years ago
  • last active 6 years ago
1 vote
13k views

Hi guys!

I have a bit of a challenge with annotations. I am running an mvvm application in which you can create annotations dynamically. I can’t seem to get a grip on how to manage these in a good way. My current “workaround” is to handle onAnnotationCreated and use that to add an object to my viewmodel. But then, as my underlying data changes the chart gets redrawn so I need to handle a load event on the scichart and then redraw them based on the information in my view model. Any thoughts on a better way to solve this?

However now the story gets even more interesting. I need to give my users the option of changing color, stroke and such on these annotations. How could I do this? And then how would I manage to keep my viewmodel updated with these changes?

0 votes
13k views

How to change background color of rendersurface?)

Thanks!

  • butek asked 8 years ago
  • last active 4 years ago
3 votes
13k 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

1 vote
13k views

I want YAxis Auto Scale less than the value max 10% and greater value min 10%, how?

  • kingsoff asked 8 years ago
  • last active 6 years ago
1 vote
13k views

how can i apply styling for legend in legend modifier? i want to apply the following style

<Style x:Key="LegendStyle" TargetType="s:LegendModifier">
        <Setter Property="ContentTemplate">
            <Setter.Value>        
                <DataTemplate>
            <s:SciChartLegend  x:Name="legendControl"  Margin="2,2" Orientation="Horizontal"  Background="Transparent" BorderThickness="0" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                Visibility="{Binding IsLegendVisible,Converter={StaticResource  BoolToVisibilityConverter}}" 
                                LegendData="{Binding LegendData,  ElementName=legendModifier,Mode=OneWay}">

                <s:SciChartLegend.Resources>
                    <SciChart:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
                </s:SciChartLegend.Resources>
                <s:SciChartLegend.ItemTemplate>
                    <DataTemplate DataType="SciChart:XyzSeriesInfo">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Rectangle Grid.Column="0"
                                                VerticalAlignment="Center"
                                                Stretch="Fill"
                                                Width="10"

                                                StrokeThickness="10"
                                                Stroke="{Binding SeriesColor,
                                                Converter={StaticResource ColorToBrushConverter}}" />
                            <TextBlock Grid.Column="1" Foreground="Black" 
                                                Margin="2,0,15,0"
                                                HorizontalAlignment="Center"
                                                Text="{Binding SeriesName}" FontWeight="Normal"/>
                        </Grid>
                    </DataTemplate>
                </s:SciChartLegend.ItemTemplate>
            </s:SciChartLegend>
        </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  • Raghupathy asked 7 years ago
  • last active 7 years ago
1 vote
13k views

I’m new to SciChart and I’m trying to play with stockcharts now. In the file ‘SciChart Class Library.chm’ in some places description is missing for example in DataSeries.Append Method I see [Missing documentation for “M:Abt.Controls.SciChart.DataSeries2.Append(0,`1[])”].

This is slows the progress to get clear understanding how things works. Is there any full description of the library, maybe I’m missing something?

  • ivankostin asked 8 years ago
  • last active 4 years ago
0 votes
13k views

My problem is that I’m setting VisibleRange of the DateTimeAxis dynamicaly. Can i use staticly declared GrowBy property to add offsets to current Min and Max values?

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

0 votes
12k views

I want to implement a PopUpWindowAction and InteractionRequestTrigger via the Micrsoft PRISM Libray:
But it starts with basic problems:
I’m not able to create a correct invokeCommandAction, the RaisItemSelection method gets never executed?

Xaml:

<s:SciChartSurface>
  <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseDoubleClick">
                    <i:InvokeCommandAction Command="{Binding MouseDoubleClickCommand}" CommandParameter="{}" />
                </i:EventTrigger>
    </i:Interaction.Triggers>
</<s:SciChartSurface>

xaml.cs:

MouseDoubleClickCommand = new DelegateCommand<object>(RaiseItemSelection);
 private void RaiseItemSelection(object obj)
        {
        }
3 votes
12k 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

1 vote
12k views

Hello,

I am evaluating the possibility to use SciChart for our corporate project, and now trying to create a series using data binding, strict MVVM (no code in code behind). The data we have are provided as an ObservableCollection, and the series would need to use the property “SomeKey” for X-Axis value, and the property “SomeValue” for the Y-Axis. Is it possible to do this, and if yes, then how?

Best regards
Petr Osipov
Rohde & Schwarz

3 votes
12k 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
12k 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

0 votes
12k views

I’m using a number of modifiers to allow the user to pan and zoom, including a ZoomExtentsModifier so the user can double-click to “reset” the chart back to its initial layout. However it seems to ignore the VisibleRanges I’ve got on the axes. How can I get it to honour these?

Here is an example of one of my axes, just in case one of its attributes is preventing the modifier from working properly:-

<SciChart:NumericAxis AxisAlignment="Left" AutoRange="False" DrawMajorTicks="False" DrawMinorTicks="False" VisibleRange="{Binding YAxisRange, Mode=TwoWay}" DrawMinorGridLines="False" DrawLabels="True" AxisTitle="Foo"/>

(I seem to remember being told a while ago that the VisibleRange binding must be TwoWay otherwise it won’t work. Is that correct?)

Thanks in advance
Andy

  • andyste1 asked 8 years ago
  • last active 1 year ago
1 vote
12k views

Hi,

The new annotations looks great.
How can I add 2 vertical line annotations by code (mvvm)?
When on screen, how can I get the values of the two lines back in the viewmodel so I can display/calculate x and Y values of the chart?

Thanks…

1 vote
12k views

Hi,

I need to implement a chart that looks pretty much like the attached one. The chart has the following requirements:
– the x-axis position is always at value 0.0
– the length (in pixel) the x-axis must always have the same length as the positive part of the y-axis
– the displayed data range on the y-axis must always be twice as much as on the x-axis (e.g 0-5 on x-axis means 0-10 on y-axis). So if the charts updates the visible range on the y-axis, the x-axis range must be updates as well and and vice versa.

I really don’t know if that’s even possible with Scichart? If yes could you please give me some initial help how to get this done?

Thx
Joerg

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

0 votes
12k views

Hi,
I’ve created a custom annotation and have set it’s .IsEditable property in code so the user can reposition it. I have two issues:
1.I want the user to be able to resize the “PPZLine” in the X direction, but I can’t figure out how to get the anchor points to appear.

  1. I want to be able to see the chart data that the annotation is covering. I tried setting AnnotationCanvas = BelowChart, but then I couldn’t move the annotation or get any annotation mouse handlers to trigger.

Here’s the annoation’s xaml:

<s:CustomAnnotation x:Class="CinchV2DemoWPF.Views.SciChart.PPZView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:CinchV2="clr-namespace:Cinch;assembly=Cinch.WPF"
             xmlns:meffed="clr-namespace:MEFedMVVM.ViewModelLocator;assembly=MEFedMVVM.WPF"
             xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:s="clr-namespace:Abt.Controls.SciChart;assembly=Abt.Controls.SciChart.Wpf" 
             meffed:ViewModelLocator.ViewModel="PPZViewModel"

             X1="{Binding X1}"
             Y1="{Binding Y1}"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
<Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

    <!-- price line must use margin 0,0 or obj will not be visible-->
        <s:BoxAnnotation Name="LongEntryMarker" Grid.Row="0"
                       Width="20"    Height="10"  Background="DarkViolet" Margin="0,0"  VerticalAlignment="Top" 
                         HorizontalAlignment="Right"
                         >
        </s:BoxAnnotation>

        <!-- long marker line MouseRightButtonDown="LongEntryMarker_OnMouseRightButtonDown"-->
        <s:BoxAnnotation Name="PPZLine" Grid.Row="1"
                       Width="150"    Height="5"  Background="red" Margin="0,0"  VerticalAlignment="Top" 
                         >
        </s:BoxAnnotation>
</Grid>
</s:CustomAnnotation>
  • tecman234 asked 8 years ago
  • last active 6 years ago
3 votes
12k 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

0 votes
12k views

Can you please provide some examples of how to alter the formatting of a DateTimeAxis axis. I’d like to show the date and the time component that also supports localization based on the user regional settings.

0 votes
12k views

Hi,

i have a problem with chart redrawing after the appending of new data. If i understand it correctly, charts update automatically after calling Append. However, if i add single pairs or arrays of data, that does not happen.

To reproduce this, just alter the SciChart WPF example. In LineChartExampleView.xaml.cs, i replaced

var data = DataManager.Instance.GetFourierSeries(1.0, 0.1);

// Append data to series. SciChart automatically redraws
series.Append(data.XData, data.YData);

with

double[] x = new double[100];
double[] y = new double[100];

for (int i = 0; i < 100; i++)
{
    x[i] = i;
    y[i] = i;
}

series.Append(x, y);  

The result after starting the demo and clicking “Create a basic chart” -> “Line chart” can be seen in attachment 1. It requires a left doubleclick to make all the data visible (attachment 2). Why does the chart not rescale and redraw automatically?

Thank you,

Robin

2 votes
12k views

Hi,

Annotation chart sample Drag Horizontal Threshold allow us to draw custom controllable color for the data series. The same way I need to draw the chart surface background color. I couldn’t find the appropriate API to do this job. Could you advise how to draw surface background color.

Update:

Attached the graph image, I like to draw the grey and white backgrounds based on horizontal and vertical line positions.

Thanks.

1 vote
12k views

I’ve created an application with MVVM in mind and managed to create a simple, working graph with SciChart that displays the data needed.
I’ve also seen some features (https://www.scichart.com/customer-case-study-blueshift-one-system/) which we’ll be planning on implementing, designing it to fit our own needs of course.

I’m wondering if there are some limitations (and perhaps improvements in later releases), that we could keep in mind while continuing to plan and develop our application with SciChart and MVVM?

0 votes
12k views

Hey there!

How do I set the interval between grid lines to be a fixed value?

For example, my xAxis is a DateTimeAxis and I want a grid line drawn at one hour intervals, regardless of zooming.

Same goes for my yAxis (NumericAxis)

Thanks

1 vote
12k views

Needing a 3D Plot for only around 100 points.

There is a SciChart3D nuget available for download but without any example.

Has anyone used it and can provide an example to me.

thx

4 votes
12k 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 9 years ago
  • last active 6 years ago
1 vote
12k views

Do you have any demo or code to show how to make multiple line charts of time series to share same X axis(which is time).

I also tried the demo of Sync Multi Chart Mouse. But, there is a gap between two charts when I move my mouse, which looks not nice.

3 votes
11k 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.

1 vote
11k views

I have a chart that I would like the Y Axis to start at zero but the max size automatically since I don’t know the extent of the values that will be added. How do I do this?

  • kelias asked 8 years ago
  • last active 6 years ago
Showing 1 - 50 of 3k results