or
Hello Everyone,
I am creating a chart to display real-time data that is "polled" every 5 seconds. Additionally, my chart can contain multiple data series all of which will be spline. If I let the chart auto calculate the X axis bounds and ticks, it is extremely slow in displaying initial values. So I want to set the X axis manually. Here is the code I have so far:
radChart1.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Normal; |
radChart1.DefaultView.ChartArea.AxisX.IsDateTime = true; |
radChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "T"; |
radChart1.DefaultView.ChartArea.AxisX.AutoRange = false; |
DateTime MinVal = DateTime.Now; |
DateTime MaxVal = MinVal + TimeSpan.FromSeconds(UpdateInterval * (NumDataPoints + 1)); |
radChart1.DefaultView.ChartArea.AxisX.AddRange(MinVal.ToOADate(), MaxVal.ToOADate(), 1.0); |
radChart1.DefaultView.ChartArea.AxisX.Step = 0.05; |
radChart1.DefaultView.ChartArea.AxisX.LabelStep = 1; |
<telerik:InformationLayer x:Name="informationLayer" |
ItemsSource="{Binding Path=LocationData.SearchResult}"> |
<telerik:InformationLayer.ItemTemplate> |
.... |
public ObservableCollection<Location> SearchResult { get; private set; } |
private void geoHelper_SearchCompleted(object sender, LocSearchCompletedEventArgs e) |
{ |
SearchResult.Clear(); |
var searchResult = e.Locations as ObservableCollection<MyMapItem>; |
foreach(MyMapItem loc in searchResult) |
SearchResult.Add(loc.Location); |
} |
<telerik:InformationLayer x:Name="informationLayer" |
ItemsSource="{Binding Path=LocationData.SearchResult.Location}"> |
<telerik:InformationLayer.ItemTemplate> |
.... |
public class MyMapItem |
{ |
public Location Location |
{ |
get; |
set; |
} |
public string Title |
{ |
get; |
set; |
} |
public string Description |
{ |
get; |
set; |
} |
} |
public ObservableCollection<MyMapItem> SearchResult { get; private set; } |
private void geoHelper_SearchCompleted(object sender, LocSearchCompletedEventArgs e) |
{ |
SearchResult.Clear(); |
var searchResult = e.Locations as ObservableCollection<MyMapItem>; |
foreach(MyMapItem loc in searchResult) |
SearchResult.Add(loc); |
} |