[Lazarus] TAChart 2nd Y Axis

David M. Lawrence dave at fuzzo.com
Fri Jul 29 07:45:05 CEST 2011


On 7/29/2011 1:21 AM, Alexander Klenin wrote:
> Please, do not top-post. It makes it very hard to read and reply to
> your messages.
>
> On Fri, Jul 29, 2011 at 15:56, David M. Lawrence<dave at fuzzo.com>  wrote:
>> No, they happened when I tried to plot the chart.  I couldn't figure out how
>> to implement the auto-scaling transformation from the demo.  For example, I
>> see catTAuto listed as a transformation in the object inspector and listed
>> as a property in the axisdemo main.pas, but cannot find any code to
>> implement it there.  I do see it mentioned in main.lfm, but don't understand
>> how it works -- it seems to list properties for the transform more than
>> anything else.
>
> There is no code -- just setting correct properties is enough.
>
>> In any event, for consistency's sake I need to maintain axes of -90 C to 60
>> C for the temperature axis, and 0 cm to 300 cm for the precipitation axis.
>>   Since I plot up to three temperature series, it's easier to set that as
>> fixed and figure out how to transform the precipitation axis.
>>
>> You seem to have a lot invested in the idea that flexible transformations
>> are best from a coding standpoint, but the hundreds of charts I plot have to
>> be plotted consistently -- there can be no individualized scaling.  The bars
>> on a graph from a site with a maximum monthly precipitation of 20 cm need to
>> be one-tenth as tall as the bars from a site with maximum monthly
>> precipitation of 200 cm.  I am not just comparing the bars and lines on an
>> individual chart, I am comparing one chart to similar charts from hundreds
>> of sites around the world.  That way I and others can tell the chart from a
>> desert site, for example, from that of a tropical rainforest site or monsoon
>> forest site.  From that standpoint, being able to independently set max and
>> min values for each vertical axis would be a lot better.
>
> I see now -- so you actually do NOT want auto-scale, but a fixed scale.
> In this case, simply use linear transformation and then Chart.Extent property.
>
> You will have to calculate scale and offset yourself (once, at design-time).
> (From my quick calculation, you should use scale=0.5 and offset=-90,
> but check yourself)
I'll check the linear transform.  Those values are what I was thinking 
they should be.  I'll give them a shot.
> Note, however, that if by chance your data will be outside of the
> designated extent,
> it will be cut off.
>
> I can see your point for axis min/max values, so maybe I implement them.
> However, how should they behave in the case of out-of-bounds data points
> I described above?
Out-of-bounds data points would be clipped.  In my case, I determined my 
max/min limits empirically by scanning global temperature and 
precipitation records.  There should be no out-of-bounds points -- on 
Earth, anyway.  If climate conditions do affect extremes, I wrote batch 
procedures that allow me to redraw all the charts in my database with 
new maximum and minimum values in a matter of minutes.

Thanks again,

Dave

P.S.  Does this list allow attachments?

-- 
------------------------------------------------------
  David M. Lawrence        | Home:  (804) 559-9786
  7471 Brook Way Court     | Fax:   (804) 559-9787
  Mechanicsville, VA 23111 | Email: dave at fuzzo.com
  USA                      | http:  http://fuzzo.com
------------------------------------------------------

"All drains lead to the ocean."  -- Gill, Finding Nemo

"We have met the enemy and he is us."  -- Pogo

"No trespassing
  4/17 of a haiku"  --  Richard Brautigan





More information about the Lazarus mailing list