I am trying to build a circular gauge (180deg gauge (270-90 angle)) for monitoring a power factor value that has both lead and lag values.
The scale must start from 0 (
Left Hand Side) and end with 0 (
Right Hand Side
) with a mid-value of 1. The needle towards the LHS shows the lag values between 0 -1.5 and leads to the RHS with the values between 1-0.
I am not getting how to do so. There is an image in the attachment to get a better idea.
Thank you!
|
axisLabelRender(args) {
if (args.value > 1.0 && args.value <= args.axis.maximum)
args.text = args.axis.maximum - args.value;
}
loaded(args) {
if (
args.gauge.axes[0].pointers[0].value > 1.0 &&
args.gauge.axes[0].pointers[0].value <= args.gauge.axes[0].maximum
) {
args.gauge.setAnnotationValue(
0,
0,
'<div><span id="annotationValue" style="color:#F08080;font-size:15px;">' +
(args.gauge.axes[0].maximum - args.gauge.axes[0].pointers[0].value) +
' ' +
'LAG </span></div>'
);
} else {
args.gauge.setAnnotationValue(
0,
0,
'<div><span id="annotationValue" style="color:#F08080;font-size:15px;">' +
args.gauge.axes[0].pointers[0].value +
' ' +
'LAG </span></div>'
);
}
}
<CircularGaugeComponent id="circulargauge" axisLabelRender={this.axisLabelRender.bind(this)}
loaded={this.loaded.bind(this)}>
<AxesDirective>
<AxisDirective
startAngle={270}
endAngle={90}
radius="100%"
minimum={0}
maximum={2}
lineStyle={{ width: 15, color: '#F08080' }}
>
//..
//..
<PointersDirective>
<PointerDirective
value={0.8}
radius="60%"
color="#F08080"
/>
</PointersDirective>
</AxisDirective>
</AxesDirective>
</CircularGaugeComponent>
|
Hi Indumathi,
Thank You for your response.
This solution worked perfectly. Once again thank you very much!.
Regards,
Satyam