I am using Line graph
in my application and is working fine. I tried to draw the marker points in line graph,but the marker points are not displaying.
In line chart marker properties, I have chosen markerSize
as 5,markerStyle
as Circle,MarkerColor
as blue.Refer my code below.
series1.Name = "Series1";
series1.IsVisibleInLegend = false;
series1.IsXValueIndexed = true;
series1.XValueType = ChartValueType.Time;
series1.YAxisType = AxisType.Primary;
series1.ChartType = SeriesChartType.Line;
this.chart1.Series.Add(series1);
Line marker is a line that is drawn on chart plot and bound to some value on an axis. It may be used to show a trend or mark an important value.
On the Format tab, in the Current Selection group, click Format Selection. Click Marker Options, and then under Marker Type, make sure that Built-in is selected. In the Type box, select the marker type that you want to use.
Marker chart (otherwise known as a point chart) is identical to a line chart without the lines. A marker chart shows only endpoints of segments that make each line up.
I don't see how the Markers
can show up from your code.
You need to set a non-default MarkerStyle
:
series1.MarkerStyle = MarkerStyle.Circle;
If you use the debugger on that line you can see how the default is None
!
Of course you will want to play with all other marker relates series properties, which all inherited from the DataPointCustomProperties
You are using ChartType.Line
which is fine. Note that FastLine
does not display markers!
If you only want to show some Markers simply style them for each point:
S1.Points[8].MarkerStyle = MarkerStyle.Triangle;
S1.Points[8].MarkerSize = 22;
S1.Points[8].MarkerColor = Color.Red;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With