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:
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);
}