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

0 votes
11k views

Hi Andrew,

I have a problem with the Scrollbar : when i Choosed “ZoomX” after this i pressed the button ” Zoom” the Scrollbar run but the curve removed like “first” picture and “second”,
i think that the problem in the scrollbar because in my application the scrollbar moves from right to left and in your application like picture”Scichart” the Scrollbar moves from left to right !!
So how can i do this!
Thank you!

Best Regards,
Sahar.

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using System.Timers;

using System.Windows.Threading;
using Abt.Controls.SciChart.Common;

using Abt.Controls.SciChart.Model.DataSeries;
using Abt.Controls.SciChart.Common.Helpers;
using Abt.Controls.SciChart;
using Common;
using System.Globalization;
using Microsoft.Win32;
using System.Diagnostics;
using Abt.Controls.SciChart.Visuals;
using System;
using System.Collections.Generic;
using System.Timers;
using Abt.Controls.SciChart.Model.DataSeries;
using Abt.Controls.SciChart.Numerics;
using Abt.Controls.SciChart.ChartModifiers;
using Abt.Controls.SciChart.Visuals.RenderableSeries;
using Abt.Controls.SciChart.Example.MVVM;
using Abt.Controls.SciChart.Example;
using Abt.Controls.SciChart.Visuals.Axes;
using Abt.Controls.SciChart.Example.Data;
using Abt.Controls.SciChart.Example.Common;
using Abt.Controls.SciChart.Example.Examples.IWantTo.AnnotateAChart.DragHorizontalThreshold;
using System.Collections.ObjectModel;
using System.Windows.Annotations;
using Abt.Controls.SciChart.Visuals.Annotations;


namespace BeanGUI
{
/// <summary>
/// Interaction logic for SensorGraph2D.xaml
/// </summary>
public partial class SensorGraph2D : UserControl, IExampleAware
{


    private IXyDataSeries<DateTime, double> series1;

    public double _Threshold;
    public Boolean chkBx_Threshold_checked = false;
    private bool _isMouseDoubleClick;
    private bool _isZoomEnabled;
    private bool _isPanEnabled;
    private TimedMethod _startDelegate;
    public Boolean Zoom_test = false;
    public int cpt = 0;
    private readonly Abt.Controls.SciChart.ActionCommand _zoomModeCommand;
    private I_BeanSensorModel sensor;

    private readonly Abt.Controls.SciChart.ActionCommand _panModeCommand;

    public double Measure_val;
    Boolean Circle = false;
    public string date_val;
    private IndexRange _xVisibleRange;
    public double val_Threshold;
    public int i = 0;
    public int h = 0;
    public double st;

    string[] Tab = new string[4];
    public SensorGraph2D()
    {
        InitializeComponent();
        _zoomModeCommand = new Abt.Controls.SciChart.ActionCommand(SetZoomMode);
        _panModeCommand = new Abt.Controls.SciChart.ActionCommand(SetPanMode);
        IsPanEnabled = true;


        /* for foreach all themeManager */


        foreach (string theme in ThemeManager.AllThemes)
        {
            cboTheme.Items.Add(theme);
        }
        cboTheme.SelectedItem = "Oscilloscope";


    }


    public ICommand ZoomModeCommand { get { return _zoomModeCommand; } }

    public ICommand PanModeCommand { get { return _panModeCommand; } }

    public bool IsZoomEnabled
    {
        get { return _isZoomEnabled; }
        set
        {
            _isZoomEnabled = value;

        }
    }
    public bool IsPanEnabled
    {
        get { return _isPanEnabled; }
        set
        {
            _isPanEnabled = value;

        }
    }

    private void SetPanMode()
    {
        IsPanEnabled = true;
        IsZoomEnabled = false;
    }

    private void SetZoomMode()
    {

        IsZoomEnabled = true;
    }


    public double Threshold
    {
        get { return _Threshold; }
        set
        {
            _Threshold = value;

        }
    }


    public IndexRange XVisibleRange
    {
        get { return _xVisibleRange; }
        set
        {
            if (Equals(_xVisibleRange, value))
                return;
            _xVisibleRange = value;
            OnPropertyChanged("XVisibleRange");

        }
    }

    private void OnPropertyChanged(string p)
    {
        throw new System.NotImplementedException();
    }

    public void CreateDataSetAndSeries_Alarm(List<DateTime> lstX1, List<double> lstY1)
    {
        series1 = new XyDataSeries<DateTime, double>();

        using (this.sciChartSurface.SuspendUpdates())
        {

            series1.Append(lstX1, lstY1);

        }
        redLine.DataSeries = series1;
        if (Zoom_test == false)
        {
            sciChartSurface.ZoomExtentsY();
        }

    }


    public double maxValuesY()
    {
        return (double)series0.YMax;
    }

    public double minValuesY()
    {
        return (double)series0.YMin;
    }

    public DateTime maxValuesX()
    {
        return (DateTime)series0.XMax;
    }

    public DateTime minValuesX()
    {
        return (DateTime)series0.XMin;
    }


    public void ClearDataSeries1()
    {
        if (series1 == null)
            return;

        using (this.sciChartSurface.SuspendUpdates())
        {
            series1.Clear();
        }
    }



    /* for the Theme Changed*/
    private void cboThemeChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
    {

        ThemeManager.SetTheme(sciChartSurface, (string)cboTheme.SelectedItem);
        ThemeManager.SetTheme(sciChartSurface, (string)cboTheme.SelectedItem);

    }

    /*Point values*/
    public void SeriesSelectionModifier_SelectionChanged(object sender, EventArgs e)
    {
        if (Circle == true)
        {
            OnSeriesSelectionChanged();
        }
    }
    public void OnSeriesSelectionChanged()
    {
        bool hasSelection = sciChartSurface.SelectedRenderableSeries.Any();

    }


    private void CopyToClipboardClick(object sender, RoutedEventArgs e)
    {

        var bmp = this.sciChartSurface.ExportToBitmapSource();
        Clipboard.SetImage(bmp);

        MessageBox.Show("Copied to Clipboard!");
    }

    private void SaveAsPngClick(object sender, RoutedEventArgs e)
    {
        var dialog = new SaveFileDialog();
        dialog.DefaultExt = "png";
        dialog.AddExtension = true;
        dialog.Filter = "Png Files|*.png";
        dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
        if (dialog.ShowDialog() == true)
        {
            this.sciChartSurface.ExportToFile(dialog.FileName, ExportType.Png);
            Process.Start(dialog.FileName);
        }
    }


    private void ZoomExtendsClick(object sender, RoutedEventArgs e)
    {
        sciChartSurface.ZoomExtents();

        Zoom_test = false;
        this.panModifier.IsEnabled = false;
    }
    private void PrintToXpsClick(object sender, RoutedEventArgs e)
    {
        var dialog = new PrintDialog();
        if (dialog.ShowDialog() == true)
        {
            var size = new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaWidth * 3 / 4);

            var scs = CreateSciChartSurfaceWithoutShowingIt(size);


            Action printAction = () => dialog.PrintVisual(scs, "Programmer Awesomeness");
            Dispatcher.BeginInvoke(printAction);
        }
    }

    private void ZoomExtentsY_Checked(object sender, RoutedEventArgs e)
    {
        this.XAxis.AutoRange = AutoRange.Always;
        this.YAxis.AutoRange = AutoRange.Never;
        if (rubberBandZoomModifier != null)
        {

            var checkBox = (CheckBox)sender;
            rubberBandZoomModifier.ZoomExtentsY = checkBox.IsChecked == true;
        }
    }
    private void ZoomExtentsX_Checked(object sender, RoutedEventArgs e)
    {

        this.YAxis.AutoRange = AutoRange.Always;
        this.XAxis.AutoRange = AutoRange.Never;
        if (rubberBandZoomModifier != null)
        {
            var checkBox = (CheckBox)sender;
            rubberBandZoomModifier.IsXAxisOnly = checkBox.IsChecked == true;
        }
    }

