mschart走势图 vc_MSCHART时间走势图 | 学步园

private void BindGrid()

{

chart2.Width = 800;

chart2.Height = 600;

//作图区的显示属性设置

//chart2.ChartAreas["ChartArea1"].AxisX.IsMarginVisible = false;

//chart2.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = false;

//背景色设置

chart2.ChartAreas["ChartArea1"].ShadowColor = Color.Transparent;

chart2.ChartAreas["ChartArea1"].BackColor = Color.FromArgb(209, 237, 254);         //该处设置为了由天蓝到白色的逐渐变化

chart2.ChartAreas["ChartArea1"].BackGradientStyle = GradientStyle.TopBottom;

chart2.ChartAreas["ChartArea1"].BackSecondaryColor = Color.White;

//X,Y坐标线颜色和大小

chart2.ChartAreas["ChartArea1"].AxisX.LineColor = Color.FromArgb(64, 64, 64, 64);

chart2.ChartAreas["ChartArea1"].AxisY.LineColor = Color.FromArgb(64, 64, 64, 64);

chart2.ChartAreas["ChartArea1"].AxisX.LineWidth = 2;

chart2.ChartAreas["ChartArea1"].AxisY.LineWidth = 2;

chart2.ChartAreas["ChartArea1"].AxisX.Title = "时间";

chart2.ChartAreas["ChartArea1"].AxisY.Title = "灰量";

//中间X,Y线条的颜色设置

chart2.ChartAreas["ChartArea1"].AxisX.MajorGrid.LineColor = Color.FromArgb(64, 64, 64, 64);

chart2.ChartAreas["ChartArea1"].AxisY.MajorGrid.LineColor = Color.FromArgb(64, 64, 64, 64);

//X.Y轴数据显示间隔

chart2.ChartAreas["ChartArea1"].AxisX.Interval = 2.0; //X轴数据显示间隔

chart2.ChartAreas["ChartArea1"].AxisX.IntervalType = DateTimeIntervalType.Hours;

chart2.ChartAreas["ChartArea1"].AxisY.Interval = 20;

//X轴线条显示间隔

//chart2.ChartAreas["ChartArea1"].AxisX.MajorGrid.IntervalType = DateTimeIntervalType.Hours;

chart2.Palette = ChartColorPalette.Pastel;

string sql = "select sum(zhl) zhl, input_date, ash_type_name from (" +

" select sum(t.second_load - t.first_load) as zhl,"+

" to_date(to_char(t.input_date, 'dd/mm/yyyy hh24')||':00','dd/mm/yyyy hh24:mi:ss') as input_date," +

" u.ash_type_name"+

" from transportation_bill t, ash_type u"+

" where t.ash_type_id = u.ash_type_id" +

" and ((sysdate - t.input_date) between 0.0 and 1.0)"+

" and t.sale_organization_id = 1"+

" group by u.ash_type_name, t.input_date"+

" order by t.input_date"+

")"+

" group by ash_type_name,input_date"+

" order by input_date";

DataTable dt2 = OracleHelper.ExecuteDataTable(OracleHelper.ConnectionString, CommandType.Text, sql, "T", null);

chart2.DataBindCrossTable(dt2.DefaultView, "ash_type_name", "input_date", "zhl", "", PointSortOrder.Ascending);

foreach (Series sr in chart2.Series)

{

sr.ChartType = SeriesChartType.Spline;

sr.XValueType = ChartValueType.Time;

sr.MarkerStyle = MarkerStyle.Circle;

sr.BorderWidth = 2;

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值