We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

[SfRadialGauge] RadialAxis - onAxisTapped not giving the value corresponding to the range i touched

This is visual result i got:

Between the beginning and the "0" there is not touch detected and from "0" to "1" the range goes from 0 to 1, and so on. Touches are detected outside the visual gauge.

I want each range to start from the desired number and ending close to the next one (i.e 0 to 0.99).

Any idea? 

This is my code:

SfRadialGauge(
axes: <RadialAxis>[
RadialAxis(
canScaleToFit: true,
onAxisTapped: (value) {
print(value);
},
showLabels: false,
showTicks: false,
minimum: 0,
maximum: 11,
ranges: <GaugeRange>[
GaugeRange(
startValue: 0,
endValue: 0.99,
label: '0',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
GaugeRange(
startValue: 1,
endValue: 1.99,
label: '1',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
GaugeRange(
startValue: 2,
endValue: 2.99,
label: '2',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
GaugeRange(
startValue: 3,
endValue: 3.99,
label: '3',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
GaugeRange(
startValue: 4,
endValue: 4.99,
label: '4',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
GaugeRange(
startValue: 5,
endValue: 5.99,
label: '5',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
GaugeRange(
startValue: 6,
endValue: 6.99,
label: '6',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
GaugeRange(
startValue: 7,
endValue: 7.99,
label: '7',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
GaugeRange(
startValue: 8,
endValue: 8.99,
label: '8',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
GaugeRange(
startValue: 9,
endValue: 9.99,
label: '9',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
GaugeRange(
startValue: 10,
endValue: 10.99,
label: '10',
sizeUnit: GaugeSizeUnit.factor,
startWidth: 0.65,
endWidth: 0.65),
],
),
],
),

10 Replies

YG Yuvaraj Gajaraj Syncfusion Team February 1, 2023 01:06 PM UTC

Hi Alvaro,


Greetings from Syncfusion.


Your requirement can be achieved by removing or setting the canScaleToFit property to false in the RadialAxis, which will work as per your requirement. We have shared the code snippet below for your requirement.


Code snippet:

SfRadialGauge(
axes: <RadialAxis>[
RadialAxis(
canScaleToFit: false,
// Other required properties
),
],
)


Regards,

Yuvaraj.



AP Alvaro Piorno February 1, 2023 01:49 PM UTC

I tried it, it's size was reduced but it is still having the same issue. Just in case, i have the RadialGauge inside a Column that is inside a Padding



YG Yuvaraj Gajaraj Syncfusion Team February 2, 2023 02:30 PM UTC

Hi Alvaro,


We can able to reproduce the reported issue at our, and we are investigating in the source, will update you the further details tomorrow. We appreciate your patience until then.


Regards,

Yuvaraj.



AP Alvaro Piorno February 2, 2023 02:38 PM UTC

Hi,


thanks for the reply, i will be waiting for it.


Cheers



YG Yuvaraj Gajaraj Syncfusion Team February 3, 2023 01:16 PM UTC

Hi Alvaro,


The reported issue is being reproduced at our end, and we are considering this to be a bug. We will log the feedback and share it with you. However, we are unable to reproduce the issue when setting the canScaleToFit property to false. Could you please provide a sample to reproduce the issue when canScaleToFit is false? That would be helpful for us to provide you with a feasible solution.


Regards,

Yuvaraj.




AP Alvaro Piorno February 4, 2023 12:06 AM UTC

I tried from scratch and could reach the goal with canScaleToFit in false, so the bug is only when canScaleToFit is true



YG Yuvaraj Gajaraj Syncfusion Team February 6, 2023 02:35 PM UTC

Hi Alvaro,


Thanks for the update. As stated earlier, we are considering this as a bug and we will log the feedback and share it with you. We will update the further details tomorrow.


Regards,

Yuvaraj.



LA Lavanya Anaimuthu Syncfusion Team February 7, 2023 01:54 PM UTC

Hi Alvaro,


We are able to replicate the reported issue regarding onAxisTapped callback is not working while setting canScaleToFit property at our end and have logged bug report for it in our feedback portal. We will fix and include the changes in our weekly patch which is expected to be rolled out on February 21. We will update you here once the release is rolled out and we appreciate your patience until then. You can also track the status of the bug with the feedback below.


https://www.syncfusion.com/feedback/40920


Regards,

Lavanya A.



YG Yuvaraj Gajaraj Syncfusion Team February 21, 2023 10:49 AM UTC

Hi Alvaro,


Sorry for the inconvenience, we have fixed this issue and it is now under the automation testing phase. We will include this fix in our upcoming weekly patch release, which is expected to be rolled out on February 28, 2023. We will update you once the release has been rolled out. We appreciate your patience until then.


Regards,

Yuvaraj.



YG Yuvaraj Gajaraj Syncfusion Team February 28, 2023 10:37 AM UTC

Hi Alvaro,


The reported issue regarding the onAxisTapped callback not working in a specific range while setting the canScaleToFit property has been fixed and rolled out in our weekly patch release. To avoid this please upgrade the gauge package to the below version.


Version: https://pub.dev/packages/syncfusion_flutter_gauges/versions/20.4.52


Regards,

Yuvaraj.


Loader.
Live Chat Icon For mobile
Up arrow icon