Charting in python is possible with Charts. The Apache ECharts project is a web-based charting library. It was started in 2013 and built using 77.5K lines of TypeScript. It is well documented and has over 200 examples of its API’s usage.
Let us look at an example:
import json
import pyecharts.options as opts
from pyecharts.charts import Sankey
data = json.loads(open('energy.json', 'r').read())
Sankey(init_opts=opts.InitOpts(width="800px", height="600px")).add(
series_name="",
nodes=data["nodes"],
links=data["links"],
itemstyle_opts=opts.ItemStyleOpts(border_width=1,
border_color="#aaa"),
linestyle_opt=opts.LineStyleOpts(color="source",
curve=0.5,
opacity=0.5),
tooltip_opts=opts.TooltipOpts(trigger_on="mousemove"),
)\
.set_global_opts(title_opts=opts.TitleOpts(title="Sankey Diagram"))\
.render("sankey_diagram.html")
please check out : https://echarts.apache.org/en/index.html