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

<!–

Welcome to the SciChart WPF Charts Community Forums!

Please see our Question asking guidelines before posting. You can also find our WPF Charts Documentation here.
  – Thanks & regards, SciChart Team

–>

Welcome to the SciChart Community Forums!

Please note, for the month of May we are trialling a switch to Stackoverflow.com for ad-hoc support of our chart controls. Please create an account and ask questions with the Tag=SciChart on Stackoverflow.

We welcome your feedback on this move as well, contact us to voice your opinion!

0 votes
0 answers
104 views

I’m using the YAxes property of the chart to data bind to a collection of NumericAxisViewModels. Is there a way to rotate the tick labels in this scenario. I can’t define a style in XAML and then assign it to the Axis because the axis is created in scichart somewhere. All I have is the axis view model. I have a LabelProvider but it doesn’t seem to support rotation unless I access the ParentAxis. Ultimately I would like to rotate some vertical axis and not other but I might be able to live with rotating all of them.

I have tried defining a style in xaml that applies to all numeric axis but it didn’t work:

<Style TargetType="{x:Type s:DefaultTickLabel}">
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <RotateTransform Angle="-90"/>
            </Setter.Value>
        </Setter>
    </Style>

Adding a LabelProvider sort of works but seems a little hacky and doesn’t set the scale appropriately ( I have to zoom to extends to see the labels). Is this the way I am supposed to do it?

public override string FormatLabel(IComparable dataValue) {
        var style = new Style(typeof(DefaultTickLabel));
        style.Setters.Add(new Setter(DefaultTickLabel.LayoutTransformProperty, new  RotateTransform(-90.0)));
        ParentAxis.TickLabelStyle = style;
0 votes
116 views

Hi

I’m trying to use SciChart in my Xamarin Visual Studio Cross platform application. After installing the SciChart package in the Package Manager console I got the dependency reference error:

Package SciChart 5.1.0.11405 was restored using '.NETFramework, Version=v4.6.1' instead of the project target framework 'NETStandard,Version=v2.0'. This papckage may not be fully compatible with your project .

I know that .NET framework 4.6.1 is different from .NETStandard2.0.

I’ve read some articles about how to target multiple .NET versions in the same application by modifying the .csproj file, but I can’t get it work anyway.
https://medium.com/@SicknoteSteve/nuget-targeting-both-net-standard-and-the-net-framework-326a16266ca4
I’ve modified the csproj file like this

<PropertyGroup>
  <TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
  <PackageReference Include="Xamarin.Forms" Version="2.5.0.280555" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
  <PackageReference Include="SciChart" Version="5.1.0.11405" />
  <PackageReference Include="Xamarin.Forms" Version="2.5.0.280555" />
</ItemGroup>

This action removes all dependency errors, but I still can’t use the libraries.

Does anyone know how to solve this issue?

Thanks in advance!

0 votes
0 answers
116 views

Hi!

My goal is to allow the user to mark an x-axis range in the chart. For this, I use BoxAnnotation. The boxes cover the whole chart height and can only be moved/resized in horizontal direction.
The annotation is created via AnnotationCreationModifier.

The problem is that the user cannot select this range everywhere, but only within a certain interval of the x-axis. So it would be necessary to limit the drag range for the AnnotationCreationModifier and for the Annotation resize/move action. With other words, the drawn rectangles should stop following the mouse when the mouse if moved out of the allowed x-axis range.
Is this possible?

Best regards,
ChartIt

0 votes
101 views

I am binding my chart to an ObservableCollection that consists of many XYDataSeries. When I create and add the XyDataSeries, I set the SeriesName and Stroke properties. The data shows on the chart. I have the following Legend Template:

    <DataTemplate x:Key="LegendItemTemplate" DataType="s:SeriesInfo">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <CheckBox Grid.Column="0" 
                      Margin="5,0"
                      HorizontalAlignment="Left"
                      VerticalAlignment="Center"        
                      Foreground="{StaticResource BlackBrush}"
                      Content="{Binding SeriesName}"
                      IsChecked="{Binding RenderableSeries.IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                      Visibility="{Binding LegendData.ShowVisibilityCheckboxes, RelativeSource={RelativeSource AncestorType=s:SciChartLegend}, Converter={StaticResource VisibleWhenTrueConverter}}" />


            <xctk:ColorPicker Grid.Column="2"  x:Name="cpPalette" 
                              ColorMode="ColorPalette" VerticalAlignment="Center"
                              SelectedColor="{Binding RenderableSeries.Stroke, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="25" Width="40" />

        </Grid>
    </DataTemplate>

However, when I change the colour using the Colorpicker, my charts series are not updated (ie, changing colour)

0 votes
94 views

Hi

Is it possible to show an axis line like on the image?

/Flemming

0 votes
114 views

Hi

I have attached an image of a chart.

Is it possible to get the first and last date to stand directly under the tick?

/Flemming

0 votes
108 views

Hi

I have tried following your custom DeltaCalculator example:

https://www.scichart.com/documentation/v5.x/Axis%20Ticks%20-%20TickProvider%20and%20DeltaCalculator%20API.html

var axis = new NumericAxis();
axis.DeltaCalculator = new CustomNumericDeltaCalculator();

But there does not seem to be a DeltaCalculator property on the axis object?

/Flemming

0 votes
115 views

I am aware that for performance reasons that SciChart expects data to be sorted in the X direction. But is it possible to have it sorted in a descending order rather than the default ascending order?

  • muh fugen asked 1 month ago
  • last active 3 weeks ago
0 votes
92 views

I want to use a CursorModifier – but is it possible to only show the vertical line?

/Flemming

0 votes
125 views

I’m trying to create a custom overview control as shown in the example with the same name, but all I get is an empty black box. The main chart is working just fine and I have it bound (for now) to the same data series as the main chart. However the only way I can get it to show anything in the overview chart is to bind it’s x and y axes to the same as the main chart, which basically makes it a copy.

            <sc:SciChartSurface x:Name="OverviewSurface" Loaded="OnOverviewSurfaceLoaded" Grid.Row="1" Margin="10,0,0,0" RenderableSeries="{sc:SeriesBinding RenderableSeriesViewModels}" >

            <sc:SciChartSurface.XAxis>
                <sc:NumericAxis DrawMajorGridLines="False" DrawMinorGridLines="False" Visibility="Collapsed"/>
            </sc:SciChartSurface.XAxis>

            <sc:SciChartSurface.YAxis>
                <sc:NumericAxis DrawMajorGridLines="False" DrawMinorGridLines="False" Visibility="Collapsed"/>
            </sc:SciChartSurface.YAxis>
        </sc:SciChartSurface>

That code above just doesn’t work at all. The RenderableSeriesViewModels are the same as bound to the main chart which is working. I’ve tried variations, using AutoRange and and creating all new ViewModels just for the overview axes but the only way I can get it to show anything at all is to bind it to the main chart axis and then I can’t hide them without hiding them on the main chart.

0 votes
0 answers
111 views

Hi!

As I found a decent solution to my previous question for how to create a simple, single vertical line chart modifier, I deleted my previous post; I use the TooltipModifierBase and just added a line where I need it, orientating myself on how the CursorModifier works.

My problem now is, I can’t get the coordinates to show on the axis label when using “UpdateXAxesOverlay(mousePoint)”. The label shows up properly, but it just says “SciChart.Charting.Visuals.RenderableSeries.AxisInfo” on it. I assume I’m missing a binding or such somewhere, but I’ve sadly been unable to figure out where or how to get it work.

0 votes
126 views

Sir,
I have a dataseries from a music file and displaying it in realtime on the screen. The chart shows only a small portion of the waveforms and on each dispatcher timer tick (10ms) I am adjusting the visible range of the chart as shown below.

        }
       // sciChartZoom.XAxis.VisibleRangeChanged -= TimeSpanAxis_VisibleRangeChanged;

        DateTime dtmp = dtmin;
        TimeSpan drng = new TimeSpan(0, 0, VisCon.zoomRangeIn);
        TimeSpan ttmp = TimeSpan.FromSeconds(VandC.posSeconds);
        TimeSpan dtlo = ttmp.Subtract(drng);
        TimeSpan dthi = ttmp.Add(drng);

        dtmp = dtmp.AddSeconds(VandC.posSeconds);


        double posAxis = (double)sciChartFull.XAxis.GetCoordinate(ttmp);

        Thickness m = posRec.Margin;
        m.Left = posAxis - VisCon.posRectmargin1;
        posRec.Margin = m;

        sciChartZoom.XAxis.VisibleRange = new TimeSpanRange(dtlo, dthi);

        //sciChartZoom.XAxis.VisibleRangeChanged += TimeSpanAxis_VisibleRangeChanged;

    }

My problem is that the chart does not move very smooth and it uses around 50% CPU power(core i5 3.2GHz). Decreasing the timer ticks less than 10ms does not make any improvement.

I am attaching a picture of how the chart looks. The top is the zoom chart while the bottom one is always static.

Can you help please?

Regards
Julian

0 votes
0 answers
115 views

Hi, we are updating our scichart component to version 5. Now we had to change our Series Binding which is obsolete now to RenderableSeries binding.

In the most graphs it works fine but I have also graphs that uses ElementName with paths for the binding and that does not work.

I tried the following versions which all did not work, is there a different way to do it?

<!-- old scichart version which is not allowed anymore-->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       SeriesSource ="{Binding ElementName=GraphRoot, Path=Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

<!-- First try with new version which is not working because we don't use seriesBinding-->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       RenderableSeries ="{Binding ElementName=GraphRoot, Path=Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

<!-- Second try with new version which is also not working -->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       RenderableSeries ="{s:SeriesBinding ElementName=GraphRoot, Path=Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

<!-- Last try with new version which is also not working becaus without ElementName he cannot find the Series-->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       RenderableSeries ="{s:SeriesBinding Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

Please is there any idea how to solve this?

0 votes
0 answers
96 views

for HorizontalLineAnnoataion and VerticalLineAnnotation, if the LabelPlacement is set to values other than Auto or Axis, the label is still seen even the ShowLabel is set to false.

Here is the source code
Xaml

<sc:SciChartSurface.XAxis>

</sc:SciChartSurface.XAxis>
<sc:SciChartSurface.YAxis>

