Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 我们可以在图表控件上显示3个Y值吗?_Asp.net - Fatal编程技术网

Asp.net 我们可以在图表控件上显示3个Y值吗?

Asp.net 我们可以在图表控件上显示3个Y值吗?,asp.net,Asp.net,我有一个web应用程序,上面有两个图表控件,如下所示: <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" Height="589px" Width="1109px"> <Series> <asp:Series Name="Series1" IsValueShownAsLabel="True" LabelAngle="90"

我有一个web应用程序,上面有两个图表控件,如下所示:

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



现在我想展示一张图表,其中包含X轴上的问题和Y轴上的“是,否”计数。如何做到这一点?

您可以使用堆叠条形图。像这样的

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