BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
<SfLinearGauge ID="GaugeThree" @ref="GaugeThree" Orientation="Syncfusion.Blazor.LinearGauge.Orientation.Horizontal" Background="transparent" AllowMargin="false" Width="100%" Height="100%">
<LinearGaugeMargin Left="0" Right="0" Top="0" Bottom="0"></LinearGaugeMargin>
<LinearGaugeBorder Color="#FF0000" Width="2"></LinearGaugeBorder>
<LinearGaugeEvents OnGaugeMouseDown="MouseDown"></LinearGaugeEvents>
<LinearGaugeContainer Type="ContainerType.RoundedRectangle">
<LinearGaugeContainerBorder Width="0"></LinearGaugeContainerBorder>
<LinearGaugeAxes>
<LinearGaugeAxis Minimum="1000" Maximum="500000">
<LinearGaugeLine Width="0" />
<LinearGaugeMajorTicks Interval="50000" Height="0" />
<LinearGaugeMinorTicks Interval="0" Height="0" />
<LinearGaugeAxisLabelStyle>
<LinearGaugeAxisLabelFont Size="0"></LinearGaugeAxisLabelFont>
</LinearGaugeAxisLabelStyle>
<LinearGaugePointers>
<LinearGaugePointer Width="0"/>
</LinearGaugePointers>
<LinearGaugeRanges>
<LinearGaugeRange Start="3000" End="14000" StartWidth="45" EndWidth="45" Color="#FF0000" Offset="0" />
<LinearGaugeRange Start="31000" End="44000" StartWidth="45" EndWidth="45" Color="#0000FF" Offset="0" />
<LinearGaugeRange Start="160000" End="290000" StartWidth="45" EndWidth="45" Color="#00FF00" Offset="0" />
</LinearGaugeRanges>
</LinearGaugeAxis>
</LinearGaugeAxes>
</LinearGaugeContainer>
</SfLinearGauge>
Syncfusion.Blazor.LinearGauge.MouseEventArgs X and Y values seem to be the pixel X,Y on the screen.
Thanks.
Hi Jeff,
We do not currently support returning details in the Linear Gauge using the "OnGaugeMouseDown" event, whether the range is clicked or not. We have considered your requirement as an improvement and added it to our features request list. However, we will include this implementation in our 2023 Volume 2 release which is expected to be available by the end of June 2023. Meanwhile, please find the feedback link below to keep track of this improvement.
Hi Jeff,
In general, we do not provide the entire class
object (LinearGaugeRange) as a property value in the event argument when
an event is defined in the Blazor component (SfLinearGauge). To identify the
range that has been clicked, we normally provide the index value of the range
and the axis. However, these index values cannot be used to change the range
element's attributes such as color, border, and so on. Could you please tell us
about your exact requirement in retrieving the range details in the “OnGaugeMouseDown”
event? It will be helpful for us to analyze and assist you further.
It would be useful to get the index value of the each of the Ranges on the Linear Gauge. I just wanted to get access to the Start and End values of the Ranges themselves.
Thanks,
jeff
Hi Jeff,
We have implemented the feature - “Support to identify which Linear Gauge range is clicked via OnGaugeMouseDown event” and the implementation is included in our Essential Studio 2023 Volume 2 Main Release v22.1.34 which is rolled out and is available for download under the following link.
Now, you can get the index value of ranges from the “RangeIndex” property in the event argument of the “OnGaugeMouseDown” event when clicked on the Linear Gauge. Please find the code snippet for the same below.
Code Snippet:
<SfLinearGauge ID="GaugeThree" @ref="GaugeThree" > //.. <LinearGaugeEvents OnGaugeMouseDown="MouseDown"></LinearGaugeEvents> <LinearGaugeContainer Type="ContainerType.RoundedRectangle"> <LinearGaugeAxes> <LinearGaugeAxis Minimum="1000" Maximum="500000"> //.. <LinearGaugeRanges> <LinearGaugeRange Start="3000" End="14000" StartWidth="45" EndWidth="45" Color="#FF0000" Offset="0" /> //.. </LinearGaugeRanges> </LinearGaugeAxis> </LinearGaugeAxes> </LinearGaugeContainer> </SfLinearGauge> @code{ public void MouseDown(Syncfusion.Blazor.LinearGauge.MouseEventArgs args) { Console.WriteLine(args.RangeIndex); } } |
Please find the sample and video for demonstration from the below link.
Sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/LinearGauge1292492323
Video - https://www.syncfusion.com/downloads/support/directtrac/general/ze/linear-665625359
We thank you for your support and appreciate
your patience in waiting for this release. Please get in touch with us if you
require any further assistance.