</sc:SciChartSurface.YAxis>

        <sc:SciChartSurface.Annotations>
            <sc:VerticalLineAnnotation VerticalAlignment="Stretch" x:Name="V1"
                                      FontSize="12"
                                      FontWeight="Bold"
                                      ShowLabel="True"
                                      Stroke="Brown"
                                      StrokeThickness="2"
                                      X1="9" LabelPlacement="Auto"
                                      Y1="4" />

            <sc:HorizontalLineAnnotation HorizontalAlignment="Stretch" x:Name="H1"
                                        FontSize="12"
                                        FontWeight="Bold"
                                        LabelPlacement="TopLeft"
                                        ShowLabel="True"
                                        Stroke="Orange"
                                        StrokeThickness="2"
                                        X1="7"
                                        Y1="2.8" />
        </sc:SciChartSurface.Annotations>
    </sc:SciChartSurface>
    <UniformGrid Rows="1" VerticalAlignment="Top" HorizontalAlignment="Right">
        <CheckBox IsChecked="{Binding ElementName=H1, Path=ShowLabel}" Foreground="White"  Margin="3">
            <CheckBox.Content>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="H1" VerticalAlignment="Center"/>
                    <ComboBox ItemsSource="{Binding Source={x:Static local:MainWindow.LabelPlacements}}" SelectedItem="{Binding ElementName=H1, Path=LabelPlacement}" />
                </StackPanel>
            </CheckBox.Content>
        </CheckBox>
        <CheckBox IsChecked="{Binding ElementName=V1, Path=ShowLabel}" Foreground="White" Margin="3">
            <CheckBox.Content>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="V1" VerticalAlignment="Center"/>
                    <ComboBox ItemsSource="{Binding Source={x:Static local:MainWindow.LabelPlacements}}" SelectedItem="{Binding ElementName=V1, Path=LabelPlacement}" />
                </StackPanel>
            </CheckBox.Content>
        </CheckBox>
    </UniformGrid>
</Grid>

And the cs
using SciChart.Charting.Visuals.Annotations;
using System;
using System.Windows;

namespace SciChartLineAnnotation
{
///

/// Interaction logic for MainWindow.xaml
///

public partial class MainWindow : Window
{
public static LabelPlacement[] LabelPlacements { get; private set; }

    static MainWindow()
    {
        Array array = System.Enum.GetValues(typeof(LabelPlacement));
        LabelPlacements = new LabelPlacement[array.Length];
        int idx = 0;
        foreach(var item in array)
        {
            LabelPlacements[idx++] = (LabelPlacement)item;
        }
    }

    public MainWindow()
    {
        InitializeComponent();
    }
}

}

0 votes
138 views

I added nearly 607 lines using code:
_verticalLineAnnotations.Add(new VerticalLineAnnotationViewModel()
{
VerticalAlignment = VerticalAlignment.Stretch,
Stroke = Utility.Utility.ConverStringToColor(item.Color.ToString()),
StrokeThickness = 2,
X1 = item.Time,
Tooltip = item.Label,

        });

However, the rendering on the chart is very slow, it takes time to get these points loaded, is there a way to make it fast???

0 votes
0 answers
112 views

Hello,

I am using Numeric Axis View Model for making Y-Axis dynamically. I want to show strings instead of number. I saw the label provider api but i don’t get how to use this Label Provider. Can anyone tell me or give me a working example of showing strings instead of number using label provider.

Thanks

0 votes
0 answers
131 views

Hello,

I have a usercontrol in which there is SciChartSurface and Modifiers and this UserControl(Name = UCSciChart) have its own ViewModel(Name = UCSciChartViewModel). Now I have Another User Control(Name = TimeChartView) in which I placed UCSciChart usercontrol 1 for single mode and 16 for multiple mode. TimeChartView has its own view model (TimeChartViewModel). Now if click on series, the style applies, but if i click outside it does not goes to old style, it is in single mode. If i click on multiple mode, then there is multiple user control and all have their own view model. But in multiple mode, if i click on series no style is applied.

I am posting my code here:

UCSciChart.xaml


<s:SciChartSurface.ChartModifier>


<s:SeriesSelectionModifier.SelectedSeriesStyle>

</s:SeriesSelectionModifier.SelectedSeriesStyle>






</s:SciChartSurface.ChartModifier>

TimeChartView.xaml

<UniformGrid.ContextMenu>

</UniformGrid.ContextMenu>

0 votes
0 answers
123 views

How performance can be improved?

0 votes
0 answers
135 views

How can i distinguish vertical line annotations?

Suppose there are 2 groups of vertical lines. I want to delete vertical lines of one group.

Thanks.

0 votes
0 answers
102 views

Hello,

I just want to get the x-axis value anywhere i click on the chart . Suppose if i click on a chart in centre, i want to get the values of this point(x-axis,y-axis). I am using the custom modifier for hit-testing to check if i click on x-axis,y-axis or on chart. Tell me what should i change in this modifier code to achieve my expected output.

Below is my Custom Modifier Code.

public class HitTestingModifier : ChartModifierBase
{
public override void OnModifierMouseDown(ModifierMouseArgs e)
{
IAxis xAxis = null;
IAxis yAxis = null;
bool isOnYAxis = false;
bool isOnXAxis = false;
bool isOnChart = IsPointWithinBounds(e.MousePoint, ModifierSurface);

        foreach (var axis in YAxes)
        {
            isOnYAxis = IsPointWithinBounds(e.MousePoint, axis);
            if (isOnYAxis)
            {
                yAxis = axis;
                break;
            }
        }

        foreach (var xaxis in XAxes)
        {
            isOnXAxis = IsPointWithinBounds(e.MousePoint, xaxis);
            if (isOnXAxis)
            {
                xAxis = xaxis;
                break;
            }
        }

        if (isOnXAxis)
        {
            MessageBox.Show("X-Axis: " + xAxis.AxisTitle);
        }

        if (isOnYAxis)
        {
            MessageBox.Show("Y-Axis: " + yAxis.AxisTitle);
        }

        base.OnModifierMouseDown(e);
    }

