AlexeyRedko Posted June 1, 2011 Report Share Posted June 1, 2011 Hello! I create the array of points with x values that are very big and the distance between them is very small.When I try to run application it stucks this is XAML < Window x:Class="CustomSteps.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" xmlns:cfx="http://schemas.softwarefx.com/chartfx/wpf/80"> <Grid> <cfx:Chart Name="chart" /></Grid> </ Window> and code behind: /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); ReloadData(); } public struct MyPoint { public double X { get;set; } public double Y { get;set; } public DateTime Time { get;set; } } private void ReloadData() { MyPoint[] data1 = new MyPoint[30]; FillData(data1, 1); SeriesAttributes sa1 = new SeriesAttributes(); sa1.ItemsSource = data1; chart.Series.Add(sa1); Pane pane = new Pane();Axis ax1 = new Axis(); ax1.Min = 0; ax1.Max = 10; this.chart.Panes.Add(pane); pane.Series.Add(sa1); sa1.AxisY = ax1; sa1.AxisX = chart.AxisX;sa1.BindingPathX = "X"; sa1.BindingPath = "Y";pane.AxesY.Add(ax1);chart.PanesPanel = new StackPanePanel(); chart.AxisX = new Axis(); chart.AxisX.DataPath = "X"; chart.AxisX.DataFormat.Format = AxisFormat.Number;chart.AxisX.Labels.Format = AxisFormat.Number; chart.AxisX.DataFormat.Decimals = 10; chart.AxisX.GetLabel += new AxisLabelEventHandler(AxisX_GetLabel); } void AxisX_GetLabel(object sender, AxisLabelEventArgs e) { Trace.TraceInformation("{0}",e.Text); } private void FillData(MyPoint[] data1, double factor) { DateTime time = DateTime.Now;for (int i = 0; i < data1.Length; i++) { data1.X = time.Ticks; time = time.AddTicks(50); data1.Y = i; } } } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.