jQuery UI Widgets › Forums › Chart › Gauges › Gauges › Using arrow Pointer Type not positioning
Tagged: javascript gauge, jqxgauge, linear gauge
This topic contains 2 replies, has 2 voices, and was last updated by Scott M 13 years, 2 months ago.
-
Author
-
I am trying to use the jqxLinearGauge with an arrow pointer rather than a rectangle pointer and I can’t seen to get the arrow to position to the value. The code is:
$(‘#HERE’).jqxLinearGauge({
orientation: ‘horizontal’,
rangeSize: ‘10%’,
width: ‘340px’,
height: ‘100px’,
labels: { position: ‘near’, interval: 10, offset: 40, visible: true, formatValue: function (value, position) { return value; } },
max: 100,
min: 0,
colorScheme: ‘scheme01’,
ticksMajor: { size: ‘10%’, interval: 10 },
ticksMinor: { size: ‘5%’, interval: 2.5, style: { ‘stroke-width’: 1, stroke: ‘#aaaaaa’} },
pointer: { pointerType: ‘arrow’, size: ‘20%’, offset:0},
ranges: [
{ startValue: 0, endValue: 20, style: { fill: ‘#A1F6B1’, stroke: ‘#FFA200’} },
{ startValue: 21, endValue: 40, style: { fill: ‘#D0F4A5’, stroke: ‘#FFA200’} },
{ startValue: 41, endValue: 60, style: { fill: ‘#F3E0A9’, stroke: ‘#FFA200’} },
{ startValue: 61, endValue: 80, style: { fill: ‘#F2AFAD’, stroke: ‘#FFA200’} },
{ startValue: 81, endValue: 100, style: { fill: ‘#F0B1DC’, stroke: ‘#FFA200’} }
],
value: 50
});The gauge displays although the arrow points to 0 no matter what I try. Is there something I am doing wrong? When the pointer property is not set, it properly sets to the value using the rectangle pointer
Hi Scott M,
After the initialization of the linear gauge, do this:
$('#HERE').jqxLinearGauge('value', 50);Best Wishes,
Peter StoevjQWidgets Team
http://www.jqwidgets.comPeter –
Thanks – that did the trick. I’ve been using the value parameter to initially set the pointer in other objects without issue but this fixes the problem.
Thanks again…
Scott
-
AuthorPosts
You must be logged in to reply to this topic.