관리 메뉴

안까먹을라고 쓰는 블로그

[DevExpress] ChartControl 본문

Language/C#

[DevExpress] ChartControl

YawnsDuzin 2018. 11. 13. 10:45

 

반응형

https://blog.naver.com/gmkjh74/220782675038

GV.sQuery = "EXEC[dbo].[spkind_sooyulGraphy] 2, '" + cmbLine.Text + "', '" + DT2.Rows[0]["kind_code"].ToString() + "', '" + dateFrom.Text.Replace("-", "") + "', '" + dateTo.Text.Replace("-", "") + "'";
DT3 = GV.DB.GetDataTableSelectQuery(GV.sQuery);

if (DT3 != null && DT3.Rows.Count > 0)
{
DataTable DT_FS = new DataTable();
DataTable DT_F1 = new DataTable();

DT_FS = DT3.Select("s_title = 'FS'", "s_Date asc").CopyToDataTable();
DT_F1 = DT3.Select("s_title = 'F1'", "s_Date asc").CopyToDataTable();

chartControl1.Series.Clear();

Series Series_FS = new Series("FS", ViewType.Bar);
chartControl1.Series.Add(Series_FS);
Series Series_F1 = new Series("F1", ViewType.Bar);
chartControl1.Series.Add(Series_F1);

chartControl1.Series["FS"].DataSource = DT_FS;
chartControl1.Series["F1"].DataSource = DT_F1;


Series_FS.ArgumentDataMember = DT_FS.Columns["s_Date"].ColumnName;
Series_FS.ValueDataMembers.AddRange(new string[] { DT_FS.Columns["s_Value"].ColumnName });
Series_FS.View.Color = Color.Blue;

Series_F1.ArgumentDataMember = DT_F1.Columns["s_Date"].ColumnName;
Series_F1.ValueDataMembers.AddRange(new string[] { DT_F1.Columns["s_Value"].ColumnName });
Series_F1.View.Color = Color.Red;


// Chart Title - Main
//chartControl1.Titles.Clear();
//ChartTitle chartTitle1 = new ChartTitle();
//chartControl1.Titles.Add(chartTitle1);
//chartTitle1.Text = "품종별 수율일보 Chart";
//chartTitle1.WordWrap = true;
//chartTitle1.MaxLineCount = 2;

// Chart Title - X, Y
//XYDiagram diagram = (XYDiagram)chartControl1.Diagram;

//// Customize the appearance of the X-axis title.
//diagram.AxisX.Title.Visible = true;
//diagram.AxisX.Title.Alignment = StringAlignment.Center;
//diagram.AxisX.Title.Text = "일자";
//diagram.AxisX.Title.TextColor = Color.Gray;
//diagram.AxisX.Title.Antialiasing = true;
//diagram.AxisX.Title.Font = new Font("Tahoma", 10, FontStyle.Bold);

//// Customize the appearance of the Y-axis title.
//diagram.AxisY.Title.Visible = true;
//diagram.AxisY.Title.Alignment = StringAlignment.Center;
//diagram.AxisY.Title.Text = "투입량";
//diagram.AxisY.Title.TextColor = Color.Gray;
//diagram.AxisY.Title.Antialiasing = true;
//diagram.AxisY.Title.Font = new Font("Tahoma", 10, FontStyle.Bold);


// Chart ViewType 변경!
// Bar, Line,
//chartControl1.Series["FS"].ChangeView(ViewType.Bar3D);

// Chart Label 보이게
//chartControl1.Series["FS"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;

반응형
Comments