    public bool IsPointWithinBounds(Point point, IHitTestable element)
    {
        var tPoint = ParentSurface.RootGrid.TranslatePoint(point, element);


        bool withinBounds = (tPoint.X <= (element as FrameworkElement).ActualWidth && tPoint.X >= 0)
                            && (tPoint.Y <= (element as FrameworkElement).ActualHeight && tPoint.Y >= 0);

        return withinBounds;
    }
}
0 votes
0 answers
128 views

Hello,

I’ve created a generalized UserControl that allows the user to add any number of charts. This control also has a shared X axis that all charts in it use. In another control, any number of these UserControls can be generated. When I have three or more of these controls, the graphing slows down tremendously. Upon profiling the program, the DoDrawingLoop function uses >70% of the CPU despite drawing very little.

In essence, if I have 8 charts in one of my controls it will be quite performant. If I have 2 charts in 4 different controls, then I experience incredible slowdown in the charts. I do have RenderPriority set to low. I turned the sample rate of the NI card I’m using down to 20 hz (to virtually eliminate any external load, the individual controls can handle 10000 hz with several charts quite easily) and the issue persists. This leads me to believe it may be a synchronization issue (perhaps overloading the UI thread, etc.)

Any other insight would be much appreciated.

VS2015 diagnostic report (96mb): https://drive.google.com/open?id=1tQajTLsp8U-Ws7IxlMGkXiNd8MSEbRaI

Thanks,
Mike

0 votes
146 views

Hi Team,

As per our requirement, we need to plot chart as shown in the attachment, let us know is it achievable with SciChart and if yes, could you please help us on this.

Thanks!!
SP

  • Swapna P asked 2 months ago
  • last active 1 month ago
0 votes
0 answers
134 views

I am looking for the change the interval in Axis. Suppose I have a visible range from 1 to 10. Then SciChart Axis shows 1,2,3..10. But if i want to change its interval like i want to show 1,1.5,2,2.5,3…10. So how can i change this.

0 votes
164 views

I am stacking a number of SciChartSurfaces in a UniformGrid and using the MouseEventGroup to control modifiers. This works well in my test code for modifiers such as the CursorModifier and RolloverModifier, but when I add a VerticalSliceModifier to the ModifierGroup, it does not work as expected. Each chart gets the vertical slice cursors, but they function independently as if not part of a mouse event group. Are the VerticalSliceModifier(s) compatible with mouse groups? An image of the output is attached. Here is the data template that I’m using:

<ItemsControl.ItemTemplate>
    <DataTemplate>

      <s:SciChartSurface Margin="0,0,0,2" 
          RenderableSeries="{s:SeriesBinding RenderableSeries}"  
          Annotations="{s:AnnotationsBinding Annotations}"
          YAxes="{s:AxesBinding YAxes}"
          XAxes="{s:AxesBinding XAxes}">

        <s:SciChartSurface.ChartModifier>

          <s:ModifierGroup s:MouseManager.MouseEventGroup="{Binding MouseEventGroup}">


            <s:VerticalSliceModifier Name="sliceModifier" ReceiveHandledEvents="True">
              <s:VerticalSliceModifier.VerticalLines>
                <s:VerticalLineAnnotation Style="{StaticResource sliceStyle}" X1="500"/>
                <s:VerticalLineAnnotation Style="{StaticResource sliceStyle}" X1="2000"/>
              </s:VerticalSliceModifier.VerticalLines>
            </s:VerticalSliceModifier>

          </s:ModifierGroup>
        </s:SciChartSurface.ChartModifier>
      </s:SciChartSurface>
    </DataTemplate>
  </ItemsControl.ItemTemplate>
</ItemsControl>
0 votes
175 views

I see that there is a hit test api in SciChart. It is quite easily used if we check that a renderable series is clicked or not. But i want to use it for axis or legend modifier click. So when i click on surface i got the points as x and y point. Now i check that if a axis is clicked or legend modifier is clicked. Please help me in this.

I attached a image which shows sample code that series can be checked by IsHit but there is no such type for axis

0 votes
132 views

Hi,

I tried to remove the black borders of the chart surface but to no avail. Is there a way to remove the border and have the chart to show just the major Grid lines?

I am right now using the theme – Bright Spark.

0 votes
121 views

We have a SciChartSurface that displays data, and includes a collection of threshold lines that can be modified by the user by dragging.
To accomplish this, we are using a class that inherits from ChartModifierBase that includes an attached property for binding an IEnumerable:

public static readonly DependencyProperty ThresholdsSourceProperty =
    DependencyProperty.Register
    (
        "ThresholdsSource",
        typeof(IEnumerable),
        typeof(CustomThresholdModifier),
        new PropertyMetadata(null, OnThresholdsSourceChanged)
     );

public IEnumerable ThresholdsSource
{
    get { return (IEnumerable)GetValue(ThresholdsSourceProperty); }
    set { SetValue(ThresholdsSourceProperty, value); }
}

The property includes a callback method (OnThresholdsSourceChanged) which is used to populate the Annotations collection of the parent SciChartSurface:

