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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

0
0

i have a problem with zoom : i can’t declare my function for charting inside the constructor of my class no also in the function loaded for the simple reason because i must pass two list for this function “public void CreateDataSetAndSeries(List lstX, List lstY)”, so, i create my function like this in my .XAM.cs class :

public void CreateDataSetAndSeries(List lstX, List lstY)
{
series0 = new XyDataSeries<DateTime, double>();

        using (this.sciChartSurface.SuspendUpdates())
        {

               series0.Append(lstX, lstY);

        }           
        lineSeries.DataSeries = series0;
        sciChartSurface.ZoomExtentsY();
   }

and for my class.xaml i write this :
<SciChart:SciChartSurface.ChartModifier>

<SciChart:RubberBandXyZoomModifier/>

                <SciChart:ZoomPanModifier ExecuteOn="MouseRightButton"/>
                    <SciChart:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"/>

                <SciChart:CursorModifier ReceiveHandledEvents="True" ShowAxisLabels="True"  ShowTooltip="True" ShowTooltipOn="MouseRightButtonDown"/>

the problem i can’t did the zoom So what i can do ?
waiting for your response thank you !

  • You must to post comments
0
0

Hi all,
This is my code Xaml and i change the AutoRange=”Always” to AutoRange=”Never” the problem is resolved but another problem has arised. In fact, my graph isn’t been refreshed in real time and that i must double click in the chart area to draw it
have you any idea to did the zoom and drawing the graph normally without refresh it every once ??!!! Thank you !
<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:s=”http://schemas.abtsoftware.co.uk/scichart”

         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"           
         xmlns:SciChart="http://schemas.abtsoftware.co.uk/scichart" 
         mc:Ignorable="d"  
         Loaded="sciChartSurface_Loaded"
         d:DesignHeight="300" d:DesignWidth="826">



