Hi prayag,
Even though you can set
custom format string for your
item.Label as shown in the code snippet below, this won't affect the Data Table's values. Unfortunately there is no way to set format for the values in the Data Table.
protected void Page_Load(object sender, EventArgs e)
{
RadChart1.AutoLayout = true;
ChartSeries s = new ChartSeries();
Random r = new Random();
const double hourStep = 1 / 24.0;
const double minuteStep = hourStep / 60;
const double twentyMinuteStep = minuteStep * 20;
double startTime = DateTime.Now.AddHours(-1).ToOADate();
double endTime = DateTime.Now.ToOADate();
for (double currentTime = startTime; currentTime < endTime; currentTime += twentyMinuteStep)
{
ChartSeriesItem item = new ChartSeriesItem();
item.YValue = currentTime + r.NextDouble() * twentyMinuteStep;
item.Label.TextBlock.Text = DateTime.FromOADate(item.YValue).ToString("hh:mm");
s.Items.Add(item);
}
RadChart1.AddChartSeries(s);
RadChart1.PlotArea.YAxis.AxisMode = ChartYAxisMode.Extended;
RadChart1.PlotArea.YAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortTime;
RadChart1.PlotArea.YAxis.AutoScale = false;
RadChart1.PlotArea.YAxis.AddRange(startTime, endTime, twentyMinuteStep);
s.Appearance.LabelAppearance.Visible = true;
}
Kind regards,
Evgenia
the Telerik team