Articles in this section
Category / Section

How to create the various directional semi-circular gauge using the Flutter radial gauge?

3 mins read

Description

This article describes how to create various directional semi-circular gauge using the Flutter radial gauge widget.

Solution

You can create the semi-circular gauge using the radial gauge by adjusting the startAngle and endAngle property of radial axis.

Step 1:  Create a radial gauge and add an axis.

@override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: Center(
          child: SfRadialGauge(
        axes: <RadialAxis>[
          RadialAxis(),
        ],
      )),
    );
  }

 

Step 2: Set the startAngle property as 270 and endAngle property as 90 to show east direction semi-circular gauge.

axes: <RadialAxis>[
                  RadialAxis(
                      startAngle: 270,
                      canScaleToFit: true,
                      endAngle: 90,
                      interval: 10)
                ],

 

Enable the canScaleToFit property of radial axis to fit the gauge in the available size.

East direction

Step 3: Set the startAngle property as 90 and endAngle property as 270 and set isInversed property to true to show the west directional semi-circular gauge.

axes: <RadialAxis>[
                  RadialAxis(
                      startAngle: 90,
                      canScaleToFit: true,
                      endAngle: 270,
                      isInversed: true,
                      interval: 10)
                ],

 

Output:

West direction

 

Step 4: Set the startAngle property as 180 and endAngle property to 0 to show the north directional semi-circular gauge.

axes: <RadialAxis>[
                  RadialAxis(
                      startAngle: 180,
                      canScaleToFit: true,
                      endAngle: 0,
                      interval: 10)
                ]

 

Output:

North direction

Step 5: Set the startAngle property as 0 and endAngle property as 180. Set isInversed property to axis as true to show the south directional semi-circular gauge.

axes: <RadialAxis>[
                  RadialAxis(
                      startAngle: 0,
                      canScaleToFit: true,
                      isInversed: true,
                      endAngle: 180,
                      interval: 10)
                ]

 

Output:

West direction

 

View the Github Sample here.

 

Conclusion

I hope you enjoyed learning about how how-to-create-the-various-directional-semi-circular-gauge-using-the-flutter-radial-gauge.

You can refer to our  Flutter RadialGauge feature tour page to learn about its other groundbreaking feature representations. You can also explore our Flutter RadialGauge documentation to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!
Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied