fork(1) 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. namespace WindowsFormsApplication1
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18.  
  19. private void Form1_Load(object sender, EventArgs e)
  20. {
  21.  
  22. }
  23. bool hogehoge = true;
  24. private void button1_Click(object sender, EventArgs e)
  25. {
  26. Series series1 = new Series("y = x*x");
  27. Series series2 = new Series("y = 5*x+20");
  28. for (int x = 1; x < 10; x++)
  29. {
  30. series1.Points.AddXY(x, x * x);
  31. series2.Points.AddXY(x, 5 * x + 20);
  32. }
  33. {
  34. series1.Color = Color.Red;
  35. series1.MarkerSize = 15;
  36. series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Diamond;
  37. series1.IsValueShownAsLabel = true;
  38. series1.LabelForeColor = Color.Blue;
  39. series1.ChartType = SeriesChartType.Line; // グラフ形状
  40. if(hogehoge) series1.BorderWidth = 10; //これで太さが変わる
  41. }
  42. {
  43. series2.Color = Color.Blue;
  44. series2.MarkerColor = Color.Blue;
  45. //series2.MarkerSize = 20;
  46. series2.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
  47. series2.ChartType = SeriesChartType.FastLine;
  48. if (hogehoge) series2.BorderWidth = 10; //これで太さが変わる
  49. }
  50. {
  51. chart1.Series.Clear();
  52. chart1.Series.Add(series1);
  53. chart1.Series.Add(series2);
  54. chart1.ChartAreas[0].BackColor = Color.LightCyan;
  55. }
  56. {
  57. Axis ax = chart1.ChartAreas[0].AxisX;
  58. ax.MajorGrid.LineColor = Color.LightGray;
  59. Axis ay = chart1.ChartAreas[0].AxisY;
  60. ay.MajorGrid.LineColor = Color.LightGray;
  61. }
  62. hogehoge = !hogehoge;
  63. }
  64. }
  65. }
  66.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty