本文介绍了如何在asp.net中添加图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在页面中添加图表取决于sql命令

我使用上面的代码,但是当我运行它时,它显示为空白


how to add chart in page depend on sql command

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


<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>





<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>

推荐答案



这篇关于如何在asp.net中添加图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 04:46