The goal is to take an already finished rad bar chart and change the labels along the x axis to French. My first thought was to try this:
private void ProcessXAxis(ChartXAxis xAxis)
{
if (xAxis == null || xAxis.Items == null) return;
foreach (AxisItem item in xAxis.Items)
{
var replacementPhrase = GetFilteredReplacementPhrase(item.LabelText);
if (string.IsNullOrEmpty(replacementPhrase) || string.IsNullOrWhiteSpace(replacementPhrase)) continue;
item.LabelText = replacementPhrase;
}
}
Trouble is, for this particular chart, there are no items in the collection. Where the chart gets its labels, other than obviously from the data row column names, is beyond me. Apparently I don't understand the ChartXAxis Item collection enough and assumed incorrectly it represented each data row. It doesn't.
So, this leaves me with the question - how do I find the correct class containing the textblock that is obviously being generated in HTML as a "Text" element under the <g> element? Please understand that all I have to work with at the point I am doing this processing is an already created chart. I have no access to the data source and can only use the class trees available from Telerik.
KT
private void ProcessXAxis(ChartXAxis xAxis)
{
if (xAxis == null || xAxis.Items == null) return;
foreach (AxisItem item in xAxis.Items)
{
var replacementPhrase = GetFilteredReplacementPhrase(item.LabelText);
if (string.IsNullOrEmpty(replacementPhrase) || string.IsNullOrWhiteSpace(replacementPhrase)) continue;
item.LabelText = replacementPhrase;
}
}
Trouble is, for this particular chart, there are no items in the collection. Where the chart gets its labels, other than obviously from the data row column names, is beyond me. Apparently I don't understand the ChartXAxis Item collection enough and assumed incorrectly it represented each data row. It doesn't.
So, this leaves me with the question - how do I find the correct class containing the textblock that is obviously being generated in HTML as a "Text" element under the <g> element? Please understand that all I have to work with at the point I am doing this processing is an already created chart. I have no access to the data source and can only use the class trees available from Telerik.
KT