There is no difference when setup data binding for
stacked and non-stacked chart, you can take a look
into DataBoundChart sample.
Saying shortly, you should do following steps:
- create dataset and data adapter(standard ADO.Net operations)
- attach data set(or data table) to the chart
c1Chart1.DataSource = dataSet11.dataTable1
- setup mapping between series data and field names
' first series
c1Chart1.ChartGroups(0).ChartData(0).X.DataField = "FieldX"
c1Chart1.ChartGroups(0).ChartData(0).Y.DataField = "FieldY0"
' second series
c1Chart1.ChartGroups(0).ChartData(1).X.DataField = "FieldX"
c1Chart1.ChartGroups(0).ChartData(1).Y.DataField = "FieldY1"
....
- fill data set
dataAdapter1.Fill( dataSet11)
--
Best regards,
Alex
>
> I would like to build a stacked bar chart from a bound dataset.
> Do you have any examples of this?
>
> The chart is bound to a single dataset. The Series X and Y are bound to a
field name within that dataset. I am not sure how one would arrange a data
set to fit this.
>
> Thanks,
> Vicki Dillon
>
Click here to view the original newsgroup article (read only).