Solid Gauge Chart in Pygal

Pygal is a Python module that is mainly used to build SVG (Scalar Vector Graphics) graphs and charts. SVG is a vector-based graphics in the XML format that can be edited in any editor. Pygal can create graphs with minimal lines of code that can be easy to understand and write.

Solid Gauge Chart

Gauges are the popular charts which help for dashboards, they anticipate a number in a range at a glance. It can use colored bands, hands, and combinations to display multiple values and their relation to a numeric scale.

Syntax:

gauge = pygal.SolidGauge()

Example 1:

Python3



filter_none

edit
close

play_arrow

link
brightness_4
code

# importing pygal
import pygal
  
# creating the chart object
Solid_Gauge = pygal.SolidGauge(inner_radius = 0.75)
  
# naming the title
Solid_Gauge.title = 'Solid Gauge Chart'     
  
# Random data
Solid_Gauge.add('A', [{'value': 1000, 'max_value': 5000}])
Solid_Gauge.add('B', [{'value': 12, 'max_value': 20}])
Solid_Gauge.add('C', [{'value': 99, 'max_value': 100}])
  
Solid_Gauge

chevron_right


Output:

Example 2:

Python3

filter_none

edit
close

play_arrow

link
brightness_4
code

# importing pygal
import pygal
  
# creating the chart object
Solid_Gauge = pygal.SolidGauge(inner_radius = 0.75
                               half_pie = True)
  
# naming the title
Solid_Gauge.title = 'Solid Gauge Chart'     
  
# Random data
Solid_Gauge.add('A', [{'value': 1000, 'max_value': 5000}])
Solid_Gauge.add('B', [{'value': 12, 'max_value': 20}])
Solid_Gauge.add('C', [{'value': 99, 'max_value': 100}])
  
Solid_Gauge

chevron_right


Output:




My Personal Notes arrow_drop_up


If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.