I have to use charts for a web site and I'm not able to make them work at all.
It seems easy: you declare a sql data source and the chart will use that data source, but it doesn't work. Instead of the chart, a "broken image" picture appears. I've tried using different browsers and placing the sql data source in different places, but it didn't work.
I'm using vs2010, and the sql data source has been tested and it returns the values ok.
Since I can't find the problem in the code, I write it here:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<form id="form1" runat="server">
<h2>Title</h2>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionStringChart1 %>"
SelectCommand="SELECT [companyID], [numberOfVisits] FROM [Company]">
</asp:SqlDataSource>
<asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1">
<Series>
<asp:Series Name="Series1" XValueMember="companyID"
YValueMembers="numberOfVisits">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
<br />
</form>
</asp:Content>