zedgraphweb自动缩放并显示坐标值

sakuram 2011-06-08 04:31:16
winform中的zedgraph控件可以自动缩放,并且当鼠标移动到某个点时,可以显示横纵坐标值,在webform中怎么实现这两个功能??
...全文
445 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
AccessZHB 2012-01-17
  • 打赏
  • 举报
回复
http://sunxitao88.blog.163.com/blog/static/683144392008628101837311/ 详细
bone_love 2011-11-15
  • 打赏
  • 举报
回复
private void zedGraphControl2_MouseMove(object sender, MouseEventArgs e)
{
PointF mousePt = new PointF(e.X, e.Y);
GraphPane myPane = this.zedGraphControl2.GraphPane;


string tooltip = string.Empty;

// Find the Chart rect that contains the current mouse location
ZedGraphControl s = (ZedGraphControl)sender;
GraphPane pane = s.MasterPane.FindChartRect(mousePt);

// If pane is non-null, we have a valid location. Otherwise, the mouse is not
// within any chart rect.
if (pane != null)
{
double x, y;
// Convert the mouse location to X, and Y scale values
pane.ReverseTransform(mousePt, out x, out y);
// 获取横纵坐标信息
tooltip = "(坐标x:" + x.ToString("f6") + ",坐标y: " + y.ToString("f6") + ")";
}
// this.zedGraphControl1.GraphPane.Title.Text = tooltip;
myPane.XAxis.Title.Text = tooltip;
this.zedGraphControl2.Refresh();

}
bone_love 2011-11-15
  • 打赏
  • 举报
回复
public void zedshowN( ZedGraphControl zg,int n)
{
//zg.GraphPane.CurveList[n]
try
{
zg.GraphPane.CurveList[n].IsVisible = true;
//zg.ZoomOutAll(zg.GraphPane);
zg.RestoreScale(zg.GraphPane);
zg.AxisChange();
zg.Refresh();
}
catch{}


}
AccessZHB 2011-11-02
  • 打赏
  • 举报
回复
呈现的时候就显示 坐标值可以吗
henry-qu 2011-09-14
  • 打赏
  • 举报
回复
Zgl.IsShowPointValues = true;
可以自动显示鼠标坐标点!至于自动缩放,我还不会!
sakuram 2011-07-27
  • 打赏
  • 举报
回复
没解决

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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