Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 653 Bytes

heatmap_base.md

File metadata and controls

27 lines (21 loc) · 653 Bytes

pyecharts 代码 / 效果

import random

from pyecharts import options as opts
from pyecharts.charts import HeatMap
from pyecharts.faker import Faker

value = [[i, j, random.randint(0, 50)] for i in range(24) for j in range(7)]
c = (
    HeatMap()
    .add_xaxis(Faker.clock)
    .add_yaxis(
        "series0", Faker.week, value, label_opts=opts.LabelOpts(position="middle")
    )
    .set_global_opts(
        title_opts=opts.TitleOpts(title="HeatMap-基本示例"),
        visualmap_opts=opts.VisualMapOpts(),
    )
    .render("heatmap_base.html")
)
<iframe width="100%" height="800px" src="Heatmap/heatmap_base.html"></iframe>