    private void ZoomClick(object sender, RoutedEventArgs e)
    {

        Zoom_test = true;


    }

    private void ZoomPanModifier_MouseDown(object sender, MouseButtonEventArgs e)
    {
        this.XAxis.AutoRange = AutoRange.Never;
        this.YAxis.AutoRange = AutoRange.Never;
    }

    private void UserControl_Loaded(object sender, RoutedEventArgs e)
    {

    }

    public void OnExampleExit()
    {
        throw new System.NotImplementedException();

    }

    public void OnExampleEnter()
    {
        throw new System.NotImplementedException();
    }
    public void CursorModifier_MouseDown(object sender, MouseButtonEventArgs e)
    {

        this.XAxis.Scrollbar.IsEnabled = false;
        System.Diagnostics.Debug.WriteLine("Sahar====>");
    }


    private void chkBx_Threshold_Checked(object sender, RoutedEventArgs e)
    {
        chkBx_Threshold_checked = true;
    }

    private void chkBx_Threshold_Unchecked(object sender, RoutedEventArgs e)
    {
        chkBx_Threshold_checked = false;

        ClearDataSeries1();
    }




}
}

XAML CODE

<UserControl x:Class="BeanGUI.SensorGraph2D"
         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:SciChart="http://schemas.abtsoftware.co.uk/scichart" 
         xmlns:helpers="clr-namespace:Abt.Controls.SciChart.Example.Helpers;assembly=Abt.Controls.SciChart.Example"
          xmlns:Common="clr-namespace:Abt.Controls.SciChart.Example.Common;assembly=Abt.Controls.SciChart.Example"
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300" Loaded="UserControl_Loaded">


<UserControl.Resources>

</UserControl.Resources>

