Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
360
Data binding with a dynamic data source
posted

I have a xamWebChart that I want to bind data, wich is dynamic (i.e. I only know the datasource structure at runtime).

I'm using data points to feed the series of the chart, but it seems that this is not working in stackedcharts...

Here is the code that I use to generate the points in the data chart:

 
for (int j = (int)rowLabelColumn + 1; j <= data.Data.Data.Length - 1; j++) {
Infragistics.Silverlight.Chart.Series series = new Infragistics.Silverlight.Chart.Series();
series.ChartType = ChartType.Column;
for (int i = 0; i <= data.Data.Data[(int)rowLabelColumn + 1].Length - 1; i++){
double value; if (double.TryParse(data.Data.Data[j][i].ToString(), out value)){
series.DataPoints.Add(new DataPoint(){
Label = data.Data.Data[(int)rowLabelColumn][i].ToString(),
Value = value,
ToolTip = "Valor: " + ((precision != null) ? Math.Round(value, (int)precision) : value)
});
}
}
//series.DataSource = items;
//series.DataMapping = "Value = value; Label = Label";
chartObj.Series.Add(series);
}
Parents
  • 138253
    Offline posted

    Hello,

     

    I am just checking if you got this worked out or you still require any assistance or clarification on the matter.

Reply Children