I''m using ChartWebControl in AJAX mode.
In my client I have a refresh button that send the new data back to the server to repainting the chart.
As You can see in the attached picture
the chart is correctly repainted, but not the legend.
where do I fail?
Here there is the my source
Kind Regards
protected void InitializeChartData(bool clear)
{
this.UpdateSettings();
if (clear) this.ChartWebControl1.Model.Series.Clear();
// In a hidden field there are the data
PrepareChartDataFromXML(this.idGData.Value);
// GRAPH TITLE
this.ChartWebControl1.Text = _title;
// LEGEND
this.ChartWebControl1.Legend.Visible = true;
this.ChartWebControl1.LegendPosition = ChartDock.Top;
/* _series is a collection of pairs of series name and double array */
// SERIES
foreach (KeyValuePair
skey in _series)
{
string name = skey.Key;
double[] values = skey.Value;
ChartSeries series1 = this.ChartWebControl1.Model.NewSeries(name);
series1.Type = ChartSeriesType.Column;
series1.Text = series1.Name;
series1.SeriesIndexedModelImpl = new ArrayModel(values);
this.ChartWebControl1.Model.Series.Add(series1);
}
this.ChartWebControl1.Indexed = true;
// X LABLES
this.ChartWebControl1.PrimaryXAxis.LabelsImpl = new LabelModel(_xAxisLabels);
this.ChartWebControl1.PrimaryXAxis.ValueType = ChartValueType.Custom;
}
chartl.zip