Pre loader

Using date and time for chart

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


I am trying to use date and time for X axis however

it doesn’t not work for me and I am not understanding what I did wrong

attaching the xaml and cs code:


public partial class MainWindow : Window
public MainWindow()


    private void sciChartSurface_Loaded(object sender, RoutedEventArgs e)
        //var scatterData = new XyDataSeries<double, double>();
        var lineData = new XyDataSeries<DateTime, double>();
        //var lineData = new XyDataSeries<double, double>();

        DateTime dt = DateTime.Now;
        for (int i = 0; i < 10; i++)
            lineData.Append(dt, i);


        // Assign dataseries to RenderSeries
        LineSeries.DataSeries = lineData;
        lineData.SeriesName = "Barak";
         ScatterSeries.DataSeries = scatterData;
         scatterData.SeriesName = "Barak2";

        //ScatterSeries.DataSeries = scatterData;


            <s:FastMountainRenderableSeries x:Name="LineSeries" Stroke="#FF4083B7"/>
            <s:XyScatterRenderableSeries x:Name="ScatterSeries" >
                    <s:EllipsePointMarker Width="7" Height="7" Fill="#FFF" Stroke="SteelBlue"/>

            <s:NumericAxis AxisTitle="Number of sampeles"></s:NumericAxis>

            <s:NumericAxis AxisTitle="Values"></s:NumericAxis>

            <s:TextAnnotation Text="Hello world!" X1="5.0" Y1="5.0"/>

                <!-- Allow drag to zoom on Left mouse -->
                <s:RubberBandXyZoomModifier ExecuteOn="MouseLeftButton"
                                             RubberBandFill="#33FFFFFF" RubberBandStroke="#AAFFFFFF"
                                             RubberBandStrokeDashArray="2 2"/>
                <!-- Allow pan on Right mouse drag -->
                <s:ZoomPanModifier ExecuteOn="MouseRightButton" ClipModeX="None" />
                <!-- Allow Dragging YAxis to Scale -->
                <s:YAxisDragModifier DragMode="Scale"/>
                <!-- Allow Dragging XAxis to Pan -->
                <s:XAxisDragModifier DragMode="Pan"/>
                <!-- Allow Mousewheel Zoom -->
                <!-- Allow Zoom to Extents on double click -->
                <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" />
                <s:LegendModifier ShowLegend="True" Orientation="Horizontal"
                                   LegendPlacement="Inside" />
                <!-- Add a RolloverModifier to the chart (shows vertical line tooltips -->
                <s:RolloverModifier ExecuteOn="MouseMove" ShowTooltipOn="MouseHover"/>





  • You must to post comments

Hi Barak,

Thanks for your question.

There is a special DateTimeAxis type for DateTime data. Please take a look at our documentation:

And our Digital Mountain Chart example. DateTimeAxis is used here:

Hope this helps.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.