private static void OnThresholdsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    var thresholdAnnotationModifier = d as CustomThresholdModifier;
    if (thresholdAnnotationModifier != null)
    {
        var newValue = e.NewValue as IEnumerable;
        if (newValue == null) return;

        thresholdAnnotationModifier.RebuildAnnotations();
    }
}

private void RebuildAnnotations()
{
    if ((ParentSurface == null) || (ThresholdsSource == null)) return;

    var annotationCollection = ParentSurface.Annotations;
    annotationCollection.Clear();

    foreach (IThresholdViewModel item in ThresholdsSource)
    {
        var threshold = new CustomHorizontalLineAnnotation{ DataContext = item };
        annotationCollection.Add(threshold);
    }
}

When this code is run, a binding exception occurs, but not until all of the code is successful. The exception:

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement
or FrameworkContentElement for target element.
BindingExpression:Path=RotationAngle; DataItem=null; target element is
‘RotateTransform’ (HashCode=28139356); target property is ‘Angle’
(type ‘Double’)

The exception is clearly thrown downstream by some WPF thread, or I’d be able to wrap a try/catch around this and have better details.

If I comment out the line that creates the CustomHorizontalLineAnnotation, no exception.
If I add a short artificial delay before the first creation of CustomHorizontalLineAnnotation, no exception.
If I set “ShowLabel” = False in the HorizontalLineAnnotation, no exception.
If I add a dummy creation of CustomHorizontalLineAnnotation in the constructor of my CustomThresholdModifier, no exception.
If I add a dummy creation of AnnotationLabel in the constructor of my CustomThresholdModifier, no exception.

In short, the root cause of the binding exception seems to be coming from the creation of an AnnotationLabel in HorizontalLineAnnotation, either through setting ShowLabel=True, or adding it to the AnnotationLabels collection of the HorizontalLineAnnotation.

Any thoughts? I’d like to use the dummy creation of AnnotationLabel in the constructor as the solution to the problem, but this feels too much like a hack, and likely wont pass muster for my team. Maybe there’s some “best practice” being violated here, in using the modifier to update the annotation on property change?

Thanks!

0 votes
0 answers
131 views

I’ve been moving a project over to using MVVM, but I’ve found the IsStaticAxis option I was using in the NumericAxis doesn’t exist in the NumericAxisViewModel. Is it not possible to make the axis static with the View Models?

0 votes
136 views

Whenever I add a new vertical line annotation to my scichartsurface, it allways spawns at the top left corner, then if I zoom in/out it then immidietly moves to the right location. Do any of you have any fix so that I dont need to zoom everytime to fix the annotation positions?

Here is a snippet of my code:

                    var line = new VerticalLineAnnotation() {
                        Stroke = Brushes.Gold,
                        StrokeThickness = 1,
                        X1 = xClicked
                    };
                    var text = new TextAnnotation() {
                        HorizontalAnchorPoint = HorizontalAnchorPoint.Center,
                        X1 = xClicked,
                        Text = input,
                        Foreground = Brushes.Black,
                        Background = Brushes.Gold,
                        BorderBrush = Brushes.Black,
                        BorderThickness = new Thickness(2),
                        CornerRadius = new CornerRadius(5)
                    };
                    ViewModel.SciChartSurface.Annotations.Add(line);
                    ViewModel.SciChartSurface.Annotations.Add(text);
0 votes
147 views

Hello,

I’ve just downloaded a trial of SciChart WPF. Now I’m trying to add a 3D graph to my VS 2017 WPF project. I’ve added references to SciChart.{Charting, Charting3D, Core, Data, Drawing, Drawing.DirectX} and I’m using the example https://www.scichart.com/example/wpf-3d-chart-example-simple-uniform-mesh-3d-chart/ .

The graph in the WPF indicates that: “3D charts are only available in the 3D or SDK editions of SciChart”. Why?

0 votes
141 views

I saw similar topic that can export HeatMapColorMap with help of BoxAnnotation. But BoxAnnotation can be placed within plot area. I want to have ColorMap outside of Plot Area, may be next to y-Axis. But it should not be obstructing the plotting area. Any idea?

0 votes
161 views

I cannot get panning to work on the x axis which is a DateTimeAxis. I am databinding the visible range to a property on my view model and the zooming works ok. Also panning on the Y-axis works.

Here is my XAML:

<s:SciChartSurface x:Name="_sciChartSurface" Grid.Row="1" Grid.ColumnSpan="2" RenderableSeries="{s:SeriesBinding PlotViewModels}">
            <s:SciChartSurface.XAxis>
                <s:DateTimeAxis AxisTitle="{Binding HorizontalTitle}" VisibleRange="{Binding HorizontalRange, Mode=TwoWay}" AutoRange="Never"
                            IsStaticAxis="True" DrawMajorBands="False" TextFormatting="dd-MMM-yyyy" SubDayTextFormatting="H:mm:ss:tt"
                            AutoTicks="True"/>
            </s:SciChartSurface.XAxis>
            <s:SciChartSurface.YAxis>
                <s:NumericAxis AxisTitle="{Binding VerticalTitle}" AxisAlignment="Left"  VisibleRange="{Binding VerticalRange}"
                           AutoRange="{Binding AutoRange}" DrawMajorBands="False"/>
            </s:SciChartSurface.YAxis>

            <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:RubberBandXyZoomModifier IsXAxisOnly="False" 
                                            ZoomExtentsY="True" 
                                            IsAnimated="True" 
                                            RubberBandFill="#55FFFFFF" RubberBandStroke="#FFFFFFFF" RubberBandStrokeDashArray="2 2">
                    </s:RubberBandXyZoomModifier>

                    <s:ZoomPanModifier ExecuteOn="MouseRightButton" ClipModeX="None" XyDirection="XYDirection" IsEnabled="True" />
                    <!-- Allow Dragging YAxis to Scale -->
                    <s:YAxisDragModifier DragMode="Scale"/>
                    <!-- Allow Dragging XAxis to Pan -->
                    <s:XAxisDragModifier DragMode="Scale" IsEnabled="True"/>

                    <s:MouseWheelZoomModifier ActionType="Zoom" XyDirection="XYDirection"/>

                    <s:ZoomExtentsModifier IsAnimated="True" ExecuteOn="MouseDoubleClick"/>
                </s:ModifierGroup>
            </s:SciChartSurface.ChartModifier>
        </s:SciChartSurface>
