Click here to Skip to main content
15,881,735 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
All,

I have a datatable with the following type of information
HTML
Year Cars Trucks Planes
2011 12 20 2
2012 10 21 1
2013 9 9 3

What I get with my chart control is a column chart where the x-axis is labeled by the Year and the y-axis is the values of the other three items.
HTML
| . .
| .. .. ..
| .. .. ...
| ... ... ...
|---2011-----2012------2013

What I want is the items grouped by the x-axis and then year as follows with the year being legend
HTML
| ..
| ... ...
| ... ... .
| ... ... ...
|---Cars-----Trucks----Planes

How can I do this? Here is my chart control:
XML
<asp:chart id="chartVehicleData" runat="server" height="412px" imagestoragemode="UseHttpHandler" width="880px" >
<asp:series chartarea="MainChartArea" xvaluemember="FY" yvaluemembers="Cars" charttype="Column" name="CarsSeries">
<asp:series chartarea="MainChartArea" xvaluemember="FY" yvaluemembers="Trucks" charttype="Column" name="TrucksSeries">
<asp:series chartarea="MainChartArea" xvaluemember="FY" yvaluemembers="Planes" charttype="Column" name="PlanesSeries">

<asp:legend name="Legend1" docking="Right" alignment="Center" isdockedinsidechartarea="true">
<asp:chartarea name="MainChartArea">


When the user goes to the web page, fills in a date range, and clicks a button, they get a datatable with the info and a chart.
I bind with the following commands:
VB
chartvehicledata.datasource = mydatatable
chartvehicledata.databind()


Thanks for any help you can give. This has been driving me nuts
Ken
Posted
Updated 17-Oct-13 11:46am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900