PDA

View Full Version : حرفه ای: یافتن مختصات موس هنگام کلیک روی ZedGraph



daffy_duck376
شنبه 28 فروردین 1389, 09:54 صبح
سلام دوستان
دارم با ZedGraph یه برنامه مینویسم . حالا میخوام مختصاتی رو که کاربر روی نمودار با کلیک موس نشون میده رو تو سیستم ثبت کنم . توجه داشته باشید این مختصات نسبت به نمودار هست نه x , y نسبت به فرم . مشکال دیگه ای که دارم میخوام اعداد محور x و y رو خودم بدم.زیرا اعدادی که خوش رو نمودار میکشه با اونی که من میخوام یکی نیست . من اعداد به صورت لگاریتمی میخوام.
کسی هست راهنمایی کنه ؟

daffy_duck376
شنبه 28 فروردین 1389, 10:58 صبح
hاولی رو خودم پیدا کردم مگذارم شاید به درد کس دیگه بخوره . فقط میمونه مشکل دوم

private bool zedGraphControl1_MouseMoveEvent(ZedGraph.ZedGraphC ontrol sender, MouseEventArgs e)
{
// Save the mouse location
PointF mousePt = new PointF(e.X, e.Y);

// Find the Chart rect that contains the current mouse location
ZedGraph.GraphPane pane = sender.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);
// Format the status label text
this.Text = "(" + x.ToString("f2") + ", " + y.ToString("f2") + ")";
}
else
// If there is no valid data, then clear the status label text
this.Text = string.Empty;

// Return false to indicate we have not processed the MouseMoveEvent
// ZedGraphControl should still go ahead and handle it
return false;

}

seven7777777
شنبه 28 فروردین 1389, 11:50 صبح
ببخشید این ZedGraph چیه ؟
از کریستال ریپورت بهتره ؟

daffy_duck376
شنبه 28 فروردین 1389, 11:57 صبح
ربطی به کریستال ریپورت نداره . یه ابزار برای رسم نمودارهای پیشرفته هست برای اطلاعات بیشتر http://zedgraph.org (http://zedgraph.org/)