【问题标题】:How to overlap graphs in the asp:Chart controlasp中如何重叠图形:图表控件
【发布时间】:2013-03-06 23:55:42
【问题描述】:

我正在尝试使用 asp:Chart 制作帕累托图。它基本上是一个由条形图和折线图组成的图表。现在,当我尝试将两者放在同一个 ChartArea 中时,它给了我一个错误,说我不能将两个不同的系列放在同一个 ChartArea 中。

我需要右 y 轴是每个 Bar 元素的价格,左 y 轴是对应于折线图的百分比。

到目前为止我的代码:

<asp:Chart ID="Chart1" runat="server" onload="Chart1_Load" Width="847px" Height="422px">
    <Series>
        <asp:Series Name="Bar" YValueType="Double">
        </asp:Series>
    </Series>
    <Series>
        <asp:Series Name="Line" YValueType="Double" ChartType="Line">
        </asp:Series>
    </Series>

    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>

我在底层 C# 代码的条形图中插入了值。

【问题讨论】:

    标签: c# asp.net graph


    【解决方案1】:

    尝试将两个 asp 系列标签放在同一个系列容器标签中:

    <asp:Chart ID="Chart1" runat="server" onload="Chart1_Load" Width="847px" Height="422px">
        <Series>
            <asp:Series Name="Bar" YValueType="Double">
            </asp:Series>
            <asp:Series Name="Line" YValueType="Double" ChartType="Line">
            </asp:Series>
        </Series>
    
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-20
      • 1970-01-01
      • 2018-08-09
      • 2014-06-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多