Stacked Column Chart
V3ngeanc3
Centurion
Hi,
I'm struggling to do a stacked column chart with the code behind.
The following code gives me a only 1 value allowed error:
mscDevelopmentMAdv.Series[1].AddValue(dsDevelopmentMAdv.Columns.Alias.Replace("BookP", string.Empty).Replace("Reef", string.Empty).Replace("Waste", string.Empty)
, dsDevelopmentMAdv[dsDevelopmentMAdv.Columns].ToString()
, dsDevelopmentMAdv[dsDevelopmentMAdv.Columns[i+1]].ToString()
);
I then went to the Chart.Series properties in the properties window. Changes it to 2 and it worked, but did not add both values.
And as soon as the report is closed this setting goes back to 1.
There's no where in the user manuals or internet where I can find an example of how a stacked column chart is created with code.
Please help
I'm struggling to do a stacked column chart with the code behind.
The following code gives me a only 1 value allowed error:
mscDevelopmentMAdv.Series[1].AddValue(dsDevelopmentMAdv.Columns.Alias.Replace("BookP", string.Empty).Replace("Reef", string.Empty).Replace("Waste", string.Empty)
, dsDevelopmentMAdv[dsDevelopmentMAdv.Columns].ToString()
, dsDevelopmentMAdv[dsDevelopmentMAdv.Columns[i+1]].ToString()
);
I then went to the Chart.Series properties in the properties window. Changes it to 2 and it worked, but did not add both values.
And as soon as the report is closed this setting goes back to 1.
There's no where in the user manuals or internet where I can find an example of how a stacked column chart is created with code.
Please help
Comments
chart1.Series["Series1"].Points.AddY(random.Next(75, 170));
chart1.Series["Series2"].Points.AddY(random.Next(35, 125));
chart1.Series["Series3"].Points.AddY(random.Next(45, 140));
chart1.Series["Series4"].Points.AddY(random.Next(25, 110));
You should create two series in the designer, then fill it by code:
mscDevelopmentMAdv.Series[0].AddValue(xValue, yValue);
mscDevelopmentMAdv.Series[1].AddValue(xValue, yValue);