0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

C# グラフの値をCSVで保存する

Last updated at Posted at 2020-05-27
using System.IO;   //Save
using System.Text; //Save

private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                //ファイル書き込み形式(上書き)
                StreamWriter file = new StreamWriter(str_save_file, false, Encoding.UTF8);
                for (int i= 0; i < chart1.Series[str_ms_x].Points.Count; i++) {
                    file.WriteLine( chart1.Series[str_ms_x].Points[i].YValues[0] + "," + chart1.Series[str_ms_y].Points[i].YValues[0] );
                }
                file.Close();
                //セーブボタン使用不可
                btnSave.Enabled = false;
            }
            catch
            {
                
            }
        }
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?