ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Special "off scale" pointers for linear meters?
Posted by Steve Valliere on May-26-2018 01:49
Attachments:
Since my users determine the range to be displayed on a meter, it is possible (and from what I've observed in the past, LIKELY) that the value to be plotted may be above or below the meter's limits.  All of my home-grown stuff indicates that condition using a special pointer shape: a triangle "pointing" in the direction of the out of range value.  This both shows whether the missing value is too high or too low and assures the user that the entire meter was drawn as it should be, while a missing pointer could be a program error.

I think I can achieve this with quite a bit of experimentation into the use of custom pointer shapes, but it seems like a feature that would be nice for linear meters to have, in general. If the meter took care of this, it would greatly simplify my work, as a customer of the meter object.  And the meter object already has all of the necessary scaling and positioning data, while will likely struggle to get all of the data I need to correctly compute the necessary custom pointer coordinates.

The attached image shows an example of what I will be attempting to do with a custom pointer shape.  (For reference, the scale represents the exponent only of a logarithmic value, shown as the bottom label of the meter.)

Anyway, I'm hoping you could consider this option for a future version of the linear meters (and may related forms for other meters).

Thanks!
meter.png

  Re: Special "off scale" pointers for linear meters?
Posted by Peter Kwan on May-26-2018 16:12
Hi Steve,

The triangles you mentioned are easy to add in ChartDirector. An example is:

if (value > maxValue)
    m->addText(scaleLeft + scaleWidth / 2, scaleTop, "<*img=@Triangle,color=00CC00,width=20,height=20*>", 0, 1, 0, Chart::TopCenter);
else if (value < minValue)
    m->addText(scaleLeft + scaleWidth / 2, scaleTop + scaleHeight, "<*img=@InvertedTriangle,color=00CC00,width=20,height=20*>", 0, 1, 0, Chart::BottomCenter);
else
   m->addPointer(value, 0x0000cc);

In the above, scaleLeft, scaleWidth, scaleTop and scaleHeight are the left, top, width and height of the meter scale, which is provided by your code in LinearMeter::setMeter, so your code should already know these values.

Hope this can help.

Regards
Peter Kwan