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

Message ListMessage List     Post MessagePost Message

  Create 2 set of pointers (up and down) in horizontal Linear Meter
Posted by Jagan on Sep-04-2018 23:03
Hi
Is is possible to create a horizontal liner meter with 2 sets of pointers one above and one below the meter
Thanks
Jagan

  Re: Create 2 set of pointers (up and down) in horizontal Linear Meter
Posted by Peter Kwan on Sep-05-2018 21:29
Attachments:
Hi Jagan,

Do you mean something like the attached image?

The image is produced by adding two pointers to the meter (calling BaseMeter.addPointer twice). For the second pointer, I use MeterPointer.setShape to set an inverted pentagon as the pointer shape. See:

https://www.advsofteng.com/doc/cdnet.htm#MeterPointer.setShape2.htm

In C#, it is likeL

// First pointer
m.addPointer(74.25, 0x0000cc);

// Second poineter
MeterPointer p = m.addPointer(15, 0xcc0000);

// The original "pencil pointer" shape as described in the ChartDirector documentation
int[] pointerShape = { -30, 0, 30, 0, 30, 768, 0, 1000, -30, 768 };

// Invert, shorten, and shift the pointer upwards
for (int i = 1; i < pointerShape.Length; i += 2)
    pointerShape[i] = 1300 - pointerShape[i] * 8 / 10;
p.setShape2(pointerShape);

Hope this can help.

Regards
Peter Kwan
hmeter.png