Using the pointer needle for big value jumps...

Gauge for WPF Forum

Posted 11 years ago by D
Version: 4.5.0477
Avatar
I have struggled to get a gauge to look just right...so far it looks okay, but programmatically moving the needle around looks to be a headache.

What I have is a circular gauge. I am using one scale with one tickset on this thing, as it looks like the only thing I can do. The tickset on this scale has a minimum of 0, max of 8, with major interval of .5 and minor interval of .1. The scale looks normal from 0 to 5, but after the value of 5, I had to customize it with different tick marks, skip some label values, etc. Ideally, I'd be able to set up another tickset, scale, or something, use the same pointer needle (I only need one), and go about pointing to my drastically different values. After 5, the tickset would ideally have a major interval of 1 and minor interval of .5. At the value of 10, this interval would change again.

So, my questions are:
-Can one pointer needle be used for multiple ticksets or scales?
-Or is there an easy way to change intervals within a tickset to do what I want?
-Or am I stuck customizing tickmarks and labels, trying to calculate how the pointer hits the "unexpected" values?

While I'm here, I guess I'll also ask if there's a way to customize spacing between tickmarks by any method other than adjusting radius and start angle...I haven't seen it, but it would be nice to have.

Please point me in the right direction if I'm heading the wrong way, and thank you in advance.

Comments (4)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Quote:
Can one pointer needle be used for multiple ticksets or scales?

No, a pointer needle can only be used in one tickset, and thus only a single scale.

Quote:
Or is there an easy way to change intervals within a tickset to do what I want?

You could add (for example) two CircularTickMarkMajor elements. The first one would have an EndValue of 5, the second would have a StartValue of 5. Additionally, you can change the interval on the second element using the major interval attached property (e.g. gauge:CircularTickSet.MajorInterval="1").

Quote:
Or am I stuck customizing tickmarks and labels, trying to calculate how the pointer hits the "unexpected" values?

I'm not sure what you are referring to here. The value range needs to be linear at this time. We are finishing up documentation on a new Gauge release, which supports logarithmic value ranges. I'm not sure if this is the type of thing you are referring to.

Quote:
I guess I'll also ask if there's a way to customize spacing between tickmarks by any method other than adjusting radius and start angle

The tick marks/labels can be offset from the scale using ScalePlacement and ScaleOffset.


Actipro Software Support

Posted 11 years ago by D
Avatar
Okay...from what I understand, CircularTickMarkMajor is derived from CircularTickSet. Well, if I define the minimum and maximum values for a CircularTickSet (which it seems I have to do to get the pointer needle to recognize values), then it doesn't matter how I define the Start and End values.

How my circular scale is laid out is:
-Values 0 - 5 at increments of .1
-Values 5 - 10 at increments of .5
-Values 10 - 50 at increments of 5

I'd love to be able to define the values for these tick marks, the value ranges, etc., and make this work like it needs to work with minimal code-behind, as it's much neater that way. However, it doesn't seem that making multiple CircularTickMarkMajor, minor, etc. elements solves my problem...not from what I've been able to see. I'd guess that making multiple elements could cut down on my usage of using CircularCustomTickMark, but it doesn't seem to help with the numbering scheme as I see it. It looks like CircularTickSet will always control the values for how this stuff works, and that is making it tricky. Again, I could be looking in the wrong direction. As it stands, it looks like I may end up doing code-behind to tell the pointer how to react for any value over 5, then over 10, as the scale will be set up differently for such values.

Quote:
The tick marks/labels can be offset from the scale using ScalePlacement and ScaleOffset.


I've got that part, but is there no other way to change spacing between marks. ScaleOffset and ScalePlacement just move the ticks in relation to the scale. What about spaces between the tickmarks themselves? Is there no way to increase the space between the minor tickmarks on one part of the scale but have them closer together on another part, for example. This would definitely come in handy at some point.

Thank you.

[Modified at 11/05/2008 08:46 AM]
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
CircularTickMarkMajor does not derive from CircularTickSet, but it does inheirt certain properties, such as the MajorInterval, which can be overridden for specific ticks.

It sounds like you want the gauge to be split into evenly distributed thirds: with the first 1/3 spanning values 1-5, second 1/3 spanning 5-10, and the final 1/3 spanning 10-50. Is that correct?

If so, the Gauge doesn't support this "automatically" as it is not a linear (or even logarithmic) ordering. You would need to come up with a linear range, and convert to/from your desired ranges.

On the other hand, if you just want the intervals to be different between 0-5, 5-10, and 10-50, then that is possible as I described in the last post. But here, the 0-5 range would be much smaller than the 10-50 range.

There is no way to customize the distance between tick marks along the radius, because those are place based on the value. If space was added, then it would no longer be at the correct location for the associated value. And therefore, would not match up with any pointers you have in the gauge.


Actipro Software Support

Posted 11 years ago by D
Avatar
Quote:
It sounds like you want the gauge to be split into evenly distributed thirds: with the first 1/3 spanning values 1-5, second 1/3 spanning 5-10, and the final 1/3 spanning 10-50. Is that correct?


Yes, this is what I want to do...as you said, I will have to convert to/from my ranges once I get into the non-linear territory over 5. I want the pointer needle to know where to go after the value of 5, as the numbers it would expect to hit are numbers different than what it needs to hit, if that makes sense. So it looks like I'll have to do some calculations in the codebehind file to tell that needle where to go.

Thank you for your explanations, they were very helpful.
The latest build of this product (v2019.1 build 0683) was released 16 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.