May 31, 2012, 5:18 PM
Chart: changing Fields of Axis runtime dynamically
Hi all,
I render a chart in a panel, then I want to change in behind code by the user request the fields in AxisY.Field getting the corresponding data
for example
which is the right path to achieve this goal, if possible?
Thanks
I render a chart in a panel, then I want to change in behind code by the user request the fields in AxisY.Field getting the corresponding data
for example
Chart MyChart = this.Chart1;
CategoryAxis AxesX = new CategoryAxis();
NumericAxis AxesY = new NumericAxis();
ColumnSeries MySerie = new ColumnSeries();
...
remove axes
remove serie
clear model
.....
AxesX.Title = "Month";
AxesX.Fields = new string[1];
AxesX.Fields[0] = "Date";
AxesY.Minimum = 0;
AxesY.Fields = new string[4];
AxesY.Fields[0] = "Value1";
AxesY.Fields[0] = "Value2";
AxesY.Fields[0] = "Value3";
AxesY.Fields[0] = "Value4";
.. define model and serie
MyChart.StoreID = "myStoreDefinedInAspx";
MyChart.Animate = true;
MyChart.Series.Add(MySerie);
MyChart.Legend = true;
MyChart.Axes.Add(AxesX);
MyChart.Axes.Add(AxesY);
and in the following request instead of Value1,2,3,4 user asks for Value5,6,7,8which is the right path to achieve this goal, if possible?
Thanks