我们可以在图表控件上显示3个Yvalues吗?

时间:2009-08-17 15:01:34

标签: asp.net

我有一个Web应用程序,其中有2个图表控件,如下所示:

<asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" 
           Height="589px" Width="1109px">
    <Series>
        <asp:Series Name="Series1" IsValueShownAsLabel="True" LabelAngle="90" 
                    XValueMember="Question" YValueMembers="YesCounter">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
            <AxisY Title="Number of Yes">
            </AxisY>
            <AxisX Title="Questions"  IsLabelAutoFit="False">
                <LabelStyle Angle="90" Interval="1" />
            </AxisX>
            <Position Height="94" Width="50" X="3" Y="3" />
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>

<asp:Chart ID="Chart2" runat="server" DataSourceID="SqlDataSource2" 
           Height="589px" Width="1109px">
    <Series>
        <asp:Series Name="Series1" IsValueShownAsLabel="True" LabelAngle="90" 
                    XValueMember="Question" YValueMembers="NoCounter">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
            <AxisY Title="Number of No">
            </AxisY>
            <AxisX Title="Questions"  IsLabelAutoFit="False">
                <LabelStyle Angle="90" Interval="1" />
            </AxisX>
            <Position Height="94" Width="50" X="3" Y="3" />
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>

现在我想显示一个单独的图表,其中包含X轴上的问题以及Y轴上的“是,否”计数。如何做到这一点?

1 个答案:

答案 0 :(得分:1)

您可以使用堆积条形图。像这样http://www.dotnetcharting.com/gallery/view.aspx?id=Gallery/a03