<Grid x:Name="LayoutRoot">
    <Grid.Resources>
        <Common:DoubleToGridLengthConverter x:Key="DoubleToGridLengthConverter"/>
    </Grid.Resources>



    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <SciChart:SciStockChart x:Name="sciChartSurface" Grid.Row="1" Padding="20,40,10,10" IsPanEnabled="{Binding IsPanEnabled}" IsRubberBandZoomEnabled="{Binding IsZoomEnabled}" SciChart:ThemeManager.Theme="Oscilloscope"  >

        <!-- <SciChart:SciStockChart.Annotations>
            <SciChart:HorizontalLineAnnotation HorizontalAlignment="Stretch"
            IsEditable="True"
            LabelPlacement="Axis"
            LabelTextFormatting="0.00"
            ShowLabel="True"
            Stroke="Red"
            StrokeThickness="2"
            Y1="{Binding Threshold,Mode=TwoWay}"  />
        </SciChart:SciStockChart.Annotations> -->



        <!-- Create three RenderableSeries, which map 1:1 to the DataSeries created in code-behind -->
        <SciChart:SciChartSurface.RenderableSeries>
            <SciChart:FastLineRenderableSeries x:Name="lineSeries" SeriesColor="#FFFFA500" StrokeThickness="2" />


        </SciChart:SciChartSurface.RenderableSeries>


        <SciChart:SciStockChart.XAxisStyle>
            <Style TargetType="SciChart:CategoryDateTimeAxis">
                <Setter Property="VisibleRange" Value="{Binding XVisibleRange, Mode=TwoWay}"/>
            </Style>
        </SciChart:SciStockChart.XAxisStyle>
        <SciChart:SciStockChart.XAxis>
            <SciChart:DateTimeAxis  Name="XAxis"  DrawMinorTicks="true" DrawMinorGridLines="True"   DrawLabels ="true" DrawMajorGridLines="true" MinHeight="50"  TextFormatting="HH:mm MMM dd"
                                  SubDayTextFormatting="HH:mm:ss MMM dd yyyy" >

                <SciChart:DateTimeAxis.GrowBy>
                    <SciChart:DoubleRange Min="0" Max="0"/>
                </SciChart:DateTimeAxis.GrowBy>

            </SciChart:DateTimeAxis  >
        </SciChart:SciStockChart.XAxis>

        <!-- Create a Y Axis -->
        <SciChart:SciStockChart.YAxis>
            <SciChart:NumericAxis Name="YAxis" AutoRange="Never" AllowDrop="False" ToolTip="true"
                                  DrawMinorTicks="True" DrawMinorGridLines="true" DrawLabels ="true" DrawMajorBands="True" AutoTicks="True" DrawMajorGridLines="true" TextFormatting="0.0000" >

                <SciChart:NumericAxis.GrowBy>
                    <SciChart:DoubleRange Min="0.1" Max="0.1"/>
                </SciChart:NumericAxis.GrowBy>


            </SciChart:NumericAxis>
        </SciChart:SciStockChart.YAxis>

        <!--  Add some modifiers to zoom, zoom extents  -->

        <!--    -->
        <SciChart:SciStockChart.ChartModifier>

            <SciChart:ModifierGroup>


                <SciChart:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True" IsXAxisOnly="False" ZoomExtentsY="False"/>

                <SciChart:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"/>
                <SciChart:ZoomPanModifier x:Name="panModifier"/>

                <SciChart:CursorModifier ReceiveHandledEvents="True" ShowAxisLabels="True" ShowTooltip="True" ShowTooltipOn="MouseRightButtonDown"  ToolTip="true"/>
                <!-- <SciChart:RubberBandXyZoomModifier IsEnabled="{Binding ChartModifier, Mode=TwoWay, ConverterParameter=RubberBandZoom}" IsXAxisOnly="False"/>-->
                <SciChart:MouseWheelZoomModifier/>
                <!-- For the point values -->

                <SciChart:SeriesSelectionModifier SelectionChanged="SeriesSelectionModifier_SelectionChanged">
                    <SciChart:SeriesSelectionModifier.SelectedSeriesStyle>
                        <Style TargetType="SciChart:BaseRenderableSeries">
                            <Setter Property="PointMarkerTemplate">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <SciChart:EllipsePointMarker x:Name="PART_PointMarker" Stroke="White" Fill="#77777777" StrokeThickness="1" Width="5" Height="5"/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </SciChart:SeriesSelectionModifier.SelectedSeriesStyle>
                </SciChart:SeriesSelectionModifier>
            </SciChart:ModifierGroup>
        </SciChart:SciStockChart.ChartModifier>
    </SciChart:SciStockChart>

    <!-- Define the Toolbar -->
    <!-- Define the Toolbar verticale -->
    <!-- Update Theme -->
    <!--  This grid is used to space Overview Control so its width matches parent chart XAxis  -->

    <Grid Grid.Row="2">
        <!--  The grid is used to set paddings around the Overview, so that the size of the Overview matches the size of the XAxis on the parent chart  -->
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="20"/>
            <!--  Matches parent surface padding left  -->
            <ColumnDefinition Width="25*"/>
            <!--  Hosts overview control  -->
            <ColumnDefinition Width="0"/>
            <!--  Used to bind to parent surface YAxis  -->
            <ColumnDefinition Width="80"/>
            <!--  Matches parent surface padding right  -->
        </Grid.ColumnDefinitions>

        <helpers:ActualSizePropertyProxy x:Name="proxy" Element="{Binding ElementName=sciChartSurface, Path=YAxis}"/>
        <SciChart:SciChartOverview  Grid.Column="1" ParentSurface="{Binding ElementName=sciChartSurface,
                                                    Mode=OneWay}"
                                                            SciChart:ThemeManager.Theme="{Binding ElementName=cboTheme,
                                                           Path=SelectedItem}"
                            SelectedRange="{Binding XVisibleRange,
                                             Mode=TwoWay}" Focusable="True" />




    </Grid>



    <Grid Grid.Row="1" Margin="40,40,0,0" VerticalAlignment="Top">
        <Grid.Resources>
            <!-- Style for Stats -->
            <Style TargetType="TextBlock" x:Key="StatsStyle">
                <Setter Property="FontSize" Value="26"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="Foreground" Value="#BBFC9C29"/>
                <Setter Property="FontFamily" Value="pack://application:,,,/Resources/Fonts/#Neuropol Regular"/>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="60"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="186*" />
        </Grid.ColumnDefinitions>
        <Label x:Name="measureLabel1"    Margin="-8,6,12,-2"  Foreground="GreenYellow" FontStyle="Normal" FontSize="11" FontStretch="UltraCondensed" Target="{Binding}" IsEnabled="True"/>
        <TextBlock Margin="5" FontSize="16" Foreground="#eee" Text="{Binding DataContext.Threshold, StringFormat='Threshold = {0:#0.00}', RelativeSource={RelativeSource AncestorType=SciChart:SciChartSurface}}"/>
    </Grid>
    <Grid Grid.Row="1" Margin="-4,102,0,119" VerticalAlignment="Center">
        <Grid.RowDefinitions>
            <RowDefinition Height="12*" />
            <RowDefinition Height="2*" />
        </Grid.RowDefinitions>
        <Grid.Resources>
            <!-- Style for Stats -->
            <Style TargetType="TextBlock" x:Key="StatsStyle">
                <Setter Property="FontSize" Value="26"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="Foreground" Value="#BBFC9C29"/>
                <Setter Property="FontFamily" Value="pack://application:,,,/Resources/Fonts/#Neuropol Regular"/>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="290*" />
        </Grid.ColumnDefinitions>
        <Label x:Name="ActifLabel"   IsEnabled="true"   HorizontalAlignment="Left" Foreground="GreenYellow" FontStyle="Normal" FontSize="11" FontStretch="UltraCondensed" Target="{Binding}"  />

    </Grid>
    <Grid Grid.Row="1" Margin="-4,-56,0,56" VerticalAlignment="Bottom">
        <Grid.RowDefinitions>
            <RowDefinition Height="15*" />
            <RowDefinition Height="2*" />
        </Grid.RowDefinitions>
        <Grid.Resources>
            <!-- Style for Stats -->
            <Style TargetType="TextBlock" x:Key="StatsStyle">
                <Setter Property="FontSize" Value="26"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="Foreground" Value="#BBFC9C29"/>
                <Setter Property="FontFamily" Value="pack://application:,,,/Resources/Fonts/#Neuropol Regular"/>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="290*" />
        </Grid.ColumnDefinitions>
        <Label x:Name="inactifLabel"   IsEnabled="true"   HorizontalAlignment="Left" Foreground="GreenYellow" FontStyle="Normal" FontSize="11" FontStretch="UltraCondensed" Target="{Binding}"  />

    </Grid>




    <Grid Grid.Row="1"  VerticalAlignment="top" HorizontalAlignment="Center" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.Resources>
            <!-- Style for Stats -->
            <Style TargetType="TextBlock" x:Key="StatsStyle">
                <Setter Property="FontSize" Value="26"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="FontFamily" Value="pack://application:,,,/Resources/Fonts/#Neuropol Regular"/>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="200*" />
        </Grid.ColumnDefinitions>
        <Label x:Name="graphPaneTitle" Margin="2" Foreground="#FFFFA500" FontStyle="Italic" FontSize="20" FontStretch="UltraCondensed" Height="31" />

    </Grid>

    <StackPanel Grid.Row="0" Orientation="Horizontal" >
        <!-- <Label x:Name="measureLabel1"    Margin="2"  Foreground="GreenYellow" FontStyle="Normal" FontSize="11" FontStretch="UltraCondensed" Height="25" Target="{Binding}" IsEnabled="True"/> -->
        <ComboBox x:Name="cboTheme" ToolTip="Update Theme" Margin="2,3,2,0" SelectionChanged="cboThemeChanged" Foreground="GreenYellow" HorizontalAlignment="center" SelectedItem="Oscilloscope"  Height="28" Width="92">
            <ComboBox.Background>

                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>

            </ComboBox.Background>
        </ComboBox>
        <Line Margin="2,3,2,0" Stroke="Gray" Y2="25"/>
        <Button Click="PrintToXpsClick" ToolTip="Print Graph"  Foreground="GreenYellow"  Margin="2,3,2,0"  Content="Print"  Height="28" >

            <Button.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FFB3CBBB" Offset="1" />
                </LinearGradientBrush>
            </Button.Background>
        </Button>



        <Button Click="SaveAsPngClick" ToolTip="Save To PNG" Foreground="GreenYellow"  Margin="2,3,2,0"  Content="Save to PNG" Height="28" >
            <Button.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>
            </Button.Background>
        </Button>
        <Button Click="CopyToClipboardClick" ToolTip="Copy To ClipBoard" Foreground="GreenYellow"  Margin="2,3,2,0"  Content="Copy to Clipboard" Height="28">
            <Button.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>
            </Button.Background>
        </Button>
        <Line Margin="2,3,2,0" Stroke="Gray" Y2="25"/>

        <ToggleButton Click="ZoomExtendsClick" ToolTip="Extends Zoom" Margin="2,3,2,0"  Foreground="GreenYellow" Height="28" >
            <StackPanel Orientation="Horizontal">
                <Image Margin="3" Source="/Abt.Controls.SciChart.Example;component/Resources/Images/fit_to_size.png" Stretch="None"/>
                <TextBlock Margin="3" Text="Extends Zoom"/>

            </StackPanel>

            <ToggleButton.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>
            </ToggleButton.Background>
        </ToggleButton>



        <ToggleButton Click="ZoomClick" ToolTip="Zoom Curves" Margin="2,3,2,0"  Foreground="GreenYellow" Height="28" >
            <StackPanel Orientation="Horizontal">
                <Image Margin="3" Source="/Abt.Controls.SciChart.Example;component/Resources/Images/zoom.png" Stretch="None"/>
                <TextBlock Margin="3" Text="Zoom"/>

            </StackPanel>
            <ToggleButton.Background>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>
            </ToggleButton.Background>
        </ToggleButton>
        <ToggleButton x:Name="btnPan" ToolTip="Pan"
                      Margin="2,3,2,0"  Foreground="GreenYellow" Height="28"
                      Content="Pan"

                      IsChecked="{Binding IsEnabled,ElementName=panModifier,
                                          Mode=TwoWay}"
                      SciChart:ToggleButtonExtensions.GroupName="ModifiersGroup">

            <ToggleButton.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>
            </ToggleButton.Background>
        </ToggleButton>
        <CheckBox  Margin="2,3,2,0" Checked="ZoomExtentsY_Checked" Content="ZoomY" Foreground="GreenYellow" Unchecked="ZoomExtentsY_Checked" Height="14" >

        </CheckBox>
        <CheckBox  Margin="2,3,2,0" Checked="ZoomExtentsX_Checked" Foreground="GreenYellow" Content="ZoomX" Unchecked="ZoomExtentsX_Checked" Height="14">
        </CheckBox>
        <Line Margin="2,3,0,0" Stroke="Gray" Y2="25"/>
        <CheckBox  Margin="2,3,2,0" Name="chkBx_Threshold" Checked="chkBx_Threshold_Checked" Foreground="GreenYellow" Content="Alarm" Unchecked="chkBx_Threshold_Unchecked" Height="14">
        </CheckBox>

        <StackPanel.Background>
            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                <GradientStop Color="Black" Offset="0" />
                <GradientStop Color="Black" Offset="1" />
            </LinearGradientBrush>
        </StackPanel.Background>





    </StackPanel>


    <!-- Define the SciChartSurface -->


    <!-- Create an X Axis -->



</Grid>
</UserControl>
0 votes
8k views

