class visigoth.charts.area.Area(data, x=0, y=1, hue=None, id=None, label=None, size=None, width=768, height=768, hue_manager=None, marker_manager=None, smoothing=0.0, stepping=False, line_width=4, font_height=24, text_attributes={}, value_formatter=None)

Create a stacked area plot


data (list) – A relational data set (for example, list of dicts/lists/tuples describing each point)

Keyword Arguments
  • x (str or int) – Identify the column to specify x-axis point value

  • y (str or int) – Identify the column to specify y-axis point value. Y values should be positive.

  • hue (str or int) – Identify the column to define the area and hue

  • id (str or int) – Identify the column to define the unique id of each point

  • label (str or int) – Identify the column to define the label of each point

  • size (str or int) – Identify the column to determine the size of each point

  • width (int) – the width of the plot including axes

  • height (int) – the height of the plot including axes

  • hue_manager (object) – a ContinuousHueManager or DiscreteHueManager instance to control line hue

  • marker_manager (object) – a MarkerManager instance to control marker appearance

  • smoothing (float) – smoothing factor to apply to lines, 0.0=no smoothing

  • stepping (bool) – create charts with vertical steps

  • line_width (int) – width of the lines

  • font_height (int) – the height of the font for text labels

  • text_attributes (dict) – SVG attribute name value pairs to apply to labels

  • value_formatter (visigoth.utils.ValueFormatter) – control the way values are represented


x-axis values can be int,float,datetime.datetime or datetime.timedelta y-axis values can be int,float or datetime.timedelta and must be greater or equal to 0


(Link to open example in new tab):

Source Code (Link to Github):

# -*- coding: utf-8 -*-

from visigoth.diagram import Diagram
from visigoth.charts.area import Area
from visigoth.common.legend import DiscreteHueLegend

data = [(0,1,"A"),(1,1.5,"A"),(2,1.6,"A"),(3,1.3,"A"),(4,1.2,"A")] + \
    [(0,4,"B"),(1,3.5,"B"),(2,2.6,"B"),(3,1.6,"B"),(4,0.8,"B")] + \

d = Diagram(fill="white")

a = Area(x=0,y=1,hue=2,data=data,width=500,height=400)

legend = DiscreteHueLegend(a.getHueManager(),width=400,legend_columns=2)

html = d.draw(format="html")

f = open("example.html", "w")