0
표준형 차트를 만들 수 없습니다. http://timbar.blogspot.com/2012/04/creating-chart-programmatically-in-c.htmlVS2013 동적으로 차트를 만듭니다. C#
Chart creating dynamically. in .net, c#
예제 코드의 경우 : 나는이 방법을 시도
private void Form2_Load(object sender, EventArgs e)
{
var xvals = new[]
{
new DateTime(2012, 4, 4),
new DateTime(2012, 4, 5),
new DateTime(2012, 4, 6),
new DateTime(2012, 4, 7)
};
var yvals = new[] { 1,3,7,12 };
// create the chart
var chart = new Chart();
chart.Size = new Size(600, 250);
var chartArea = new ChartArea();
chartArea.AxisX.LabelStyle.Format = "dd/MMM\nhh:mm";
chartArea.AxisX.MajorGrid.LineColor = Color.LightGray;
chartArea.AxisY.MajorGrid.LineColor = Color.LightGray;
chartArea.AxisX.LabelStyle.Font = new Font("Consolas", 8);
chartArea.AxisY.LabelStyle.Font = new Font("Consolas", 8);
chart.ChartAreas.Add(chartArea);
var series = new Series();
series.Name = "Series1";
series.ChartType = SeriesChartType.FastLine;
series.XValueType = ChartValueType.DateTime;
chart.Series.Add(series);
// bind the datapoints
chart.Series["Series1"].Points.DataBindXY(xvals, yvals);
// copy the series and manipulate the copy
chart.DataManipulator.CopySeriesValues("Series1", "Series2");
chart.DataManipulator.FinancialFormula(
FinancialFormula.WeightedMovingAverage,
"Series2"
);
chart.Series["Series2"].ChartType = SeriesChartType.FastLine;
// draw!
chart.Invalidate();
}
를하지만 나에게 빈 양식을 제공합니다.
차트를 만드는 방법은 무엇입니까? 도와주세요!
예, 정말 고마워요! 축복합니다! –