Using MVVM, I have an AnnotationCollection databound to the SciChartSurface.Annotations. Individual LineAnnotations are added to the collection as the application code runs.

If annotations are added while the chart is displayed, they are all drawn correctly.

However, if the chart page is reloaded (say, the user navigates to a different page and then returns to the chart page), the annotations do not always redraw. If the annotations have AnnotationCanvas set to default (AnnotationCanvas.AboveChart, I believe) they redraw correctly about 50% of the time. If the annotations’ AnnotationCanvas is set to AnnotationCanvas.XAxis, they never redraw.

All the annotations still exist in the ObservableCollection in all these cases, so they shouldn’t need to be re-created.

Is this a bug in SciChart or is there something I may be doing wrong with the annotations?
(There is only one X-Axis so no axisID is necessary.)

LineAnnotation lAnno = new LineAnnotation();
lAnno.CoordinateMode = AnnotationCoordinateMode.RelativeY;
lAnno.Y1 = 0.0;
lAnno.X1 = DataPoints;
lAnno.Y2 = 1.0;
lAnno.X2 = DataPoints;
lAnno.YAxisId = "Counts";
lAnno.Foreground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(255, 255, 255));
lAnno.Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(96, 255, 0, 0));
lAnno.StrokeThickness = 2;
lAnno.AnnotationCanvas = AnnotationCanvas.XAxis;

Markers.Add(lAnno);
0 votes
9k views

Hi,

I am displaying multiple DataSeries using SciChar v2.2. I templated the tooltip using [code title=””]TooltipLabelTemplate[/code] and bind [code title=””]SeriesData[/code] to the Tooltip template. so I have all the information in need in a single tooltip.

But when I apply a RollOverModifier on the chart (ShowTooltipOn=”Always”), the chart displays one tooltip for each DataSeries. I will have multiple tooltips poped out with duplicated information.

Is there anyway to display only one single Tooltip for the RoolOverModifier?

Thank you.

0 votes
10k views

Is there any option in stock chart to place point markers in arbitrary location of chart and arbitrary numbers of them? I want to use this capability to compare two or more critical points of the stock chart. In other words I need a list of selective point markers to monitor the critical points of captured data. Let me know how can do this.
Thanks

  • Hamed asked 9 years ago
  • last active 9 years ago
0 votes
0 answers
9k views

We are pleased to announce SciChart v1.5.6 Build 1991 has been released. This is an important maintenance update which includes many fixes for bugs reported on our forums in January 2013 and February 2013.

As of today, you will be able to download v1.5.6.1991 on our Downloads page. If you are a source code customer you will receive an email with updated package detail shortly.

SciChart v1.5 Features

If you’re new to SciChart and want a quick walk through of the features in v1.5, please take a look at the videos Introduction to SciChart and SciChart v1.5 Launch – New Features.

SciChart v1.5.6.1991 Release What’s New (12th Feb 2013)

Bug Fixes

  • Fixed crash when data with NumericAxis is switched from Linear to Logarithmic when data has both positive & negative values
  • Fixed VerticalLineAnnotation templating issues
  • Fixed Annotation coordinate / X-label issues when used with DateTimeAxis
  • Fixed Overview control cannot scroll to edges when moving mouse quickly
  • Fixed memory leak associated with DefaultLabelFormatter issues on Axis
  • Fixed annotation placement is incorrect when left-axis is used
  • Fixed ZoomPanModifier in Quad-Axis example (or when left-axis used) did not pan on left part of the chart
  • Fixed SciChartOverview does not update X-Range when changing dataset for shorter data
  • Fixed NullPointerException when hit-testing a hidden series
  • Fixed XyScatterSeries does not update after setting Min and Max of DoubleRange so no data is on the chart
  • Fixed Annotation X-Coordinate is rounded up to next candle when used on CategoryDateTimeAxis
  • Fixed Exception when trying to add new dataseries to a SciChartGroup if Theme was changed
  • Fixed FastMountainRenderableSeries handling of double.NaN, now correctly shows line to zero when NaN’s used
  • Fixed Synchronize Multi-Chart issue – bottom chart doesn’t pan when rollover is used
  • Fixed ZoomPanModifier and CursorModifier bug in Sync Multi-Chart Mouse example when Axis is on the left
  • Fixed Y-Axis Drag triggers RubberBandZoom in Sync Multi-Chart Mouse example
  • Fixed a bug in Modify Axis Properties example
  • Fixed RolloverModifier with IsDigitalLine == true does not match up with UseInterpolation
  • Fixed RolloverModifier dissappears when outside of data-range.
  • Fixed Column Series with DataPointWidth = 1.0 has gap after the first column
  • Fixed Rollover tooltip gets stuck in position when chart zooms
  • Fixed OHLC bars sometimes the open wick is shorter than close
  • Fixed Changing theme with annotations causes exceptions
  • Fixed Flicker in Axis Legend Checkboxes when manipulating chart (e.g. in Quad Left/Right YAxis Example)
  • Fixed YAxis doesn’t align ticks to left or right when MinWidth or Width is specified
  • Fixed SciChartGroup panes have small padding for child chart panes
  • Fixed LineAnnotation can get focused by keyboard causing dotted line around annotations
  • Fixed HorizontalLineAnnotation.LabelPlacement doesnt work when annotation is added dynamically from code
  • Fixed Exception when adding new DataSeries inside SciChartGroup if Theme was changed

Known Issues

  • VS2012 Designer shows Trial expired even when a license key is applied.
    Workaround is to apply the license using the SciChartLicense.xml file (not using SciChartSurface.SetLicenseKey())
    and ensure AnyCPU or x86 are used (not x64)
  • Logarithmic Axis doesn’t play well with ZoomPanModifier and MouseWheelModifier. To rectify this we are re-working the Logarithmic Axis for SciChart v2.0
  • AxisBase.AutoTicks = false causes a crash unless AxisBase.MajorDelta and AxisBase.MinorDelta are set
1 vote
0 answers
11k views

Hi All,

Today’s weirdness was hard to track down but I can now demonstrate it with minimal code.

As a summary to the problem – we may generate multiple user controls each containing a chart that can’t all be viewed on screen at the same time. Our solution was to wrap everything in a ScrollViewer and allow the user to scroll through them. This caused the x Axis and any Right Aligned axis to do weird things with the chart.

On careful observation we noticed that any mouse movements in the axis while dragging were being interpreted as drags on the chart area so it would zoom (or pan) accordingly instead of dragging the Axis in question. Setting the scrollviewer scrollbar visibility to disabled returned the chart to expected behavior.

Can someone tell me what we did wrong or provide a work around suggestion.

The XAML:

<UserControl x:Class="WpfUITest.SciChartMultiaxisTest"
         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" `enter code here`
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         xmlns:s="http://schemas.abtsoftware.co.uk/scichart" 
         d:DesignHeight="300" d:DesignWidth="300">
<Grid>
    <!-- <ScrollViewer CanContentScroll="False" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled">  THIS IS OK   -->
    <ScrollViewer CanContentScroll="False" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
        <Grid>
            <s:SciChartSurface x:Name="UserControlSciChartSurface" s:ThemeManager.Theme="Chrome" >
                <s:SciChartSurface.XAxis>                
                    <s:NumericAxis AxisAlignment="Bottom" AxisTitle="XAxis 1" GrowBy="0.01,0.01"/>            
                </s:SciChartSurface.XAxis>

                <s:SciChartSurface.YAxes>
                    <s:NumericAxis x:Name="Left1" Id="Left1" AxisTitle="Left Axis" AxisAlignment="Left" />
                    <s:NumericAxis x:Name="Right1" Id="Right1" AxisTitle="Right Axis" AxisAlignment="Right" />                        
                </s:SciChartSurface.YAxes>

                <s:SciChartSurface.ChartModifier>
                    <s:ModifierGroup>
                        <!-- <s:ZoomPanModifier x:Name="ZoomPanModifier" ExecuteOn="MouseLeftButton" />  -->
                        <s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" ExecuteOn="MouseLeftButton"/>
                        <s:ZoomExtentsModifier x:Name="zoomExtentsModifier" ExecuteOn="MouseDoubleClick"/>                            
                        <s:XAxisDragModifier x:Name="xAxisDragModifier" IsEnabled="True" ClipModeX="None" />
                        <s:YAxisDragModifier AxisId="Left1" IsEnabled="True" />
                        <s:YAxisDragModifier AxisId="Right1" IsEnabled="True"/>
                    </s:ModifierGroup>
                </s:SciChartSurface.ChartModifier>
            </s:SciChartSurface>            
        </Grid>
    </ScrollViewer>
