Hi Koen,

>> Because I know the size of my WCartesianChart widget, and I can
>> query the sizes of the various paddings that have been applied to
>> the edges, and I know the sizes of the X and Y axes (I manually
>> set these to min and max of my values), the conversion from mouse
>> coordinates to chart coordinates should be fairly
>> straightforward.  In fact, everything *almost* works.  With my
>> current test program, I can click somewhere inside the chart

> Ideally, the first extension to WCartesianChart is to provide you
> with these mapping methods, since how the chart is being padded
> is a bit of an internal affair. These methods could be added
> quite easily... And I guess that would help you to implement a
> zooming feature (without the dragging around part) ?

Adding methods to WCartesianChart to perform the mapping between
pixel (mouse) coordinates and chart coordinates would be
outstanding!  That would certainly save me a lot of work, and, in
the end, would be more accurate as well.  I would really like to
see that enhancement.

I would also like to know what you'd think about modifying the
way auto-scaling is enabled right now.  Currently, to turn on
auto-scaling of an axis, one sets the minimum and maximum range
(using setRange() for instance) to AUTO_MINUMUM and AUTO_MAXIMUM
respectively.  I was wondering if it would be useful to use flags
for that instead.  I say that because, as I experimented around
with converting mouse coordinates to chart coordinates, it would
have been useful to me to know what the axis limits were when
auto-scaling was enabled.  However, as it is currently
implemented, when auto-scaling is enabled, reading back the axis
limits using the maximum() and minimum() methods doesn't return
the limits that were used to produced the plot, but instead
return the AUTO_MINIMUM and AUTO_MAXIMUM constants.  Even if you
do add methods that take care of the coordinate conversions
internally, I still think there may be times when knowing the
actual plotted extents of the axes would be useful.

Naturally I have no idea how difficult of a change this would be
in the source code, so maybe it's not worth the effort.  However,
I envision something like this.  The WAxis widget would get a
new method, maybe something like "autoScale()", that would take
OR-able flags with enumerations like "Minimum", "Maximum", and
"None".  So, if I were to call

    chart->axis(XAxis).autoScale(Minimum | Maximum);

the limits of the X-axis would automatically be picked based on
the data in the data model, and if I were later to call the
minimum() or maximum() methods, they would return what those
limits were.  Also, I suppose that any calls to setMinumum(),
setMaximum() or setRange() could clear the associated autoScale()
flag since, if the user is manually setting a limit, presumably
he no longer wants the widget to do it for him.

What do you think?


Kind regards,


Charlie Hubbard

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to