fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Windows.Forms.DataVisualization.Charting;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void Form1_Load(object sender, EventArgs e)
  21. {
  22. DataTable dt = new DataTable("hogehoge01");
  23. dt.Columns.Add("x");
  24. dt.Columns.Add("y");
  25. Series ms = new Series();
  26. chart1.Series.Add(ms);
  27. ms.Name = "y";
  28. ms.ChartType = SeriesChartType.Line;
  29. ms.XValueMember = "x";
  30. ms.YValueMembers = "y";
  31. //ms.IsXValueIndexed = true;
  32.  
  33. for (int i = 0; i < 10; i++)
  34. {
  35. DataRow dr = dt.NewRow();
  36. dr["x"] = i;
  37. dr["y"] = i * 100;
  38. dt.Rows.Add(dr);
  39.  
  40. }
  41. chart1.DataSource = dt;
  42. //chart1.ChartAreas[0].AlignmentStyle = AreaAlignmentStyles.PlotPosition;
  43. //chart1.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.FixedCount;
  44. chart1.ChartAreas[0].AxisX.IsMarginVisible = false;
  45.  
  46. }
  47. }
  48. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty