Hi all,
I'm trying to set RadChart's values from OADate to formatted datetime string. It's ok for x-axis value but when I try to set tooltip as formatted datetime string it's confusing.
Anyway you may see a screenShot about this issue at "tooltip.png" file.
And my whole code is below
Anyone knows how to deal with this issue?
And finally I have to use OADate ;o))
I'm trying to set RadChart's values from OADate to formatted datetime string. It's ok for x-axis value but when I try to set tooltip as formatted datetime string it's confusing.
Anyway you may see a screenShot about this issue at "tooltip.png" file.
And my whole code is below
using System;
using System.Collections.Generic;
using System.Windows.Controls;
using Telerik.Windows.Controls.Charting;
namespace TelerikSL4
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
var lst = new List<
Values
>();
Random rand = new Random();
for (int i = 0; i < 1000; i++)
lst.Add(new Values { date = DateTime.Now.AddDays(i).ToOADate(), value = rand.Next(10, 100) });
radChart1.DefaultView.ChartArea.AxisX.IsDateTime = true;
radChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "dd/MM HH:mm";
radChart1.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 2;
radChart1.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollAndZoom;
radChart1.DefaultView.ChartArea.ZoomScrollSettingsY.ScrollMode = ScrollMode.ScrollAndZoom;
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition = new LineSeriesDefinition();
seriesMapping.SeriesDefinition.ShowItemLabels = false;
seriesMapping.SeriesDefinition.ShowItemToolTips = true;
seriesMapping.SeriesDefinition.LegendDisplayMode = LegendDisplayMode.SeriesLabel;
seriesMapping.LegendLabel = "Telerik";
seriesMapping.SeriesDefinition.ItemToolTipFormat = seriesMapping.LegendLabel + "\n#X{dd.MM.yyyy HH:mm}\n#Y";
seriesMapping.ItemMappings.Add(new ItemMapping("date", DataPointMember.XValue));
seriesMapping.ItemMappings.Add(new ItemMapping("value", DataPointMember.YValue));
radChart1.SeriesMappings.Add(seriesMapping);
radChart1.ItemsSource = lst;
}
public class Values
{
public double date { get; set; }
public double value { get; set; }
}
}
}
Anyone knows how to deal with this issue?
And finally I have to use OADate ;o))