Chart chart1 = new Chart();
chart1.Width = 1600;
chart1.Height = 900;
Series Series1 = new Series();
Series Series2 = new Series();
Series1.Name = "Series1";
Series1.ChartType = SeriesChartType.Line;
Series1.BorderDashStyle = ChartDashStyle.Solid;
Series1.BorderWidth = 1;
Series1.ShadowColor = Color.FromArgb(128, 128, 128);
chart1.Series.Add(Series1);
//create chartareas...
ChartArea ca = new ChartArea();
ca.Name = "ChartArea1";
ca.BackColor = Color.White;
ca.BorderDashStyle = ChartDashStyle.Solid;
ca.AxisX = new Axis();
ca.AxisY = new Axis();
chart1.ChartAreas.Add(ca);
chart1.Series["Series1"].Points.DataBindXY(ds.Tables[0].DefaultView,table8.Columns[0].ColumnName, ds.Tables[0].DefaultView, "plot");
chart1.ChartAreas[0].AxisY.Minimum = 0;
chart1.ChartAreas[0].AxisY.Maximum = 1;
ca.AxisY.IntervalOffset = 0.1;
chart1.Series(1).Points(0).Color = Color.Red;
//Error
/*
Non-invocable member 'System.Windows.Forms.DataVisualization.Charting.Chart.Series' cannot be used like a method.
*/

VulpesPosted Apr 3, 2014, 11:11 AM
1. Bind the data to a Series1 line chart and set the point colors to whatever color you want the lines to be.
2. Also bind the same data to a new Series2 point chart and set the point colors to what you want them to be.
With luck, the Series2 points will then overwrite the Series1 points and appear in the correct color.
VulpesPosted Apr 3, 2014, 4:45 PM
I guess it's a bit of a hack overlaying the points but can't think of another way to do it.
Farhan ShariffPosted Apr 3, 2014, 3:39 PM
http://imgur.com/mkI1nmL
http://imgur.com/fvOQ3qt
Farhan ShariffPosted Apr 3, 2014, 2:29 PM
Farhan ShariffPosted Apr 3, 2014, 8:46 AM
http://imgur.com/hYQ4goy
when I use chart type point i get is
http://imgur.com/fHGnDq5
with chart type line
if I try to mark points with
for (int l = 0; l < table8.Rows.Count; l++)
{
chart1.Series["Series1"].Points[l].Color = System.Drawing.Color.Black;
}
chart1.Series["Series1"].Points.FindMinByValue("X").Color = Color.White;
chart1.Series["Series1"].Points.FindMaxByValue("Y1").Color = Color.Orange;
http://imgur.com/zTnx4am
entire line changes color to black and points
VulpesPosted Apr 3, 2014, 7:58 AM
Farhan ShariffPosted Apr 3, 2014, 7:52 AM
VulpesPosted Apr 3, 2014, 7:51 AM
Farhan ShariffPosted Apr 3, 2014, 7:08 AM
VulpesPosted Apr 3, 2014, 6:38 AM
Farhan ShariffPosted Apr 3, 2014, 6:00 AM