</Grid>

I put a simple test series on from the code behind as follows:

        public void AddTestDataSeries()
    {
        XyDataSeries<int, int> testSeriesData = new XyDataSeries<int, int> { SeriesName = "Series1" };
        for(int x = 1; x < 10; x++)
        {
            testSeriesData.Append(x, x);
        }
        FastLineRenderableSeries testSeries = new FastLineRenderableSeries();
        testSeries.DataSeries = testSeriesData;
        testSeries.YAxisId = "Left1";
        testSeries.SeriesColor = Colors.Red;
        this.UserControlSciChartSurface.RenderableSeries.Add(testSeries);
    }

Any ideas anyone?

1 vote
9k views

I am evaluating SciChart for an upcoming project. I like what I see for WPF and a standard console.
My problem is that SciChart for the web only shows projects for Silver Light.

Silver Light is dead. Win RT is gasping its last breath. Everthing seems to be moving towards HTML5 / JS.

I need to be able to use the charts in a web browser as well as a console.
Is there new versions of SciChart coming out that addresses this issue.

Regards
Bill Johnson

0 votes
10k views

Hi, every so often if I’ve stopped at a breakpoint then resume execution, the following exception gets thrown (usually within code that creates chart data series):-

System.TypeInitializationException occurred
HResult=-2146233036
Message=The type initializer for '' threw an exception.
Source=NuIns.NuQuant.UI
TypeName=
StackTrace:
at NuIns.NuQuant.UI.Charting.Providers.IntStdRecovery.IntStdRecoveryChartProvider.CreateChartData(BatchMethodAnalyte batchMethodAnalyte)
at NuIns.NuQuant.UI.Charting.Providers.ChartThumbnailProvider.CreateThumbsForSelectedIsotope() in c:\Dev\NuQuant\MAIN\Source\NuQuant\NuIns.NuQuant.UI\Charting\Providers\ChartThumbnailProvider.cs:line 103
InnerException: System.TypeInitializationException
HResult=-2146233036
Message=The type initializer for 'A.c7e585e832523cad8ae1bfdae702190ae' threw an exception.
Source=Abt.Controls.SciChart.Wpf.2.2
TypeName=A.c7e585e832523cad8ae1bfdae702190ae
StackTrace:
at A.c7e585e832523cad8ae1bfdae702190ae.cfeda204b88a362a8051e16fad0b60ea3()
at .cctor()
InnerException: System.IO.FileNotFoundException
HResult=-2147024894
Message=Could not load file or assembly 'Abt.Controls.SciChart.Wpf.2.2&amp;' or one of its dependencies. The system cannot find the file specified.
Source=mscorlib
FileName=Abt.Controls.SciChart.Wpf.2.2&amp;
FusionLog==== Pre-bind state information ===
LOG: User = xxxxxxxxxx
LOG: DisplayName = Abt.Controls.SciChart.Wpf.2.2&amp;
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Abt.Controls.SciChart.Wpf.2.2&amp; | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Dev/NuQuant/MAIN/BuildOutput/
LOG: Initial PrivatePath = NULL

Calling assembly : Abt.Controls.SciChart.Wpf.2.2, Version=2.2.5014.12317, Culture=neutral, PublicKeyToken=b55dd9efe817e823.

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Dev\NuQuant\MAIN\BuildOutput\NuIns.NuQuant.UI.vshost.exe.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Dev/NuQuant/MAIN/BuildOutput/Abt.Controls.SciChart.Wpf.2.2&amp;.DLL.
LOG: Attempting download of new URL file:///C:/Dev/NuQuant/MAIN/BuildOutput/Abt.Controls.SciChart.Wpf.2.2&amp;/Abt.Controls.SciChart.Wpf.2.2&amp;.DLL.
LOG: Attempting download of new URL file:///C:/Dev/NuQuant/MAIN/BuildOutput/Abt.Controls.SciChart.Wpf.2.2&amp;.EXE.
LOG: Attempting download of new URL file:///C:/Dev/NuQuant/MAIN/BuildOutput/Abt.Controls.SciChart.Wpf.2.2&amp;/Abt.Controls.SciChart.Wpf.2.2&amp;.EXE.

        StackTrace:
             at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp;amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
             at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp;amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
             at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp;amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
             at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp;amp; stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
             at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp;amp; stackMark, Boolean forIntrospection)
             at System.Reflection.Assembly.Load(String assemblyString)
             at A.c7e585e832523cad8ae1bfdae702190ae..cctor()
        InnerException: 

I’ve seen it with different versions of SciChart, not just 2.2. It happens once in a blue moon so is nothing more than a very minor inconvenience. Just wondered if you had come across this?

0 votes
20k 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?

0 votes
10k views

Hi,

I’m binding SciChart to a ViewModel in the following way:

<sciChart:SciChartSurface DataSet="{Binding Path=ChannelDataSet}"
RenderableSeries="{Binding Path=ChannelSeries}"
XAxis="{Binding Path=TimeAxis}"
YAxes="{Binding Path=YAxisCollection}" />

The YAxisCollection contains three IAxis objects with three different VisibleRanges. The problem is that the set VisibleRanges are ignored by the chart while setting AutoRange to false. I get three Y-Axis on the chart, but the VisibleRange seems to be automatic. What am I doing wrong in my Bindings?

I attached a sample project that points out the issue!

Thanks

0 votes
9k views

In the online demo the Stacked side by side column chart says,
“The StackedColumnRenderableSeries can be used to render columns stacked one above another, side by side, or a Left or Right aligned Bar Chart.”
I’m just wondering how to tell the chart to stack side by side versus one above the other, etc.
Thanks.

0 votes
8k views

I’d like to Pan a chart with a DateTime xAxis some number of seconds (or bars) through code. It looks like the IRange for the chart rationalizes to so I somehow need to be able to convert a TimeSpan to an appropriate range I can use and set the XaxisVisibleRange. If there is an example I’m missing it.

  1. How should I specify a given timeSpan range for the XaxisVisibleRange?
  2. How should I validate that the new timeSpan range is within the range of the underlying dataSeries?
0 votes
11k views

Hi All,

I have a linear graph which represents a measure in real time (I have a loop that gets a value at each iteration). I have a FastLineRenderableSeries with a DataSeries in which I append x and y vector. The y vector is full of Double.NaN values, and it is updated with valid values at each loop iteration. During the representation, I can only see valid values, and NaN values are not represented. Everything ok.

But now I have changed from FastLineRenderableSeries to CustomRenderableSeries (due to markers and other issues), and I have a strange effect on real time visualization (see attached picture). It seems that NaN values are represented as infinite, so I can see a vertical line at last real value.

I have set DrawNaNAs = LineDrawMode.Gaps but it doesn’t work. Am I doing something wrong? Is there something extra I have to set regarding CustomRenderableSeries?

Thanks in advance

0 votes
0 answers
8k views

Hello again!
I’m working with changing font properties. I have two questions:

1) Is there any way to apply such properties as FontWeight (Bold), FontStyle (UnderLine, Italic) to the text drawn in InternalDraw method (renderContext.DrawText)?

