簡體   English   中英

如何在asp:Chart控件中重疊圖形

[英]How to overlap graphs in the asp:Chart control

我正在嘗試使用asp:Chart制作帕累托圖表。 它基本上是由條形圖和折線圖組成的圖表。 現在,當我嘗試將兩個放置在相同的ChartArea中時,出現一個錯誤,提示我不能將兩個不同的Series放置在同一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#代碼的條形圖中插入了值。

嘗試將兩個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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM