Hey Charles,

2009/11/9 Hubbard, Charles W <[email protected]>:
>>> 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.

See latest public git, we've added mapFromDevice() and mapToDevice()
methods that
provide bidirectional conversion between chart coordinates and model
values/coordinates.

> 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.

I think that would be an acceptible improvement, to make minimum() and
maximum() return something sensible and have a set of flags on the
side ...

But that has not been implemented yet.

Regards,
koen

------------------------------------------------------------------------------
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