0 votes
146 views

Is it possible to scale Y Axis and its data together?.For example, Current Y Axis Range is (0,10) and Y values are [0,2,5,8]. Now when I scale Y axis range by 10 times (IRange.GrowBy(10,10)) ,i expect the Y values also gets scaled by 10 without modifying the actual data in model (expected result [0,20,50,80])

  • deepak b asked 2 months ago
  • last active 2 months ago
0 votes
130 views

How can I add an DataSeries with special characters like:

var newSurface = new SciChartSurface
{
Name = “Y-Test”,
XAxes = new AxisCollection(XAxisEventCollection.Where(x => x.Id == eventItem.XAxisId).ToList()),
YAxes = new AxisCollection(YAxisEventCollection.Where(y => y.Id == eventItem.YAxisId).ToList()),
RenderableSeries = new ObservableCollection(seriesCollection),
Width = Report1.EventChartWidth,
Height = Report1.EventChartHeight,
Background = ColorHelper.GetMediaBrushColor(Colors.White),
RenderSurface = new HighQualityRenderSurface()
};

0 votes
150 views

We are trying to display a very large line data set and it seems SciChartOverview would be a good way of visualizing full range of data. Let’s say we have 10 lines of millions data points each to be displayed. The idea is to display down-sampled version of these 10 lines in SciChartOverview, and display full-sampled version in the parent surface with x range matched with scroll bar range in SciChartOverview. When user moves the scroll bar or changes its range in SciChartOverview, it will reload data into the parent surface.

Is there a way to achieve above? Thanks.

  • Caleb asked 2 months ago
  • last active 2 months ago
0 votes
168 views

Hey,
I have added vertical annotationlines to my line chart in Scichart.
But when a user tries to pull at the annotation, the whole program crashes. There is no reason why the user should do this, but it has happened sometimes. Have you heard about this problem before or do you have a solution?
Andreas

0 votes
149 views

I am using a custom component based on the MultiPaneStockChart example which has the very nice overview scrollbar. I like a lot about this except for the scrolling behavior when clicked. When you click on either side of the “viewport” in the non-selected region it pans all the way to that spot. How would I go about changing this behavior so that it advances only one screen or page at a time (i.e. advances by the width or number of points that are in current XAxisVisibleRange)? In other words, if I am zoomed in on the middle of the chart so that only a portion is shown, whether I click immediately to the right of the viewport or two inches away it should scroll by the same amount. I see the SciChartScollBar exposes a SelectedRangeChanged event but I want to intercept before the range is changed. Thank you.

Best regards,
Lawson

0 votes
138 views

Dear all,

I have a set of sample data from 0 to 3000.
I have a customer request where user need to visually see some particular range of data highlighting with a vertical transparent rectangle.
For exemple I need to place on a graph a rectangle if data a between 0 to 300 and an other when sample are between 700 to 800

I have seen I can do that by coloring point within a range by using the color palet as seen in your sample, but is there a way to display rectangle and bind the width of the rectangle to the particular range ?

See picture below

regards

  • sc sc asked 2 months ago
  • last active 2 months ago
0 votes
133 views

Hi there,
I’m trying to catch a VisibleRangeChanged Event of a DateTimeAxisViewModel, but it is never called.
Strangely, it work’s with a numeric axis viewModel?!
I’m refering to the AxisBinding and Annotation Binding Example in the Examples Suite.
I added a MouseWheelZoomModifier to be able to change the VisibleRange

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

In the InitializeAxes method in SciChartMvvmBindingsViewModel two lines were added to catch the VisibleRangeChanged Event:

            var xNumAxis = new NumericAxisViewModel
            {
                AxisAlignment = AxisAlignment.Bottom,
                AxisTitle = "XAxis",
                DrawMajorBands = false,
                TextFormatting = "0.00#",
                VisibleRange = new DoubleRange(0, 10),
                BorderThickness = new Thickness(3),
                BorderBrush = new SolidColorBrush(Colors.CadetBlue)
            };
            xNumAxis.VisibleRangeChanged += xNumAxis_VisibleRangeChanged; //catch num axis event
            XAxes.Add(xNumAxis);

            var xDateTimeAxis = new DateTimeAxisViewModel
            {
                AxisAlignment = AxisAlignment.Top,
                Id = "DateTimeAxis",
                VisibleRange = new DateRange(new DateTime(2017, 1, 1), new DateTime(2017, 1, 31)),
                StyleKey = "DateTimeAxisStyle"
            };
            xDateTimeAxis.VisibleRangeChanged += xDateTime_VisibleRangeChanged; //catch date time axis event

            XAxes.Add(xDateTimeAxis);

