There are data for whole year with 1 minute time step. It's 525,600 points.
I'm trying to use DateTimeContinuousAxis, but its properties behavior is really strange.
I need ticks for first minute of each day. But setting MajorStep="1" MajorStepUnit="Day" results in attached image. (It results in 1 tick per 2 hours for some reason)
Is there way to get one tick for day?
Note, that I also use Pan/Zoom feature.
Thanks,
Michael
MainWindow.xaml.cs
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DataContext = this;
var c = 365*24*60;
var data = new List<Step>(c);
var random = new Random();
for (var minute = 0; minute < c; minute++)
{
var date = new DateTime(2006, 1, 1) + TimeSpan.FromMinutes(minute);
var value = random.Next(1800, 2000);
data.Add(new Step {Value = value, Date = date});
}
Data = data;
}
public static readonly DependencyProperty DataProperty = DependencyProperty.Register("Data",
typeof (IEnumerable<Step>), typeof (MainWindow), new PropertyMetadata(null));
public IEnumerable<Step> Data
{
get { return (IEnumerable<Step>) GetValue(DataProperty); }
set { SetValue(DataProperty, value); }
}
}
public class Step
{
public Double Value { get; set; }
public DateTime Date { get; set; }
}
MainWindow.xaml
<Window x:Class="telerik_chart_big_data.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow" Height="350" Width="525">
<Grid>
<telerik:RadCartesianChart x:Name="Chart" Zoom="12.1,1" PanOffset="0,0" MaxZoom="365,1">
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal"/>
</telerik:RadCartesianChart.Behaviors>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:DateTimeContinuousAxis Title="X" LabelFitMode="MultiLine" PlotMode="OnTicks" MajorStep="1" MajorStepUnit="Day"/>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Title="Y"/>
</telerik:RadCartesianChart.VerticalAxis>
<telerik:LineSeries ItemsSource="{Binding Data}" RenderMode="Light" ValueBinding="Value" CategoryBinding="Date" Stroke="Red"/>
</telerik:RadCartesianChart>
</Grid>
</Window>
I'm trying to use DateTimeContinuousAxis, but its properties behavior is really strange.
I need ticks for first minute of each day. But setting MajorStep="1" MajorStepUnit="Day" results in attached image. (It results in 1 tick per 2 hours for some reason)
Is there way to get one tick for day?
Note, that I also use Pan/Zoom feature.
Thanks,
Michael
MainWindow.xaml.cs
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DataContext = this;
var c = 365*24*60;
var data = new List<Step>(c);
var random = new Random();
for (var minute = 0; minute < c; minute++)
{
var date = new DateTime(2006, 1, 1) + TimeSpan.FromMinutes(minute);
var value = random.Next(1800, 2000);
data.Add(new Step {Value = value, Date = date});
}
Data = data;
}
public static readonly DependencyProperty DataProperty = DependencyProperty.Register("Data",
typeof (IEnumerable<Step>), typeof (MainWindow), new PropertyMetadata(null));
public IEnumerable<Step> Data
{
get { return (IEnumerable<Step>) GetValue(DataProperty); }
set { SetValue(DataProperty, value); }
}
}
public class Step
{
public Double Value { get; set; }
public DateTime Date { get; set; }
}
MainWindow.xaml
<Window x:Class="telerik_chart_big_data.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow" Height="350" Width="525">
<Grid>
<telerik:RadCartesianChart x:Name="Chart" Zoom="12.1,1" PanOffset="0,0" MaxZoom="365,1">
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal"/>
</telerik:RadCartesianChart.Behaviors>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:DateTimeContinuousAxis Title="X" LabelFitMode="MultiLine" PlotMode="OnTicks" MajorStep="1" MajorStepUnit="Day"/>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Title="Y"/>
</telerik:RadCartesianChart.VerticalAxis>
<telerik:LineSeries ItemsSource="{Binding Data}" RenderMode="Light" ValueBinding="Value" CategoryBinding="Date" Stroke="Red"/>
</telerik:RadCartesianChart>
</Grid>
</Window>