I have been generating charts using MSChart for some time now, but I have never created multiple charts within one chart object. Thinking about this task has revealed a gap in my knowledge.
How I think about creating a chart
- Create Chart object
- Add ChartArea object to Chart object
- Create Series and add data
- Add Series to Chart
The object structure ends up looking like this
Chart
/ \
ChartArea Series
As far as I have been concerned in the past, ChartArea is simply the area I set up the labels and that sort of thing. To add another, I will be wanting to add another ChartArea and one or more series.
___________________ Chart ___________________
/ / \ \
ChartArea0 ChartArea1 Series0 Series1
How do I associate Series0 to ChartArea0? It would make sense to add a Series to a ChartArea, but that is not possible. For what reason is it beneficial to associate a Series with a Chart, rather than a ChartArea?