2 qq 27059213 qq_27059213 于 2016.02.19 10:30 提问

vs2010的chart控件画两条线
 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server" submitdisabledcontrols="True">
    <div>

    </div>
    <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" 
        Height="358px" Width="1267px">
        <series>
            <asp:Series ChartType="Line" Name="Series1" XValueMember="tvsampleid" 
                YValueMembers="tvrate">
            </asp:Series>
        <asp:Series ChartArea="ChartArea1" ChartType="Line" 
        IsVisibleInLegend="False" IsXValueIndexed="True" Name="Series2" 
        XValueMember="tvsampleid" YValueMembers="tvsampleid"></asp:Series></series>
        <chartareas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </chartareas>
    </asp:Chart>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:tvbigdataConnectionString %>" 
        SelectCommand="SELECT * FROM [tvsample]"></asp:SqlDataSource>
    </form>
</body>
</html>

代码是这样的,我想在一个折线图里面显示两个折线,求教怎么实现。。。简单方法有么。。。

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!