Hello,
There is a event that when pointer change (by 10 to 30 example) ?
I want modify the annotation with my custom test, example:
When pointer is 10 the annotation is "Happy", when pointer move to 30 the annotation is "Very Happy".
I try with ValueChange but it's only for user interaction.
Thank
|
<SfLinearGauge Orientation="Orientation.Horizontal">
<LinearGaugeEvents ValueChange="ValueChanged"></LinearGaugeEvents>
<LinearGaugeAnnotations>
<LinearGaugeAnnotation AxisValue="@AxisIndex" ZIndex="1" X="@AnnotationX" Y="@AnnotationY">
<ContentTemplate>
<div class="custom-annotation">@AnnotationContent</div>
</ContentTemplate>
</LinearGaugeAnnotation>
</LinearGaugeAnnotations>
<LinearGaugeAxes>
<LinearGaugeAxis>
<LinearGaugePointers>
<LinearGaugePointer PointerValue="@PointerValue" EnableDrag="true"></LinearGaugePointer>
</LinearGaugePointers>
</LinearGaugeAxis>
</LinearGaugeAxes>
</SfLinearGauge>
@code{
public double PointerValue = 10;
public int AxisIndex = 10;
public string AnnotationContent = "Happy";
public double AnnotationX = -30;
public double AnnotationY = 25;
public void ValueChanged(ValueChangeEventArgs args)
{
PointerValue = Math.Round(args.Value);
AxisIndex = Convert.ToInt32(PointerValue);
if (PointerValue >= 30)
{
AnnotationX = -50;
AnnotationContent = "Very Happy";
} else
{
AnnotationX = -30;
AnnotationContent = "Happy";
}
}
} |
Thanks.
Working.