2

asp.net 图表总是绘制列,我想将我的数据表示为线条。但是,我在 asp.net 页面中添加了这段代码:

<asp:Series Name="Series1" XValueType="String" XValueMember="Date" YValueMembers="Utilization" IsValueShownAsLabel="True" YValueType="Auto" ChartType="Point" BorderWidth="5" Palette="BrightPastel"> </asp:Series>

在 aspx.cs 中

chart1.Series["Series1"].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Line;

有人可以帮忙吗?

4

3 回答 3

1

我建议改用谷歌图表。他们有折线图以及许多其他图表https://developers.google.com/chart/interactive/docs/gallery

于 2012-09-10T14:44:46.230 回答
1

可以看看这篇文章: http: //www.dotnettutorials.com/tutorials/charts/ms-chart-line-graph-cs.aspx

或者我建议使用 ZedGraph。它非常灵活,我发现它易于使用。

http://sourceforge.net/projects/zedgraph/

本文向您展示了如何使用 ZedGraph,并且是帮助您入门的好方法。

http://www.codeproject.com/Articles/5431/A-flexible-charting-library-for-NET

于 2012-09-10T14:46:13.323 回答
1

您只需更改属性中的设置:

  1. 转到图表的属性
  2. 转到系列
  3. 单击“...”按钮
  4. 转到图表 > 图表类型
  5. 点击线
于 2014-05-06T07:58:44.490 回答