Now, when I change the zoom level I jump into the xNumAxis_VisibleRangeChanged-method, but never in the xDateTime_VisibleRangeChanged-method.

  • Tim asked 2 months ago
  • last active 2 months ago
0 votes
192 views

Hi,

I would like to know if the SCICHART support the 3D polar plot, as shown below.

3D polar example

Many thanks
Dan

0 votes
165 views

Dear all,

I have a set of HorizontalLineAnnotation in my chart and I need to be able to hide them based on a Boolean property which is bind to through MVVM.

I first try to set the visible property to hidden or collapse, but the HorizontalLineAnnotation is still visible.

Any way to hide the annotation ?

regards

  • sc sc asked 2 months ago
  • last active 2 months ago
0 votes
172 views

Dear all,

I have a chart where I display threshold, min and max line annotation as define below :

 <s:SciChartSurface.Annotations>
                <!--Display fix average value cursor annotation-->
                <s:HorizontalLineAnnotation x:Name="_avg" HorizontalAlignment="Stretch"
                                        IsEditable="False" LabelPlacement="Axis" 
                                        LabelTextFormatting="0.00" 
                                        ShowLabel="True"
                                        Style="{DynamicResource AvgAnnotationStyle}"
                                        Y1="{Binding Average,UpdateSourceTrigger=PropertyChanged,
                                                     FallbackValue=0}"  />

                <s:HorizontalLineAnnotation x:Name="_sigmaHight" HorizontalAlignment="Stretch"
                                        LabelPlacement="Axis" 
                                        LabelTextFormatting="0.00" ShowLabel="True"
                                        Style="{DynamicResource SigmaAnnotationStyle}"
                                        Y1="{Binding SigmaHigh,
                                            UpdateSourceTrigger=PropertyChanged,
                                            FallbackValue=0}" />

                <s:HorizontalLineAnnotation x:Name="_sigmaLow" HorizontalAlignment="Stretch"
                                        LabelPlacement="Axis"
                                        LabelTextFormatting="0.00" ShowLabel="True"
                                        Style="{DynamicResource SigmaAnnotationStyle}"
                                        Y1="{Binding SigmaLow,
                                            UpdateSourceTrigger=PropertyChanged,
                                            FallbackValue=0}" />

                <s:HorizontalLineAnnotation x:Name="_threshold" HorizontalAlignment="Stretch"
                                        LabelPlacement="Axis" 
                                        LabelTextFormatting="0.00" ShowLabel="True"
                                        Style="{DynamicResource ThresholdAnnotationStyle}"
                                        Y1="{Binding LiveThreshold,
                                            UpdateSourceTrigger=PropertyChanged,
                                            FallbackValue=0}" />

            </s:SciChartSurface.Annotations>

These works really nicely when I display my chart with Line series.

Then I am using the same component to display my data series as an Histogram with label as defined in your histogram sample.
But the issue I have is that labels for Histogram in your sample show the creation of those dynamically by creating for each bar a TextAnnotation .

Due to that when I change my graph type and try to display the labels, while I have already some annotation define in my XAML for the chart, my histogram labels are not displayed.

If I remove completely the annotation section of my chart then histogram labels gets display but I cannot have anymore my Horizontal line threshold at same time.

What is the best way to get a combination of both ?

Thanks for help
regards

  • sc sc asked 3 months ago
  • last active 2 months ago
0 votes
160 views

Running off of visual studio 2017. Slightly changed one of the line examples. Here is my source code.

// *************************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2017. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// LineChartExampleView.xaml.cs is part of the SCICHART® Examples. Permission is hereby granted
// to modify, create derivative works, distribute and publish any part of this source
// code whether for commercial, private or personal use.
//
// The SCICHART® examples are distributed in the hope that they will be useful, but
// without any warranty. It is provided “AS IS” without warranty of any kind, either
// expressed or implied.
// *************************************************************************************
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using SciChart.Charting.Model.DataSeries;
using SciChart.Charting.Visuals.RenderableSeries;
using SciChart.Data.Model;
using SciChart.Examples.ExternalDependencies.Data;
using SciChart.Charting;

namespace SciChart.Examples.Examples.CreateSimpleChart
{
public partial class LineChartExampleView : UserControl
{
public LineChartExampleView()
{
InitializeComponent();

    }

    private void LineChartExampleView_OnLoaded(object sender, RoutedEventArgs e)
    {            
        // Create a DataSeries of type X=double, Y=double
        var dataSeries = new XyDataSeries<double, double>();

        lineRenderSeries.DataSeries = dataSeries;

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

        // Append data to series. SciChart automatically redraws
        ThemeManager.SetTheme(this, "Chrome");
        dataSeries.Append(data.XData, data.YData);

        sciChart.ZoomExtents();
    }

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        Clipboard.SetImage(this.sciChart.ExportToBitmapSource());
    }
}

}

And the xaml

<UserControl.Resources>
    <ResourceDictionary>
    </ResourceDictionary>