<Grid>


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

    <!-- Define the SciChartSurface -->
    <SciChart:SciChartSurface Grid.Row="2" x:Name="sciChartSurface" Padding="10,10,80,10" SciChart:ThemeManager.Theme="Oscilloscope" MouseUp="sciChartSurface_MouseUp" GotMouseCapture="sciChartSurface_GotMouseCapture" MouseDown="sciChartSurface_MouseDown">

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

        </SciChart:SciChartSurface.RenderableSeries>

        <!-- Create an X Axis -->
        <SciChart:SciChartSurface.XAxis>
            <SciChart:DateTimeAxis x:Name="XAxis" AutoRange="Never"  TextFormatting="HH:mm MMM dd" SubDayTextFormatting="HH:mm:ss MMM dd"/>
        </SciChart:SciChartSurface.XAxis>

        <!-- Create a Y Axis -->
        <SciChart:SciChartSurface.YAxis>
            <SciChart:NumericAxis Name="YAxis" AutoRange="Never" DrawMinorTicks="True" DrawMinorGridLines="true" DrawLabels ="true" DrawMajorGridLines="true" TextFormatting="0.0000" >
                <SciChart:NumericAxis.GrowBy>
                    <SciChart:DoubleRange Min="0.1" Max="0.1"/>
                </SciChart:NumericAxis.GrowBy>
            </SciChart:NumericAxis>
        </SciChart:SciChartSurface.YAxis>
        <!--  Add some modifiers to zoom, zoom extents  -->
        <SciChart:SciChartSurface.ChartModifier>              
                <SciChart:ModifierGroup>
                <SciChart:XAxisDragModifier></SciChart:XAxisDragModifier>
                <SciChart:YAxisDragModifier AxisId="SecondaryAxisId"></SciChart:YAxisDragModifier>
                <SciChart:YAxisDragModifier AxisId="PrimaryAxisId"></SciChart:YAxisDragModifier>
                            <SciChart:LegendModifier ShowLegend="false" ShowVisibilityCheckboxes="False" Margin="3"/>
                            <SciChart:RubberBandXyZoomModifier/>

                <SciChart:ZoomPanModifier ExecuteOn="MouseRightButton"/>
                    <SciChart:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"/>

                <SciChart:CursorModifier ReceiveHandledEvents="True" ShowAxisLabels="True"  ShowTooltip="True" ShowTooltipOn="MouseRightButtonDown"/>

                    <!-- For the circle Marks -->                     
           <!--    -->                       
            </SciChart:ModifierGroup>                        
        </SciChart:SciChartSurface.ChartModifier>          
    </SciChart:SciChartSurface>

    <!-- Define the Toolbar -->
    <StackPanel Grid.Row="0" Margin="2,4"  HorizontalAlignment="Left" Orientation="Horizontal">
        <Label x:Name="measureLabel1"  Margin="5"  Foreground="Green" FontStyle="Normal" FontSize="15" FontStretch="UltraCondensed"/>
        <Label x:Name="unit"  Margin="2"  Foreground="Green" FontStyle="Normal" FontSize="10" FontStretch="UltraCondensed"/>
    </StackPanel>

        <!-- Define the Toolbar verticale -->
    <StackPanel Grid.Row="1" HorizontalAlignment="Right" Orientation="Vertical" Width="80">
        <StackPanel.Background>
            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                <GradientStop Color="Black" Offset="0" />
                <GradientStop Color="#FFCDFFDC" Offset="1" />
            </LinearGradientBrush>
        </StackPanel.Background>
        <!-- Update Theme -->
        <GroupBox Header="Theme" Height="86" Name="groupBox2" Width="68" BorderBrush="#FFE2E226" FontSize="11" ForceCursor="False">
            <!-- -->
            <Grid Height="62" Width="66">
                <Grid.RowDefinitions>
                    <RowDefinition Height="35*" />
                    <RowDefinition Height="29*" />
                </Grid.RowDefinitions>
                <ComboBox x:Name="cboTheme" MinWidth="50" Margin="2,16,12,26" SelectionChanged="cboThemeChanged" Grid.RowSpan="2" />
            </Grid>
            <GroupBox.Foreground>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF449D92" Offset="1" />
                </LinearGradientBrush>
            </GroupBox.Foreground>
        </GroupBox>
        <GroupBox Header="Symboles" Height="95" Name="groupBox1" Width="70" BorderBrush="#FFE2E226">
            <GroupBox.Foreground>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FFFFFF31" Offset="1" />
                    <GradientStop Color="#FFF1F12E" Offset="0.948" />
                    <GradientStop Color="#FF09D1DD" Offset="0.919" />
                    <GradientStop Color="#FF07AEB8" Offset="0.767" />
                    <GradientStop Color="#FFC0EA52" Offset="0.942" />
                    <GradientStop Color="#FFF3F32E" Offset="0.959" />
                    <GradientStop Color="#FFC0EA52" Offset="0.942" />
                    <GradientStop Color="#FFF8F82F" Offset="0.977" />
                    <GradientStop Color="#FF60DC9A" Offset="0.93" />
                    <GradientStop Color="#FF116C6C" Offset="0.878" />
                </LinearGradientBrush>
            </GroupBox.Foreground>
            <Grid Height="39" Width="51">
                <RadioButton x:Name="rdioBtCircle" Content="Circle" BorderThickness="4" Margin="-4,-8,-20,0" Foreground="White" FontSize="10" FontStretch="UltraCondensed" Checked="rdioBtCircle_Checked"  Height="36" VerticalAlignment="Top"/>
                <RadioButton x:Name="rdioBtCarre" Content="Square" BorderThickness="4" Margin="-4,9,-21,6" Foreground="White" FontSize="10" FontStretch="UltraCondensed" />
                <RadioButton x:Name="rdioBtTriangle" Content="Triangle" BorderThickness="4" Margin="-4,6,-21,-20" Foreground="white" FontSize="10" FontStretch="UltraCondensed" Height="14"  />
                <RadioButton x:Name="rdioBtSans" Content="None" BorderThickness="4" Foreground="white" FontSize="10" FontStretch="UltraCondensed" Margin="-4,42,2,-15" />
            </Grid>
        </GroupBox>
        <Button Click="CopyToClipboardClick" Content="Copy to Clipboard" Height="30" />
        <Button Click="SaveAsPngClick" Content="Save to PNG" Height="30" />
        <Button Margin="3" Click="PrintToXpsClick" Content="Print" Height="30" Width="75" />
    </StackPanel>

    <Label x:Name="graphPaneTitle"  Margin="5" HorizontalAlignment="Center"  Foreground="Black" FontStyle="Italic" FontSize="18" FontStretch="UltraCondensed"/>
</Grid>

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.