[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-edu-devel
Subject:    Re: [kde-edu]: [Plotting] Offset/margin for data
From:       "Jason Harris" <kstars () 30doradus ! org>
Date:       2006-10-30 17:10:45
Message-ID: 401f1570610300910j6bd9bb34p64899702f6d5436d () mail ! gmail ! com
[Download RAW message or body]

Hi Carsten,

I was thnking about this too when I did the fix in kalzium, so I'm
glad you've brought it up here.

I'd prefer to keep it simple, just have a function
KPlotWidget::setAutoLimits() which will set the limits appropriately
to show all of the plot's KPlotObjects, plus a 5% buffer along each
margin.  I don't think we need setAllowNegativeOffset(); if the data
points are all non-negative, then the 5% buffer should never be enough
to cause a labeled tickmark with a negative value.

One question:  Should setAutoLimits() trigger automatic updates to the
limits when KPlotObjects are added/removed/modified?  Or should the
pattern be that people set up the KPlotObjects, and then call
setAutoLimits() when they want to set the limits?

We could also provide variants setAutoXLimits() and setAutoYLimits(),
in case the user wanted to set the limits on one axis manually, and
let the code pick the optimal limits for the other axis.

Jason

On 10/30/06, Carsten Niehaus <cniehaus@gmx.de> wrote:
> Moin
>
> Imagine a dataset from 5 to 120 (x) and 1 to 200 (y).
>
> I think there should be a way to plot that data like this:
>
> 1.) Creating the KPlotObject and adding all QPointF's to it
> 2.) Tell the KPlotWidget: Plot this object
> 3.) Tell the KPlotWidget to plot so that the data fits perfectly with an n%
> offset (margin). In this case the widget would plot from lets say 0 to 125
> and -3 to 204 or something.
>
> Advantage: The app-devels wouldn't need to care about this (like Jasons fixed
> Kalzium some hours ago), they would just tell the KPlotWidget to take care of
> an offset.
> Of course we'd need to agree on the value of n for the default-percentage and
> we'd need a setOffsetPercentage( double value ). I vote for 5% default.
> Perhaps we'd also need an setAllowNegativeValueOffset( bool b ) because often
> negative value don't make any sense (size of persons against their weight).
> Perhaps we'd need those setting per axis...
>
> Comments?
>
> --
> Gruß,
>   Carsten Niehaus
>
>
> _______________________________________________
> kde-edu mailing list
> kde-edu@mail.kde.org
> https://mail.kde.org/mailman/listinfo/kde-edu
>
>
>
>
_______________________________________________
kde-edu mailing list
kde-edu@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic