![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
A Python package for creating and rendering SVG charts, including line charts, axes, legends, and text labels. This package supports both simple and complex chart structures and is highly customizable for various types of visualizations.
Line
, Text
, Axis
, and Shape
... code:: bash
pip install pysvgchart
Alternatively, you can clone this repository and install it locally:
.. code:: bash
git clone https://github.com/arowley-ai/py-svg-chart.git cd py-svg-chart pip install .
Create a simple line chart with the following code:
.. code:: python
import pysvgchart as psc
x_values = [0, 1, 2, 3, 4, 5] y_values = [[0, 2, 4, 6, 8, 10], [0, 1, 2, 3, 4, 5]]
chart = psc.SimpleLineChart(x_values, y_values, y_names=["Series 1", "Series 2"])
chart.add_legend(x_position=500, y_position=60, element_x=100, element_y=0, line_length=20, line_text_gap=5)
chart.series[0].styles['stroke'] = 'red' chart.series[1].styles['stroke'] = 'blue' chart.x_axis.axis_line.styles['stroke'] = 'black'
svg_output = chart.render
with open("chart.svg", "w") as f: f.write(svg_output)
The entire codebase is designed to be extensible to enable unlimited customisation. All of the lower level elements are accessible via properties of the charts.
We welcome contributions! If you’d like to contribute to the project, please follow these steps:
Create a new branch (git checkout -b feature-branch). Commit your changes (git commit -am ‘Add feature’). Push to the branch (git push origin feature-branch). Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Creates svg based charts in python
We found that pysvgchart demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.