2) Also I’m using horizontalLineAnnotation with AnnotationLabels. I need to change the same properties as in the question above to the text in AnnotationLabel in code behind. Here is the code snippet to change FontWeight:

var tempAnnotationLabel = new AnnotationLabel
                {
                    Text = fluidValue.Name,
                    LabelPlacement = LabelPlacement.TopLeft,
                    FontSize = 11,
                    FontWeight = FontWeights.Bold,
                };

But when I’m displaying this horizontalLineAnnotation, FontWeight is the same as before. How can I do this?

Thanks in advance

1 vote
13k views

How can i wrap legend? if legend width is out of window.

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

I am trying out SciChart ( and WPF ) for a large dataset and till so far very pleased with the results. I have followed the example as described here http://support.scichart.com/index.php?/Knowledgebase/Article/View/17258/0/creating-a-custom-scichartoverview-with-many-series-using-the-scrollbar-api and can successfully view my bound data and everything is perfect for the first instance.

However, when I assign this usercontrol to different tabs they still somehow share data about the viewstate ( the overview window does not resize, and the slider thing in front of it stays at the same values. My guess is that it has to do with the messages in ActualSizePropertyProxy , but since I am new to SciChart and WPF I was hoping that maybe someone here knows what it is.

Thanks.

  • Michel Moe asked 9 years ago
  • last active 4 years ago
0 votes
10k views

To whom this may concern:

I am having a small problem with text annotations. When they are dynamically created with the IsEditable property set to “true”, the annotations change in size after being moved.

This is shown in the “Interaction with Annotations” example in your Examples program. If you look at the box showing “sell”, at first when you zoom in on it closely enough (using the RubberBandXyZoomModifier around the extents of the TextAnnotation) it retains its size.

Now if you zoom back to the extents, and move the “sell” TextAnnotation anywhere around the graph, and then zoom in on it again, it changes size (screenshot from Examples program attached). This is an issue i’m having with one of my programs.

Is there a way to maintain the size of the text annotation without having to set a fixed height and width?

Thanks kindly!

— Ari

  • Ari Sagiv asked 8 years ago
  • last active 8 years ago
0 votes
10k views

When I open multiple charts (they are on separate windows) they all share the same margin on the Y-Axis, any idea why this could be happening? I included a screenshot for your reference and my .xaml file.

Also, from time to time a chart will open with the labels on the X-Axis not rendered, but as soon as an update comes in or I interact with the chart they are rendered. Any thoughts? I haven’t been able to reproduce this consistently (seems random).

Thanks, Diego.

0 votes
14k views

Hello,
I have a chart with four y-axes(4 Charts in one, YAxisId’s are Ch0,Ch1,Ch2,Ch3) and want to create a Boxannotaion which range over all four charts.
How can I specify a BoxAnnotation for more than one YAxisId?
And how can i change the X;Y-Values of the box programmatically?(Example: I press a button and the box should move xx positions on the X-Axes).

0 votes
0 answers
13k views

Hi,

If I create a bubble chart with auto x-range and keep appending bubbles (so the xrange grows over time to show all the data), after a while some of the bubbles will start to flash on and off. Its as though if they are centred between pixels then the whole bubble doesn’t get drawn.

Any ideas?

Cheers
Felix

  • F W asked 9 years ago
0 votes
8k views

Hi,

I want create a chart with:
– Intraday 1 minute bar with 1 month of datas in OHLC line
– Pivots lines for each day of the months

I have 2 questions:
– What is the best renderable serie to draw the pivots line ? (I think use FastLine with IsDigital=true and XyyDataSerie)
– When I draw this chart My pivot line is concentrated at the begining (21 points) when OHLW bar take full surface (~10,000 points), why?

Thanks

  • Sylvain60 asked 9 years ago
  • last active 9 years ago
0 votes
6k views

Hello

Is there a way to hide certain parts of a FastLineRenderableSeries?
Imagine a vertical line intersecting the plot. Everything left of the line is rendered and everything right is not visible.

I came up with the following ideas:
– Implement a PaletteProvider which returns a transparent color for parts of the series to hide. This did not work: The plot was rendered in white color instead of transparent.
– Modify the underlying XyDataSeries and remove points which should be hidden.

Are there any other options?

Thanks for any assistance.
Daniel

0 votes
9k views

Hi all,

Has the IChartSeriesViewModel a property like Tag, I need to set some class and when I found it RenderSeries I need to get it back?

Thanks,
Arthur

0 votes
9k views

Hello there,

I want to switch (per ComboBox) between the data-values at the x-axis:
1. Display data index[x]
2. Display time[x]
3. Display another calculated value[x]

With LabelFormatter it works but there is an issue, My Series0 Time[x] at Index0 is not Series1 Time[x] at Index0. So if I display both series and have (1.) ‘data index’ selected than it works. If I have (2.) ‘time’ selected, it doesn’t because the Series0 Time[x] at Index0 is not Series1 Time[x] at Index0.

How can I solve this?

  • miri asked 10 years ago
0 votes
12k views

Hi,

Is it possible to have a serie of datapoints with different colors?
I’ve got data, which are movements of the body, and I would like to disable 1 or more movements from it.
The user would see the same data, but a part of the series will be a different color, so the user will see the difference between an enabled and a disabled movement (see attachments).

Is this possible in SciChart and if so, how?

Thanks,
Egbert

0 votes
12k views

Hi,

I have 4 or 8 series on screen and I want to select 1 of them to display some info about it.

How can I use the SeriesSelectionModifier with MVVM and also change the color of the selected serie.
Is it also possible to get an event when the selection has been changed?

I started with:

SeriesSelectionModifier seriesSelectionModifier = new SeriesSelectionModifier();
this.ChartModifier.ChildModifiers.Add(seriesSelectionModifier);

But don’t know how to continue.

Thanks in advance,
Egbert

  • EJansen asked 11 years ago
  • last active 6 years ago
0 votes
8k views

Hi I am using scichartsurface with multiple y axes and a single x axis. I would want the zooming to work in a block basis as shown in the attachments.
For ex: In the first attachment I am selecting the block from 08:00:00(xaxis) and 0.76(y axis), and moving on upto 09:30:00(approx) and -22(approx). So when i start zooming the area, is it possible that it selects the entire block(A block would be distance from one major grid line to the next immediate major grid line across X axis). Please refer to 2nd attachment if unclear.

Does SciChart provide any such feature?

  • Kedar k asked 9 years ago
  • last active 9 years ago
0 votes
10k views

Is it possible to run two versions of SciChart at the same time? I wanted to create a new project in my codebase using the new SciChart version 2.1, without having to upgrade my other projects referencing 1.6. Of course, I now get version conflicts in my final build. Renaming the DLL did not work, is there a way around this?

1 vote
20k views

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

  • kingsoff asked 11 years ago
  • last active 9 years ago
1 vote
12k views

Our current graphs have an additional data series to highlight the 0, or break-even line. How can I do that using SciChart without adding a data series (which would be included in the rollover feedback)?

  • Alex Lynch asked 12 years ago
  • last active 10 years ago
0 votes
5k views

Hi,

I am trying to rotate a column chart exactly like the vertical chart example with one important distinction. I would like to have the values display bottom left (low) to top right (high) for both axes. I have price (x axis) on the left and volume (y axis) on the bottom. If I simply change AxisAlignment, I end up with price going from high (bottom) to low (top) and volume going from high (left) to low (right).

The Y axis (on the bottom due to the alignment) left to right goes from 100 to 0 instead of the desired 0 to 100. The same issue exists for the X axis.

1 vote
9k views

Hi,

I observed a weird behavior with custom pointmarkers in SciChart. The issue is related to the previous one I reported, so I will not post my code snippets here, because it’s actually the same code as in the link. However, it is a different kind of issue, so I thought I should start a new thread.

Description (I attached a .gif to illustrate the issue):
Inside my RenderSurface, I have some pointmarkers which are filled with a transparent color and others which are filled with the color of the stroke of this pointmarker. Whether or not the pointmarker is filled depends on the IPointMetaData object attached to the point (and the meta data won’t change in any way).
When the chart gets displayed I have 4 pointmarkers visible. All 4 are filled, BUT only the leftmost SHOULD be filled. When I now scroll the chart to the right so that the leftmost pointmarker is not visible anymore the 3 remaining pointmarkers lose their fill and are now displayed as they should. Scrolling the first one back in the get filled again. I can only assume that this is maybe caused by SciChart cacheing some resources internally?

Important: I did only observe this issue with the Direct3D10RenderSurface. Everything works as expected with the other three surface types.

Edit:
seems like the gif animation does not work, so I added two more pictures.

DiaryPointMarker.cs

public class DiaryPointMarker : BasePointMarker
{
    private IList<IPointMetadata> _dataPointMetadata;
    IList<int> _dataPointIndexes = new List<int>();

    private readonly List<Point> _points = new List<Point>();

    public bool UseClustering { get; set; }
    public bool IndicateCommentWithFill { get; set; }

    private IPen2D _lowStrokePen;
    private IPen2D _midStrokePen;
    private IPen2D _highStrokePen;


    private IBrush2D _lowRatingColor;
    private IBrush2D _midRatingColor;
    private IBrush2D _highRatingColor;
    private IBrush2D _noCommentColor;

    public Brush LowRatingColor { get; set; }
    public Brush MidRatingColor { get; set; }
    public Brush HighRatingColor { get; set; }

    public override void BeginBatch(IRenderContext2D context, Color? strokeColor, Color? fillColor)
    {
        _dataPointMetadata = RenderableSeries.DataSeries.Metadata;

        _dataPointIndexes = new List<int>();
        _points.Clear();

        base.BeginBatch(context, strokeColor, fillColor);
    }


    public override void MoveTo(IRenderContext2D context, double x, double y, int index)
    {
        if (IsInBounds(x, y))
        {
            _dataPointIndexes.Add(index);
            _points.Add(new Point(x,y));
        }

        if (UseClustering)
        {
            base.MoveTo(context,x,y,index);
        }
    }

    public override void EndBatch(IRenderContext2D context)
    {
        if (UseClustering)
        {
            base.EndBatch(context);
        }
        else
        {
            Draw(context, _points);
            context.SetPrimitvesCachingEnabled(false);
        }
    }

    public override void Draw(IRenderContext2D context, IEnumerable<Point> centers)
    {
        TryCasheResources(context);

        var markerLocations = centers.ToArray();

        for (int i = 0; i < markerLocations.Length; ++i)
        {
            var diaryMetaInfo = _dataPointMetadata[_dataPointIndexes[i]] as DiaryPointMetaData;

            var center = markerLocations[i];

            var strokePen = diaryMetaInfo.Rating < 60
                ? _lowStrokePen
                : diaryMetaInfo.Rating < 80 ? _midStrokePen : _highStrokePen;
            var fillBrush = diaryMetaInfo.Rating < 60
                ? _lowRatingColor
                : diaryMetaInfo.Rating < 80 ? _midRatingColor : _highRatingColor;

            context.DrawEllipse(
                strokePen,
                IndicateCommentWithFill ? (String.IsNullOrEmpty(diaryMetaInfo.Comment) ? _noCommentColor : fillBrush) : fillBrush,
                center,
                Width,
                Height
                );
        }
    }

    private void TryCasheResources(IRenderContext2D context)
    {
        _lowStrokePen = _lowStrokePen ?? context.CreatePen(LowRatingColor.ExtractColor(), AntiAliasing, (float)StrokeThickness, Opacity);
        _midStrokePen = _midStrokePen ?? context.CreatePen(MidRatingColor.ExtractColor(), AntiAliasing, (float)StrokeThickness, Opacity);
        _highStrokePen = _highStrokePen ?? context.CreatePen(HighRatingColor.ExtractColor(), AntiAliasing, (float)StrokeThickness, Opacity);

        _lowRatingColor = _lowRatingColor ?? context.CreateBrush(LowRatingColor);
        _midRatingColor = _midRatingColor ?? context.CreateBrush(MidRatingColor);
        _highRatingColor = _highRatingColor ?? context.CreateBrush(HighRatingColor);
        _noCommentColor = _noCommentColor ?? context.CreateBrush(Color.FromArgb(0, 0, 0, 0));
    }
}
0 votes
10k views

Hi,

I would like to show series value labels on my vertical line annotation, but with the following specifics:

1) The label should should look like the series value label that appears on the y-axis i.e. it should have the colour of the series and have a nice little luggage-label shape