</UserControl.Resources>

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>

    <!--  The SciChartInteractionToolbar adds zoom, pan, zoom extents and rotate functionality  -->
    <!--  to the chart and is included for example purposes.  -->
    <!--  If you wish to know how to zoom and pan a chart then do a search for Zoom Pan in the Examples suite!  -->
    <Button Foreground="AntiqueWhite"  Visibility="Visible" Click="Button_Click" MinWidth="100" MinHeight="40">COPY</Button>



    <!--  Create the chart surface  -->
    <s:SciChartSurface Name="sciChart"
                       Grid.Column="1">

        <!--  Declare RenderableSeries  -->
        <s:SciChartSurface.RenderableSeries>
            <s:FastLineRenderableSeries x:Name="lineRenderSeries"
                                        Stroke="#FF99EE99"
                                        StrokeThickness="2"/>
        </s:SciChartSurface.RenderableSeries>

        <!--  Create an X Axis with Growby  -->
        <s:SciChartSurface.XAxis>
            <s:NumericAxis DrawMajorBands="True"
                           FlipCoordinates="True"
                           GrowBy="0.1, 0.1"
                           ScientificNotation="None"
                           TextFormatting="#.############" />
        </s:SciChartSurface.XAxis>

        <!--  Create a Y Axis with Growby. Optional bands give a cool look and feel for minimal performance impact  -->
        <s:SciChartSurface.YAxis>
            <s:NumericAxis DrawMajorBands="True" GrowBy="0.5, 0.5" />
        </s:SciChartSurface.YAxis>

    </s:SciChartSurface>
</Grid>

All I did was remove the toolbar and a dd a button that copied the image to the clipboard. Yet Somehow the result of what you see while running and what you get from the clipboard are not the same. The lower half of the image you get by rendering to memory is clearly darker. I tried uploading them but could not.

0 votes
250 views

I want to highlight every start of hour, day, week in different colors.
I think I need to make style for DefaultTickLabel, using Style.Triggers and DefaultTickLabelViewModel. But I don’t know how to do it.
If DefaultTickLabelViewModel would have a DateTime property then it would be easier. But now I have no idea how to do this.

0 votes
153 views

In examples I often see.

s:CursorModifier.TooltipTemplate="{StaticResource CursorTooltipTemplate2}"

s:RolloverModifier.TooltipContainerStyle="{StaticResource TooltipStyle2}"
s:RolloverModifier.TooltipTemplate="{StaticResource RolloverTooltipTemplate2}"

s:TooltipModifier.TooltipContainerStyle="{StaticResource TooltipStyle2}"
s:TooltipModifier.TooltipTemplate="{StaticResource TooltipTemplate2}"

s:VerticalSliceModifier.TooltipContainerStyle="{StaticResource TooltipStyle2}"
s:VerticalSliceModifier.TooltipTemplate="{StaticResource VerticalSliceTooltipTemplate2}"

Why can’t I use TooltipContainerStyle attached property with CursorModifier?

0 votes
186 views

Hi,
I’m developing with WPF and trying to get a good perfomance with it.!
enter image description here

As you can see, my component has 4 graphics running at a time, but i need to run my component several times (18-20 instances).
By now if i want it to run at a decent speed I have to run just 1 instance( my computer has 4 cores ). The problem is that when I run it at a colleague’s computer which has 12 cores, it makes impossible to run even with 10 instances.
The question is, how many graphics per core can Scichart support without getting slow?

Thank you.

0 votes
174 views

Dear all,

I have a chart which is supposed to display the data as xyScatter points. For that I am building the series as below :

return new XyScatterRenderableSeriesViewModel
            {
                DataSeries = xyDataSeries,
                PointMarker = new EllipsePointMarker()
                {
                    Width = 2,
                    Height = 2,
                    Fill = new SolidColorBrush(Colors.Blue).Color
                },

            };

When doins this I am suppoyed to see a nice circle point to be display at each measure but instead I have lines when I zoom in .
See picture attached

Any idea why ?

  • sc sc asked 3 months ago
  • last active 2 months ago
0 votes
167 views

Dear all,

I need to perfomed a binding of the VisibleRange.Min and .Max to a text box in order to allow the possibility to change manually the visible range.

For that I need to get the Min and Max value of the VisibleRange axis property into double variable.
I was trying to use the VisibleRange.AsDouble() but seems to not working

Thnaks for help on how to do

regards

  • sc sc asked 3 months ago
  • last active 3 months ago
0 votes
167 views

This question is more about WPF, but I can’t find any information how to do it.
I need to compute some information and write it in TextBlock.

Ideally If I could wrap OhlcSeriesInfo into my wrapper class. Then set this wrapper as DataContext and binding to its properties.
I rised this question on stack overflow:
https://stackoverflow.com/questions/48916897/how-to-make-wrapper-for-datatype-datacontext-in-wpf
but still no one helped me.
I don’t know why this is so hard question. Hope here I’ll find answer.

0 votes
169 views

Dear all,

I need to display an histogram on a graph, but by my understanding an histogram is nothing else that Column representation of data.
So far in my graph I have create ColumnRenderableSeriesViewModel same as in the Histogram sample.

Then by browsing the object I have seen their are also an HistoBarRenderableSeriesViewModel and a FastHistoBarRenderableSeriesViewModel

What is the real difference between those and which do you suggest to use ?

What the Fast prefix means and affect to ?

thanks for clarification
regards

  • sc sc asked 3 months ago
  • last active 3 months ago
Showing 1 - 50 of 2k results