Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
how to add chart in page depend on sql command

i use the above code,but when i run this it shows blank


XML
<asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1"
            Height="245px" Width="285px">
            <Titles>
      <asp:Title Text="Coils status"></asp:Title>
   </Titles>
            <Series>
                <asp:Series Name="Series1" ChartType="Line">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                    <AxisY Title="coil id">
                    </AxisY>
                    <AxisX Title="status">
                    </AxisX>
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>


XML
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"

            SelectCommand="SELECT PDL_ID_COIL, PDL_CD_STATUS FROM V_PR_DATA_IP_CG2 WHERE (PDL_CD_STATUS = 'UP') OR (PDL_CD_STATUS = 'WW') OR (PDL_CD_STATUS = 'WS') OR (PDL_CD_STATUS = 'WC') ORDER BY PDL_CD_STATUS">
        </asp:SqlDataSource>
Posted
Comments
ZurdoDev 4-Apr-12 10:28am    
Your series does not have any points or datamembers setup. You have to tell the chart where the data is coming from. Look at http://archive.msdn.microsoft.com/mschart

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