Comment tracer une ligne entre le point (3,3) et le point (1,1) dans l'image jointe.Tracer une ligne entre deux points à l'aide du contrôle de graphique
Ceci est un contrôle de graphique. l'application WinForms C# à l'aide
private void Form1_Load(object sender, EventArgs e)
{
//chart1 is the name of the chart control
chart1.ChartAreas.Add("Area");
chart1.ChartAreas["Area"].AxisX.Minimum = 0;
chart1.ChartAreas["Area"].AxisX.Maximum = 10;
chart1.ChartAreas["Area"].AxisX.Interval = 1;
chart1.ChartAreas["Area"].AxisY.Minimum = 0;
chart1.ChartAreas["Area"].AxisY.Maximum = 10;
chart1.ChartAreas["Area"].AxisY.Interval = 1;
chart1.Series.Add("Node");
chart1.Series.Add("DG");
chart1.Series["Node"].Color = Color.Blue;
chart1.Series["DG"].Color = Color.Red;
chart1.Series["Node"].Points.Add(new DataPoint(1, 1));
chart1.Series["Node"].Points.Add(new DataPoint(8, 2));
chart1.Series["DG"].Points.Add(new DataPoint(3, 3));
chart1.Series["Node"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
chart1.Series["DG"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
}
J'ai modifié votre titre. S'il vous plaît voir, "[Les questions devraient inclure" tags "dans leurs titres?] (Http://meta.stackexchange.com/questions/19190/)", où le consensus est "non, ils ne devraient pas". –
Quel est le type de contrôle Chart que vous utilisez? –
K bonne question Russ. J'utilise le contrôle graphique par défaut fourni avec Visual Studio 2012. Version4.5 Microsoft composant. – hidden