A RetroSearch Logo

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

Search Query:

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

Gauge Chart in pygal - GeeksforGeeks

Gauge Chart in pygal

Last Updated : 03 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.

Gauge Charts

Gauge charts are also known as dial charts or speedometer charts. This type of chart is often used in executive dashboard reports to show key business indicators. Gauge charts are much useful for comparing the values between a small number of variables either by using multiple needles on the same gauge or by using multiple gauges. It shows the maximum, the minimum, and the present value of data being analyzed. It can be created using the

Gauge()

method.

Syntax:
gauge_chart = pygal.Gauge()
Example 1: Python3 1==
# importing pygal
import pygal
import numpy


# creating the chart object
gauge = pygal.Gauge()

# naming the title
gauge.title = 'Gauge Chart'        

# Random data
gauge.add('A', numpy.random.rand(10))
gauge.add('B', numpy.random.rand(10))
gauge.add('C', numpy.random.rand(10))
gauge.add('D', numpy.random.rand(10))

gauge
Output: Example 2: Python3 1==
# importing pygal
import pygal

# creating the chart object
gauge = pygal.Gauge()

# naming the title
gauge.title = 'Gauge Chart'     

gauge.range = [0, 5000]

# Random data
gauge.add('A', 1000)
gauge.add('B', 2000)
gauge.add('C', 3500)

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