图表控件上的多样条曲线

本文关键字:样条曲线 控件 | 更新日期: 2023-09-27 18:28:48

我正在使用Asp.net的样条曲线图。我想在图表控制上使用多样条曲线

 <asp:Chart ID="Chart1" runat="server" Width="1200" DataSourceID="SqlDataSource1">
        <Series>
            <asp:Series Name="Series1" ChartArea="ChartArea1" ChartType="Spline" XValueMember="abc" YValueMembers="Expr1"></asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1"></asp:ChartArea>
        </ChartAreas>
    </asp:Chart>

图表控件上的多样条曲线

终于来了!我按照下面提到的那样做

string seriesName = "TestRuns";
Chart1.Series.Add(seriesName);
Chart1.Series[seriesName].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Spline;
Chart1.Series[seriesName].YValueMembers = "TestRunsDatafield";
Chart1.Series[seriesName].XValueMember = "date1";
string seriesName = "ODIRuns";
Chart1.Series.Add(seriesName);
Chart1.Series[seriesName].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Spline;
Chart1.Series[seriesName].YValueMembers = "ODIRunsDataFiels";
Chart1.Series[seriesName].XValueMember = "date1";