Pyecharts

2.1.0 · active · verified Mon Apr 13

Pyecharts is a powerful and flexible Python library designed to generate interactive ECharts-based visualizations. It provides a Pythonic interface to over 30 chart types, making it easier to create stunning and interactive data visualizations for web pages, Jupyter notebooks, and other Python frameworks. The library is actively maintained, with the current stable version being 2.1.0, released in February 2026, and regular updates incorporating new ECharts features.

Warnings

Install

Imports

Quickstart

This quickstart code creates a simple interactive bar chart using Pyecharts, adds two data series, and saves the chart as an HTML file named 'my_first_chart.html' in the current directory. This HTML file can then be opened in any web browser.

from pyecharts.charts import Bar
from pyecharts import options as opts

# Create a Bar chart instance
bar = (
    Bar()
    .add_xaxis(["Shirt", "Sweater", "Tie", "Pants", "T-shirt", "Jacket"])
    .add_yaxis("Seller A", [10, 20, 30, 40, 50, 60])
    .add_yaxis("Seller B", [15, 25, 35, 45, 55, 65])
    .set_global_opts(
        title_opts=opts.TitleOpts(title="ECharts Bar - Basic"),
        legend_opts=opts.LegendOpts(pos_left='center')
    )
)

# Render the chart to an HTML file
bar.render("my_first_chart.html")
print("Chart saved to my_first_chart.html")

view raw JSON →