WebForm中使用Chart控件,实现局部放大

whbgxdx113 2016-06-03 04:26:17
下图所示为在winform中实现的效果图。现需要在webform中,采用vs自带的chart控件绘制曲线,实现同样的功能(局部放大),请教大家该如何实现?或者还有更好的实现方案?谢谢!
绘图区设置中,这些代码在winform均可使用,在webform中注释的代码表示不能用的
#region//绘图区设置------------------------------------------------------------------
//Chart1.ChartAreas[0].CursorX.IsUserEnabled = true; //横坐标拉动选择
//Chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
//Chart1.ChartAreas[0].CursorY.IsUserEnabled = true; //纵坐标拉动选择
//Chart1.ChartAreas[0].CursorY.Interval = 0.1; //设置最小拉动距离
//Chart1.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
//Chart1.ChartAreas[0].CursorX.Interval = 0;
//Chart1.ChartAreas[0].CursorX.IntervalOffset = 0;
Chart1.ChartAreas[0].BackColor = Color.Black;
Chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.SeaGreen; //网格线颜色
Chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.SeaGreen;
Chart1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.Dash; //网线线型
Chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash;
Chart1.ChartAreas[0].AxisX.LabelStyle.IntervalType = DateTimeIntervalType.Minutes;
Chart1.ChartAreas[0].AxisX.LabelStyle.Format = "HH:mm";
// --------------------------------------------------------------------------
//Chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true; //启用缩放视图
////chart1.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false;
//Chart1.ChartAreas[0].AxisX.ScrollBar.BackColor = Color.RosyBrown;
//Chart1.ChartAreas[0].AxisX.ScrollBar.Enabled = true;
//Chart1.ChartAreas[0].AxisX.ScrollBar.ButtonColor = Color.White;
//Chart1.ChartAreas[0].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All; //启用X轴滚动条按钮
////---------------------------------------------------------------------------
//Chart1.ChartAreas[0].AxisY.ScaleView.Zoomable = true; //Y轴缩放
//Chart1.ChartAreas[0].AxisY.ScrollBar.Enabled = true;
//Chart1.ChartAreas[0].AxisY.ScrollBar.IsPositionedInside = true; //滚动条与chartArea嵌套
//Chart1.ChartAreas[0].AxisY.ScrollBar.BackColor = Color.RosyBrown;
//Chart1.ChartAreas[0].AxisY.ScrollBar.ButtonColor = Color.White;
//Chart1.ChartAreas[0].AxisY.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All; //启用Y轴滚动条所有按钮


...全文
368 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