[英]How to set line markers in C# using Microsoft Visual Studio?
I would like to set different markers to the various series plotted in my chart. 我想为图表中绘制的各个系列设置不同的标记。 How do I go about doing this since the various series are plotted only when the user selects that particular option.
我如何进行此操作,因为仅当用户选择该特定选项时才绘制各个系列。 I currently have 7 series that can be plotted.
我目前有7个系列可以绘制。
for (int i = 0; i <= loop - 1; i++) {
Chart1.Series[i].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Line;
Chart1.Series[i].BorderWidth = 5; }
Whether it's System.Windows.Forms.DataVisualization.Charting.MarkerStyle or System.Web.UI.DataVisualization.Charting.MarkerStyle you can set it: 无论是System.Windows.Forms.DataVisualization.Charting.MarkerStyle还是System.Web.UI.DataVisualization.Charting.MarkerStyle,您都可以进行设置:
DataPointCollection
. DataPointCollection
。 Series
( DataPointCustomProperties.MarkerStyle ). Series
( DataPointCustomProperties.MarkerStyle )。 If you are using MarkerStyle.None
you can also use a MarkerImage
instead of the default predefined markers, same remarks as above, it should work for the whole series or any point. 如果你正在使用
MarkerStyle.None
你也可以使用一个MarkerImage
而不是默认的预定义的标志,同样的言论如上,它应该为全系列或任意点的工作。 You can even manipulate those values directly with DataPointCustomProperties.SetCustomProperty , or DeleteCustomProperty , like: 您甚至可以直接使用DataPointCustomProperties.SetCustomProperty或DeleteCustomProperty操作这些值,例如:
dataPoint.SetCustomProperty("MarkerStyle", MarkerStyle.Circle);
or 要么
dataPoint.DeleteCustomProperty("MarkerStyle");
Then, make sure: 然后,请确保:
MarkerSize
property so that your points are visible. MarkerSize
属性的足够大的值,以便您的点可见。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.