using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable("hogehoge01");
dt.Columns.Add("x");
dt.Columns.Add("y");
Series ms = new Series();
chart1.Series.Add(ms);
ms.Name = "y";
ms.ChartType = SeriesChartType.Line;
ms.XValueMember = "x";
ms.YValueMembers = "y";
//ms.IsXValueIndexed = true;
for (int i = 0; i < 10; i++)
{
DataRow dr = dt.NewRow();
dr["x"] = i;
dr["y"] = i * 100;
dt.Rows.Add(dr);
}
chart1.DataSource = dt;
//chart1.ChartAreas[0].AlignmentStyle = AreaAlignmentStyles.PlotPosition;
//chart1.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.FixedCount;
chart1.ChartAreas[0].AxisX.IsMarginVisible = false;
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CnVzaW5nIFN5c3RlbS5XaW5kb3dzLkZvcm1zLkRhdGFWaXN1YWxpemF0aW9uLkNoYXJ0aW5nOwoKbmFtZXNwYWNlIFdpbmRvd3NGb3Jtc0FwcGxpY2F0aW9uMQp7CiAgICBwdWJsaWMgcGFydGlhbCBjbGFzcyBGb3JtMSA6IEZvcm0KICAgIHsKICAgICAgICBwdWJsaWMgRm9ybTEoKQogICAgICAgIHsKICAgICAgICAgICAgSW5pdGlhbGl6ZUNvbXBvbmVudCgpOwogICAgICAgIH0KCiAgICAgICAgcHJpdmF0ZSB2b2lkIEZvcm0xX0xvYWQob2JqZWN0IHNlbmRlciwgRXZlbnRBcmdzIGUpCiAgICAgICAgewogICAgICAgICAgICBEYXRhVGFibGUgZHQgPSBuZXcgRGF0YVRhYmxlKCJob2dlaG9nZTAxIik7CiAgICAgICAgICAgIGR0LkNvbHVtbnMuQWRkKCJ4Iik7CiAgICAgICAgICAgIGR0LkNvbHVtbnMuQWRkKCJ5Iik7CiAgICAgICAgICAgIFNlcmllcyBtcyA9IG5ldyBTZXJpZXMoKTsKICAgICAgICAgICAgY2hhcnQxLlNlcmllcy5BZGQobXMpOwogICAgICAgICAgICBtcy5OYW1lID0gInkiOwogICAgICAgICAgICBtcy5DaGFydFR5cGUgPSBTZXJpZXNDaGFydFR5cGUuTGluZTsKICAgICAgICAgICAgbXMuWFZhbHVlTWVtYmVyID0gIngiOwogICAgICAgICAgICBtcy5ZVmFsdWVNZW1iZXJzID0gInkiOwogICAgICAgICAgICAvL21zLklzWFZhbHVlSW5kZXhlZCA9IHRydWU7CgogICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDEwOyBpKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIERhdGFSb3cgZHIgPSBkdC5OZXdSb3coKTsKICAgICAgICAgICAgICAgIGRyWyJ4Il0gPSBpOwogICAgICAgICAgICAgICAgZHJbInkiXSA9IGkgKiAxMDA7CiAgICAgICAgICAgICAgICBkdC5Sb3dzLkFkZChkcik7CgogICAgICAgICAgICB9CiAgICAgICAgICAgIGNoYXJ0MS5EYXRhU291cmNlID0gZHQ7CiAgICAgICAgICAgIC8vY2hhcnQxLkNoYXJ0QXJlYXNbMF0uQWxpZ25tZW50U3R5bGUgPSBBcmVhQWxpZ25tZW50U3R5bGVzLlBsb3RQb3NpdGlvbjsKICAgICAgICAgICAgLy9jaGFydDEuQ2hhcnRBcmVhc1swXS5BeGlzWC5JbnRlcnZhbEF1dG9Nb2RlID0gSW50ZXJ2YWxBdXRvTW9kZS5GaXhlZENvdW50OwogICAgICAgICAgICBjaGFydDEuQ2hhcnRBcmVhc1swXS5BeGlzWC5Jc01hcmdpblZpc2libGUgPSBmYWxzZTsKICAgICAgICAgICAKICAgICAgICB9CiAgICB9Cn0=