This is a migrated thread and some comments may be shown as answers.

Time formatted X-Axis

6 Answers 220 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Libertad
Top achievements
Rank 1
Libertad asked on 31 May 2011, 06:55 PM
hi,

I'm reading a column from a Excel file including time data with hh:mm:ss format.
I couldn't show them properly using RadChart in X-Axis. I've used the following code:

radChart.DefaultView.ChartArea.AxisX.IsDateTime = true;
radChart.DefaultView.ChartArea.AxisX.Step = 5;
radChart.DefaultView.ChartArea.AxisX.LabelStep = 2;
radChart.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 3;
radChart.DefaultView.ChartArea.AxisX.StepLabelLevelHeight = 10;
radChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "hh:mm:ss";

in X-Axis it only shows 00:00 !?
What's the solution?

6 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 06 Jun 2011, 11:38 AM
Hi Libertad,

Please excuse us for the delay.

Regarding your issue, the X axis makes all the needed range calculations and when there is data for the past several days it displays the steps as one day, therefore each tick is 00:00.

You can use the following options.
1. Use Categories. See the link below for more information:
http://www.telerik.com/help/silverlight/radchart-features-categorical-charts.html
2. You could also set the AxisX.AutoRange to false and pass only min, max and step parameters(i.e. AxisX.AddRange(min, max, step)).

You can also find useful information about DateTime Support here:
http://www.telerik.com/help/silverlight/radchart-features-datetime-support.html

If you need any further help, please do not hesitate to ask.
 

Greetings,
Petar Horozov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Libertad
Top achievements
Rank 1
answered on 07 Jun 2011, 08:51 AM
Dear Petar
Thanks for your reply.
I even applied AddRange method in my code but I still have problem with time formatting.
How can I attache my sample here?
Thank you in advance.
0
Peshito
Telerik team
answered on 10 Jun 2011, 09:12 AM
Hello Libertad,

I attached a sample project that should be similar to yours. Please take a look at it and you may find it helpful.

You can also refer to the following topics below.
http://www.telerik.com/help/wpf/radchart-features-datetime-support.html
http://www.telerik.com/help/wpf/radchart-getting-started-create-data-bound-chart.html

For security reasons zip attachments are not allowed in the public forums but you can open a formal support ticket and send us your sample application should you have further questions.


Greetings,
Peshito
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Libertad
Top achievements
Rank 1
answered on 10 Jun 2011, 03:14 PM
Hi,
Due to dynamic issue I have to configure my chart in code behind not xaml.
I wonder if you do some changes in my sample to solve the problem instead of creating new sample from scratch.
Thanks.
0
Libertad
Top achievements
Rank 1
answered on 14 Jun 2011, 07:01 PM
No answer?
0
Accepted
Peshito
Telerik team
answered on 15 Jun 2011, 02:30 PM
Hi Libertad,

I suggest that we keep the conversation in a single thread so that it is easier for both sides to follow it.

I edited the project you've attached in the other thread started by you and attached it to this one.

The reason why your values are displayed as 00:00 is because you've made new SeriesMapping instance in your for loop. At the end of the for loop, I simply added the following code:
seriesMapping.ItemMappings.Add(itemMappingX);


Regards,
Peshito
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Libertad
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Libertad
Top achievements
Rank 1
Peshito
Telerik team
Share this question
or