Gnome2::Canvas --> do I really need to worry about pixels_per_unit?



Yes, pretty vague question, but here is my problem:

I want to display a graph of lots of data points, too many to
display all at once, so I've used a ScrollWindow to allow me
to scroll horizontally through the graph from beginning to end.

The values of the data points vary widely, so the graph swings
wildly beyond the top and bottom of the window as I scroll.

To fix that I've been using $canvas->set_scroll_region to adjust
the y axis with every horizontal scroll, and that *almost* works
well enough, but not quite.

The problem is that the vertical scroll region will just ignore
any height value below some arbitrary limit.

If the vertical range gets larger than some arbitrary limit, then
I need to use the vertical scrollbar to be able to see the entire
graph from top to bottom.

The arbitrary max and min values for the scroll region seem to
depend on the $canvas->units_per_pixel setting.  By changing the
units_per_pixel I can make the scaling work correctly -- but I
can't believe I need to go to that trouble to do something so
simple as adjust the height of a graph.

Are the tools really that limited -- or am I using the wrong
tools for the job?

Thanks!





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