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

Message ListMessage List     Post MessagePost Message

  How to get the label follow pointer in AngularMeter?
Posted by Mohd Radzi Ibrahim on Nov-27-2013 11:06
Hi,

How do I get the position where to write the label where the pointer is?


thanks.

best regards,
Radzi.

  Re: How to get the label follow pointer in AngularMeter?
Posted by Peter Kwan on Nov-28-2013 02:09
Hi Mohd Radzi Ibrahim,

You would need to compute it with your own code based on the meter scale and meter size. It is based on ordinary trigonometry. The exact code depends on your programming language.

For example, in Java, it is like:

double angle = (myDataValue - minMeterScale) / (maxMeterScale - minMeterScale) * (maxMeterAngle - minMeterAngle) + minMeterAngle;

// Java API uses radian for angles
angle *= 3.1415926 / 180;

double xCoor = centerX + Math.sin(angle) * meterRadius;
double yCoor = centerY + Math.cos(angle) * meterRadius;

You can then use BaseChart.addText to add a custom text at that point.

Hope this can help.

Regards
Peter Kwan