Pyecharts之多维数据可视化
1.柱状图与折线图多维数据 较一维加一个y轴坐标 from pyecharts . charts import Bar from pyecharts import options as opts bar = Bar ( ) y1 = [ 28 , 32 , 15 , 45 ] x2 = [ '美女' , '模特' , '公主' , '学生' ] y2 = [ 20 , 30 , 10 , 40 ] bar . add_xaxis ( x2 ) bar . add_yaxis ( 'KTV' , y1 ) bar . add_yaxis ( '98' , y2 ) bar . set_global_opts ( title_opts = opts . TitleOpts ( title = '夜总会情况' ) ) bar . render ( ) 折线图同理,将 Bar改为 Line 2.显示多组柱状图和折线图 from pyecharts . charts import Bar , Grid from pyecharts import options as opts from pyecharts . globals import ThemeType t1 = Bar ( ) x1 = [ '帅哥' , '青年' , '男神' , '男人' ] y1 = [ 28 , 32 , 15