Re: clickedx



Hi Naveen,

ok, so you want to determine the index of the data point closest to the
user's click, right? I am afraid you have to figure out that one for
yourself :-)

I do not consider that a part of GtkDatabox's functionality, especially
since there would be quite a lot of options, like

*) If there are several graphs, which one is to be considered?

*) Are we looking for the sqrt(dx*dx + dy*dy) to be minimized? Or is
only |dx| relevant? Or maybe only |dy|? You seem to be interested only
in dx, but others would certainly want to consider dy, too.

*) If the user has zoomed in, do you want to consider only those data
points which are visible? Maybe the closest is outside the visible area.

*) If the shape of the graph elements is other than circles, do you want
to use the distance to the "real" data values or do you want to consider
the distance to the nearest edge of such shapes?

These are just the first few things coming into my head.



If you know exactly what you need, determining the "closest" data point
should be easy for you to do.


Regards,

Roland

naveen wrote:
> Hi sir,
> 
> Thanks for the reply....
> 
> I am trying to solve my problem using "singals" example.
> 
> 1)Using  button_press_cb() we are printing x and y values according to
> scale ex: 206.107 and 35.4237.
> 
> 2)by using coord.x and coord.y we are getting pixels value
>  ex: 65 and 100.
> 
> 3)But what i need is the value(or nearest) in terms of the POINTS that
> we used to plot the sine waves..
> ex :X[xvalue]=206.107;
> ie xvalue= 206;because X[206]=206; and X[207]=207;
> The i value which we used to calculate sine and cos waves in the for
> loop.
> 
> 4)I need the value only for X and not for Y..
> 
> I think the way i communicated to you is not explained the problem i
> faced. But now it is clear i feel... please give me some idea..
> 
> Regards,
> Naveen.
> 
> _______________________________________________
> gtkdatabox-list mailing list
> gtkdatabox-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkdatabox-list
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]