Svg-charts

Latest version: v4.0

Safety actively analyzes 681775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

4.0

===

* Removed support for ``compress`` flag on Graphs.
Simply invoke ``zlib.compress`` on the data if needed.

* ``Graph.burn`` now returns the rendered SVG as a
Unicode string without XML declaration and without
pretty-printing. To customize the XML rendering,
override or replace the ``Graph.render`` static method.

3.4.4

=====

* 17: Fix issue in subclassed Line charts.

3.4.3

=====

* Minor tweak to README for better rendering in PyPI.

3.4.2

=====

* Update docs link.

3.4.1

=====

* 16: Restore support for passing iterable data elements.

3.4

===

Issue 14:

* ``svg.charts.plot.Plot``
(and hence its subclass ``svg.charts.time_series.Plot``)
now accept data as a sequence of pairs. Example::

import svg.charts.plot

g = svg.charts.plot.Plot()
g.add_data(dict(title='Example',
data=[(1, 1), (2, 4), (3, 9)]))

* data point labels that are drawn when
``show_data_values = True`` can have their label changed
from the default (which is the y-value) by giving a data item
a ``.text`` attribute.
It is convenient to used ``namedtuple()`` for this::

import svg.charts.plot
from collections import namedtuple

Datum = nametuple("Datum", 'x y text')

g = svg.charts.plot.Plot()
g.add_data(dict(title='Example',
data=[Datum(1, 1, 'first'),
Datum(2, 4, 'second'),
Datum(3, 9, 'third')]))

(in fact data items can have any extra attribute;
only ``.text`` is used currently)

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.