2) The label should always be visible and should show the value of the nearest point in each series (with no distance limit)

How can I achieve this?

Thanks!
Felix

  • F W asked 9 years ago
  • last active 9 years ago
0 votes
0 answers
10k views

Hi Andrew, Support Guys,

I have a little question.
In my chart i have a chart series XyScatterRenderableSeries DateTime, float which is working fine, on it i have placed the standard tooltip :

……

where i am showing SeriesName, YValue, XValue.

The question is: in my Dataseries i would like to add to every datapoint additional info like IDNum, Value , etc. and then be able to show this additional info when using the tootip on that point in the chart toghether with the ones already shown.

Which could be the correct approch to achieve this?

Another question…..
I am looking also on the multiple X-Axes example where you are placing top and bottom Axis.
My problem is that in my Dataseries i have two DateTime values for one point , i.e if i have a value 1.1/1-feb-2014/StartTime(0) then sencond point will have value 1.2/1-Feb-2014+1hour/StartTime(0)+1hour…. and so on. The goal is to show theese two different datetime XAsis for the same points.How can this be done ?
Is it also possible to have theese two different X-Axes both on the bottom of the chart.

Many Thanks

Cheers
Giuseppe

  • jp13 asked 10 years ago
1 vote
14k views

I have a chart with a range of 0..1000(xAxis)
Secondly i call;

var xCalc = this.XAxis.GetCurrentCoordinateCalculator();
double xDataValue = xCalc.GetCoordinate(500);

xDataValue is for example equal 500;

Next step:
I change the range via:

XAxis.VisibleRange.SetMinMax(1000,2000)
// Secondly i call;
var xCalc = this.XAxis.GetCurrentCoordinateCalculator();
double xDataValue = xCalc.GetCoordinate(1500);

xDataValue shall also be equal 500 or? (but it is negative -XXX)???

I call

SciChart.XAxis.VisibleRange.SetMinMax(min, max);

in my ChartViewModel and

var xCalc = this.XAxis.GetCurrentCoordinateCalculator();
double xDataValue = xCalc.GetCoordinate(1500);

in my ChartModifier..

1 vote
13k views

Hello,

Do you have any further examples of binding the SciChart data series to a property of the items in an observable collection?

I have declared an Observable Collection made of objects called “Tab”:

public Observable Collection<Tab> TabList;

Each Tab has a property called “DataSeries”:

public XyDataSeries<double,double> DataSeries { get; set;}

I am trying to bind the SeriesSource property of the chart to the DataSeries property of every Tab.
The chart should be made up of multiple line series, one for every Tab in TabList.

My closest attempt was creating another object called ChartSeriesViewModel:

public class ChartSeriesViewModel : ViewModelBase
    {
        private ObservableCollection<IChartSeriesViewModel> _seriesSource =  new ObservableCollection<IChartSeriesViewModel>();

        public ObservableCollection<IChartSeriesViewModel> SeriesSource
        {
            get { return _seriesSource; }
        }
    }

Binding the chart to its SeriesSource property:

<sciChart:SciChartSurface DebugWhyDoesntSciChartRender="True" SeriesSource="{Binding ChartSeries.SeriesSource}" (...) />

