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

Silverlight Reportviewer and chart YAxis item labels

2 Answers 43 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kobus
Top achievements
Rank 1
Kobus asked on 24 Jul 2010, 01:54 PM
Hi,

I am trying to Modify the chart Y Axis Item Labels of a report that is displayed in the silverlight report viewer (2010 Q2).
The Reason for this is that I need to modify the Labels into a non standard format string 'HHH:mm:ss' where hours could be more than 24.
I have followed the samples but none seem to work in the silverlight vierwer.
Setting the chart title visible and setting the text does work.
I can debug the code and all the settings are applied but it is as if the report is already rendered or if it is re-rendered after the modifications.
I have tried the code in the NeedDataSource Event but the series (to get the max value) is not available yet.
It is available in the ItemDataBound Event but the .

Am I missing a setting?

Help please....

Code:

chart1.ChartTitle.Visible =

 

true; // works

 

chart1.ChartTitle.TextBlock.Text =

 

"Test setting the value"; // works

 


chart1.PlotArea.YAxis.Clear();

chart1.PlotArea.YAxis.AutoScale =

 

false;

 

chart1.PlotArea.YAxis.AddRange(1, 10000, 10000 / 10);

 

 

for (int ii = 0; ii < chart1.PlotArea.YAxis.Items.Count; ii++)

 

{

chart1.PlotArea.YAxis.SetItemLabel(ii,

 

LabelConverterhelper.ConvertToTimeString((double)chart1.PlotArea.YAxis.Items[ii].Value)); // Does Nothing
// Does not work either

 

 

 

 

//chart1.PlotArea.YAxis[ii].TextBlock.Text = ChartLabelConverter.ConvertToTimeString((double)chart1.PlotArea.YAxis.Items[ii].Value);

 

 

 

 

}

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 29 Jul 2010, 12:37 PM
Hello Kobus,

What seems to be wrong is that you had used the Definition report item instead of the Processing counterpart. The sender of the report events is always the processing counterpart of the item.

The RadChart is not identical but very similar to the Telerik Reporting Chart item. Please check out the Formatting RadChart Labels blog article and let us know if it helps.

Check out the following help articles:
Report Life Cycle
Understanding Events

Sincerely yours,
Peter
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
Kobus
Top achievements
Rank 1
answered on 29 Jul 2010, 01:24 PM
Thank you for the response.

I now understand that the definition and the processing elements are different.
The issue I have is that the processing item does not have the definition elements like series etc exposed.
All I could find was datasource.

I also had a look at the Rad chart Label formatting but because my format is non standard it does not work.
I have a number 123456 in seconds that gets converted to a time string 34:17:36 (34 hours, 17 mins, 36 seconds).

Thank you for the help anyway.

K
Tags
General Discussions
Asked by
Kobus
Top achievements
Rank 1
Answers by
Peter
Telerik team
Kobus
Top achievements
Rank 1
Share this question
or