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.
*/


VulpesRank #55 · 29.2K reputationPosted Apr 3, 2014, 7:11 AM EDT
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.
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 3, 2014, 2:00 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 3, 2014, 2:38 AM EDT
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 3, 2014, 3:08 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 3, 2014, 3:51 AM EDT
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 3, 2014, 3:52 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 3, 2014, 3:58 AM EDT
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 3, 2014, 4:46 AM EDT
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
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 3, 2014, 10:29 AM EDT
Farhan ShariffRank #2,004 · 725 reputationPosted Apr 3, 2014, 11:39 AM EDT
http://imgur.com/mkI1nmL
http://imgur.com/fvOQ3qt
VulpesRank #55 · 29.2K reputationPosted Apr 3, 2014, 12:45 PM EDT
I guess it's a bit of a hack overlaying the points but can't think of another way to do it.