当前位置:网站首页>Data visualization - biaxial comparison effect
Data visualization - biaxial comparison effect
2022-06-12 20:44:00 【six million five hundred and fifty thousand five hundred and tw】

import pyecharts.options as opts
from pyecharts.charts import Line
# Will be in v1.1.0 Change in
from pyecharts.commons.utils import JsCode
"""
Gallery Use pyecharts 1.0.0
Reference address : https://echarts.baidu.com/examples/editor.html?c=multiple-x-axis
Functions that cannot be realized at present :
1、 no
"""
js_formatter = """function (params) {
console.log(params);
return ' precipitation ' + params.value + (params.seriesData.length ? ':' + params.seriesData[0].data : '');
}"""
(
Line(init_opts=opts.InitOpts(width="1600px", height="800px"))
.add_xaxis(
xaxis_data=[
"2016-1",
"2016-2",
"2016-3",
"2016-4",
"2016-5",
"2016-6",
"2016-7",
"2016-8",
"2016-9",
"2016-10",
"2016-11",
"2016-12",
]
)
.extend_axis(
xaxis_data=[
"2015-1",
"2015-2",
"2015-3",
"2015-4",
"2015-5",
"2015-6",
"2015-7",
"2015-8",
"2015-9",
"2015-10",
"2015-11",
"2015-12",
],
xaxis=opts.AxisOpts(
type_="category",
axistick_opts=opts.AxisTickOpts(is_align_with_label=True),
axisline_opts=opts.AxisLineOpts(
is_on_zero=False, linestyle_opts=opts.LineStyleOpts(color="#6e9ef1")
),
axispointer_opts=opts.AxisPointerOpts(
is_show=True, label=opts.LabelOpts(formatter=JsCode(js_formatter))
),
),
)
.add_yaxis(
series_name="2015 precipitation ",
is_smooth=True,
symbol="emptyCircle",
is_symbol_show=False,
# xaxis_index=1,
color="#d14a61",
y_axis=[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
label_opts=opts.LabelOpts(is_show=False),
linestyle_opts=opts.LineStyleOpts(width=2),
)
.add_yaxis(
series_name="2016 precipitation ",
is_smooth=True,
symbol="emptyCircle",
is_symbol_show=False,
color="#6e9ef1",
y_axis=[3.9, 5.9, 11.1, 18.7, 48.3, 69.2, 231.6, 46.6, 55.4, 18.4, 10.3, 0.7],
label_opts=opts.LabelOpts(is_show=False),
linestyle_opts=opts.LineStyleOpts(width=2),
)
.set_global_opts(
legend_opts=opts.LegendOpts(),
tooltip_opts=opts.TooltipOpts(trigger="none", axis_pointer_type="cross"),
xaxis_opts=opts.AxisOpts(
type_="category",
axistick_opts=opts.AxisTickOpts(is_align_with_label=True),
axisline_opts=opts.AxisLineOpts(
is_on_zero=False, linestyle_opts=opts.LineStyleOpts(color="#d14a61")
),
axispointer_opts=opts.AxisPointerOpts(
is_show=True, label=opts.LabelOpts(formatter=JsCode(js_formatter))
),
),
yaxis_opts=opts.AxisOpts(
type_="value",
splitline_opts=opts.SplitLineOpts(
is_show=True, linestyle_opts=opts.LineStyleOpts(opacity=1)
),
),
)
.render("multiple_x_axes.html")
)
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
- 45.
- 46.
- 47.
- 48.
- 49.
- 50.
- 51.
- 52.
- 53.
- 54.
- 55.
- 56.
- 57.
- 58.
- 59.
- 60.
- 61.
- 62.
- 63.
- 64.
- 65.
- 66.
- 67.
- 68.
- 69.
- 70.
- 71.
- 72.
- 73.
- 74.
- 75.
- 76.
- 77.
- 78.
- 79.
- 80.
- 81.
- 82.
- 83.
- 84.
- 85.
- 86.
- 87.
- 88.
- 89.
- 90.
- 91.
- 92.
- 93.
- 94.
- 95.
- 96.
- 97.
- 98.
- 99.
- 100.
- 101.
- 102.
- 103.
- 104.
- 105.
- 106.
- 107.
边栏推荐
- [tutorial] Firefox send: deployment method of Firefox open source temporary file sharing service platform
- Nexus3搭建本地仓库
- 标量、向量、数组和矩阵
- 入行5年从10k的功能测试到年薪40w的测试开发,花7天时间整理的超全学习路线
- Junda technology is applicable to "kestar" intelligent precision air conditioning network monitoring
- CentOS7安装MySQL5.7操作说明
- 【无标题】
- Summary of machine learning materials
- SAP QM preliminary - cannot assign a sampling policy to an inspection characteristic when maintaining an inspection plan by executing transaction code qp02?
- 牛客網:三數之和
猜你喜欢

WordPress optimization tutorial makes WordPress open faster

A simple understanding of consistent hash

Halcon angle and radian interchange

Introduction to the characteristics of building a balancer decentralized exchange market capitalization robot

Lightroom Ambassador series: capturing nostalgia with MEG loeks

Detailed explanation of search tree and hash table

Algorinote_ 2_ Main theorem and Akra bazzi theorem

Properties to YML

Wechat jsapi payment pit summary

Niuke.com: sum of three numbers
随机推荐
Restful API 接口规范
Preliminary understanding of regular expressions (regex)
In the spring recruitment of 2022, the test engineer will have a full set of interview strategies to thoroughly understand all the technical stacks (all dry goods)
remote: Support for password authentication was removed on August 13, 2021
Do we media video, and share the necessary app for friendly new media operation
Understanding of functions
How to implement overloading in JS
Can tonghuashun open an account? Can tonghuashun directly open the security of securities companies on the app? How to open an account online when buying stocks
View 的事件分发机制
UVa11991 Easy Problem from Rujia Liu
Halcon angle and radian interchange
Alipay payment Episode 12: Crazy God and Feige Alipay payment configuration code (free resources, no thanks for taking them away)
EditText control starts from the upper left corner
半路自学测试成功转行,第一份测试工作就拿10k
Golden, silver and four job hopping season, teach you these tips to improve the interview success rate
新品发布丨竣达智能综合环境监测终端
centos7 安装 mysql 5.7
Minio client (MC command) implements data migration
Typescript definition type: type 'timeout' cannot be assigned to type 'number';
SAP QM preliminary - cannot assign a sampling policy to an inspection characteristic when maintaining an inspection plan by executing transaction code qp02?