And then populating it from each Tab.DataSeries :

_lineSeries = new FastLineRenderableSeries();
                foreach (Tab tab in TabList)
                {
                    tab.AppendSeries();
                    _chartSeries.SeriesSource.Add(new Abt.Controls.SciChart.ChartSeriesViewModel(tab.DataSeries, _lineSeries));
                }

When I did this is seemed like the DataSeries were created but not linked to the RenderableSeries as the chart debug gave the error: “none of the SciChartSurface.RenderableSeries has a DataSeries assigned”.

I would prefer to have the SeriesSource binded directly to the DataSeries property of every Tab item instead of populating another object from Tab.DataSeries as the second method won’t allow live chart update.

Regards,
Simon.

1 vote
26k 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 9 years ago
  • last active 9 years ago
0 votes
8k views

I want to align my left YAaxis labels to right and fixed label width. I use Spectrogram view and want to align the left edges of those charts. (I’m using version 4.0.2)

This is my style definition:

 <Style x:Key="LeftAxisLabelStyle" TargetType="s:DefaultTickLabel">
    <Setter Property="HorizontalAnchorPoint" Value="Right"/>
    <Setter Property="Width" Value="20"/>
 </Style>

but unfortunately it doesn’t work.

0 votes
17k views

How to change background color of rendersurface?)

Thanks!

  • butek asked 10 years ago
  • last active 7 years ago
0 votes
10k views

Hi,

I’m having an exception thrown when I try to dynamically add an annotation. I’m using the example on your site as reference.I’m sure its something I’m overlooking. But I can’t figure out what it is. I have attached my code here, can you tell me what I’m doing wrong here. I’m trying to add a Line annotation when the user clicks on the context menu.

Thanks,
Deepak

0 votes
19k 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 11 years ago
  • last active 9 years ago
0 votes
13k views

I have a panel with two charts, that contains a OhlsDataSeries and theirs XAxis is DateTimeAxis. When it zooms i see a something strange:
strange stretch

My code:

<s:SciChartSurface SeriesSource="{Binding ChartSeriesViewModels}"
                   s:SciChartGroup.VerticalChartGroup="{Binding Parent.VerticalChartGroupId}"
                   ViewportManager="{Binding Parent.ViewportManager}">
    <s:SciChartSurface.ChartModifier>
        <s:ModifierGroup s:MouseManager.MouseEventGroup="23">
            <s:ZoomPanModifier ExecuteOn="MouseLeftButton"/>
            <s:MouseWheelZoomModifier />
            <s:CursorModifier ShowAxisLabels="True" UseInterpolation="False" UseLayoutRounding="True"  ReceiveHandledEvents="True"/>
            <s:YAxisDragModifier/>
            <s:XAxisDragModifier/>
            <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"/>
        </s:ModifierGroup>
    </s:SciChartSurface.ChartModifier>

    <s:SciChartSurface.XAxis>
        <s:DateTimeAxis VisibleRange="{Binding Parent.VisibleRange, Mode=TwoWay}"
                        TextFormatting="hh:mm dd.MM.yyyy"
                        DrawMajorBands="True"
                        GrowBy="0.0, 0.1"/>
    </s:SciChartSurface.XAxis>

    <s:SciChartSurface.YAxis>
        <s:NumericAxis AutoRange="Always"
                       GrowBy="0.1, 0.1"/>
    </s:SciChartSurface.YAxis>

</s:SciChartSurface>

And second question:
Is there any way to make the cursor sticks to the points?

  • l1pton17 asked 10 years ago
  • last active 10 years ago
0 votes
9k views

Hi,

Can I have multiple YAxis in SciStockChart?

Thanks,
Arthur

0 votes
8k views
1 vote
10k views

Hi,

I would like to ask if there is any easy way to select distict time intervals.
I have thought of creating vertical slices on mouse down and up events,
and highlighting the surface between the slices. Is there an easier way
to do this?

Thanks,
Chris

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
0 votes
0 answers
9k views

We are pleased to announce SciChart v1.6.0 Build 2281 has been released. This is an important maintenance update which includes many fixes for bugs reported on our forums in February 2013 and March 2013.

As of today, you will be able to download v1.6.0.2281 on our Downloads page. If you are a source code customer you will receive an email with updated package detail shortly.

SciChart v1.6.0.2281 Release What’s New (10th Apr 2013)

Change Log

  • Added compilation output for x86, x64, AnyCPU for .NET4.0, 4.5 so you can now use SciChart in mixed managed/native applications without recompiling from source
  • Added SciChart DLLs now discoverable from Visual Studio Add-References Dialog without browsing to install directory
  • Added SciChartSurface RenderPriority.Manual option, where you can call SciChartSurface.InvalidateElement() manually to redraw after data-append
  • Added ZoomPanModifier.ZoomExtentsY property to enable/disable Y-Axis autorange when panning in X
  • Added ZoomExtentsModifier.XYDirection property
  • Added ClipMode.ClipAtMax for ZoomPanModifier to prevent panning past the end of the dataset
  • Added FastColumnRenderableSeries.UniformWidth property to assist with issue of column widths on variably spaced data
  • Added DataSeries.InsertRange() method
  • Added DataSeries.RemoveRange() method
  • Exposed SciChartOverview.BackgroundChartSurface property to access the inner SciChartSurface
  • Added Abt.Controls.SciChart.Wpf.dll and Abt.Controls.SciChart.SL.dll to the registry so it appears in Visual Studio Add References dialog
  • Fixed Numeric Precision issue where NumericAxis.VisibleRange was small, chart became blank (rendered no ticks)
  • Fixed FastBandRenderableSeries.IsDigitalLine band fill drawing anomaly
  • Added default Rollover Template for FastImpulseRenderableSeries
  • Fixed an issue databinding to DateTimeAxis.MinorDelta and MajorDelta
  • Fixed a Y=Const ZoomExtents issue
  • Fixed a ZoomExtents bug with DataSeries.RemoveAt()
  • Fixed AnnotationLabels don’t react on LabelPlacement changes
  • Fixed Call to Annotation.Hide() hides an annotaiton but labels become visible after invalidating
  • Fixed VerticalLineAnnotation LabelPlacement issues
  • Fixed discrepancy between Rollover Line Marker in Line & Scatter Chart
  • Fixed Surface parts Selection through Navigation Keys
  • Fixed incorrect XMinPositive value on DataSeries after append range of elements
  • Fixed a bug in ModifyAxisProperties example where calendar update resulted in a crash
  • Fixed a memory leak when adding/removing/re-adding annotations
  • Fixed a NullReferenceException when Y=Const and we use RubberBandXyZoomModifier
  • Fixed Designer showing Your Trial has Expired even if a valid key is present
0 votes
10k views

Hi,

I found the solution in this thread to bind multiple YAxes via Binding
http://http://www.scichart.com/questions/question/multiple-y-axes-via-binding/?view=all#post-1095

Example works great but it is very slow.

I want to use this for adding 4 Yaxis with 3000 datapoints / axis.
It almost takes 8 seconds before data is displayed on screen.
How can we speed this up because we can not present this to our customer?

0 votes
9k views

Hello,

I have a problem: I’m creating FastLineRenderableSeries with big StrokeThickness value. The bigger this value is the slower my program works.

Is there any way to speed it up in this situation?

P.S. I’ve attached project below.

Thanks in advance.

  • Egor asked 8 years ago
  • last active 8 years ago
0 votes
15k views

I am using the Vertically Stacked Axis example and I would like to set the (initial?) maximum of all the y-axis to the maximum of all the y-axis and the minimum to the minimum of all y-axis. In other words I want that everything use the same YAxis scales. Is there a way to to do this easily? or do I just have to set y min and max in the code for all charts/channels?

  • Michel Moe asked 9 years ago
  • last active 9 years ago
Showing 1 - 50 of 4k results