I've got a table with three columns, the latter two with values in them. I'm trying to output two pie charts displaying the data for each one. For some reason, the second pie chart isn't displaying, instead it's coming up as a gray square. Additionally the legend is appearing twice consecutively, but it's only a single legend which makes no sense to me.
Here's the markup:
<asp:Chart Height="500" Width="500" ID="ClientModelChart" runat="server">
<Series>
<asp:Series ChartType="Pie" IsValueShownAsLabel="true" Name="PortfolioActual"></asp:Series>
<asp:Series ChartType="Pie" IsValueShownAsLabel="true" Name="ModelActual"></asp:Series>
</Series>
<Legends>
<asp:Legend Name="PortfolioActual"></asp:Legend>
<asp:Legend Name="ModelActual"></asp:Legend>
</Legends>
<ChartAreas>
<asp:ChartArea Area3DStyle-Enable3D="true" Area3DStyle-LightStyle="Realistic" Name="PortfolioActual"></asp:ChartArea>
<asp:ChartArea Area3DStyle-Enable3D="true" Name="ModelActual"></asp:ChartArea>
</ChartAreas>
</asp:Chart>
Then I've got a SqlDataAdapter
used to fill a DataSet
, I then turn the DataTableCollection
into an IEnumerable
list type so I can use it when data binding the chart series. It seems a bit hairy, but the reason I do this is because the DataSet
is used for some XSLT output later on, so there's no point re-querying the database when I've already got the data I need/want.
Dim sectorList As IList = CType(ds.Tables(1), IListSource).GetList()
ClientModelChart.Series("PortfolioActual").Points.DataBind(sectorList, "Sector", "Model", Nothing)
ClientModelChart.Series("ModelActual").Points.DataBind(sectorList, "Sector", "Client", Nothing)
So the second pie chart (ModelActual) isn't displaying at all, it's just a gray square. I've been fiddling for hours with no avail. (EDIT: Also, I've already done something similar so I don't know why this one isn't working. The difference with my other one is that it came from two separate sets of data initially, but that shouldn't be the reason it doesn't work)
Thanks.