A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/python/solid-gauge-chart-in-pygal/ below:

Solid Gauge Chart in Pygal

Solid Gauge Chart in Pygal

Last Updated : 10 Jul, 2020

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.

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
# 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

Output:

Example 2:

Python3
# 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

Output:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4