2015-02-09 37 views
0

我有问题在ASP.NET 4.0中的该图的图表控件编程图表控件C#编程

在SeriesChartType快绳我不能显示的值。

我在脚本中添加:

Chart1.Series["Price"].IsValueShownAsLabel = true; 

但值不显示。

我错过了什么?

这段代码有什么问题?

预先感谢您。

我的代码如下。

 Chart1.Series.Add("Price"); 
     Chart1.Series["Price"].YValueMembers = "Price"; 
     Chart1.Series["Price"].ChartType = SeriesChartType.FastLine; 
     Chart1.Series["Price"]["LabelStyle"] = "Center"; 
     Chart1.Series["Price"]["PointWidth"] = "0.85"; 
     Chart1.Series["Price"].IsValueShownAsLabel = true; 
     Chart1.Series["Price"].Font = new System.Drawing.Font("Verdana", 9, FontStyle.Bold); 
     Chart1.Series["Price"].LabelForeColor = System.Drawing.Color.FromArgb(0, 0, 128); 
     Chart1.Series["Price"]["LabelStyle"] = "Top"; 
     Chart1.Series["Price"].Color = System.Drawing.Color.FromArgb(153, 153, 255); 
     Chart1.Series["Price"]["PixelPointDepth"] = "1.0"; 
     Chart1.Series["Price"]["DrawingStyle"] = "Cylinder"; 
     Chart1.Series["Price"].BorderWidth = 3; 
     Chart1.Series["Price"].MarkerColor = Color.Red; 

回答

0

MarkerDataPointLabels和不支持FastLine图表。

根据MSDN

Some charting features are omitted from the FastLine chart to improve performance. 
The features omitted include control of point level visual attributes, markers, data point labels, and shadows. 

所以,如果你想显示标签/数据点,使用Line图表来代替。