|
Zone don't show up properly |
Posted by Fabiano on Jul-01-2011 21:41 |
|
Hi,
I created a gauge with the range 0-100 and added a zone in it. If the zone's values is in the range (0-100), the zone doesn't show up properly, it appears like a thin line only. But, if I change the zone's values (ex. 0-99) or change the start/end angle from the gauge in order of it don't be a circle anymore, the zone shows correctly.
The code below shows exatly what I mean.
----
#include "chartdir.h"
int main(int argc, char *argv[])
{
AngularMeter *m = new AngularMeter(200, 200);
m->setMeter(100, 100, 85, -180, 180);
m->setScale(0, 100, 10, 5, 1);
m->setLineWidth(0, 2, 1);
m->addZone(0, 100, 10, 70, 0x99ff99);
m->addPointer(50, 0x40333399);
m->makeChart("roundmeter.png");
delete m;
return 0;
}
----
I have tried it on ChartDirector 4.1 and 5.2
Why is it happening? |
Re: Zone don't show up properly |
Posted by Peter Kwan on Jul-02-2011 00:31 |
|
Hi Fabiano,
If the meter is a whole circle, the last value of the scale does not really exist on the meter. For example, if you add a pointer at 100, it will point to 0. (Similarly, if you add a pointer at 120, it will point to 20.) There is also no label "100" on the meter.
For your case, if you want to add a zone which is a whole circle, you may add a ring instead (use AngularMeter.addRing). Alternatively, instead of using 100, you may use 99.99.
Hope this can help.
Regards
Peter Kwan |
Re: Zone don't show up properly |
Posted by Fabiano on Jul-02-2011 00:39 |
|
Hi Peter,
I did exactly what you suggested.
Thanks for your explanation.
Regards
Fabiano Barbosa |
|