Toggle navigation
折线浮点值
By
神丶麟儿
2019-05-17 06:13:11
脚本
16
21
作品使用的第三方脚本
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
option = { tooltip: { formatter: function(params) { if (params.componentType == "series") { return params.seriesName + "
" + params.name + " " + params.data[0].split(" ")[1] } else { var date = new Date(params.value); return params.seriesName + "
" + params.name + " " + date.getHours() + ":" + date.getMinutes() } }, }, grid: { left: '3%', right: '4%', bottom: '5%', containLabel: true }, xAxis: { type: 'category', axisLine: { lineStyle: { // color: '#fff', } }, axisLabel: { textStyle: { // color: '#fff', fontSize: 10 }, formatter: '{value} ' }, boundaryGap: false, data: ["北京市", "大庆市", "重庆市", "长沙市", "杭州市", "金华市", "昌吉回族自治州", "宝鸡市", "宜春市", "天津市", "临夏回族自治州", "福州市", "哈尔滨市", "昆明市", "驻马店市"] }, yAxis: { type: 'value', }, series: [{ name: '入睡时间', type: 'line', smooth: true, lineStyle: { normal: { width: 3, // color: "white", shadowColor: 'rgba(0,0,0,0.4)', shadowBlur: 10, shadowOffsetY: 10 } }, markLine: { label: { normal: { formatter: function(params) { var date = new Date(params.value); return date.getHours() + " : " + date.getMinutes() } } }, data: [{ type: 'average', name: '平均值' }] }, data: [1444, 1411, 1439, 1437, 1439, 1418, 1444, 1454, 1387, 1441, 1450, 1400, 1415, 1386, 1378] }, { name: '起床时间', type: 'line', smooth: true, symbol: "pin", // showSymbol: true, symbolSize: 50, label: { show: true, normal: { position: "start", fontSize: 10, grid: { left: 100 } } }, // markLine: { // silent: true, // symbol: 'none', // label: { // normal: { // formatter: '{b}', // position: "start", // fontSize: 10, // grid: { // left: 100 // } // } // }, // data: [{ // yAxis:700, // name: "分钟", // itemStyle: { // normal: { // lineStyle: { // width: 1, // type: 'solid', // fontSize: 10 // }, // color: "#e7e5e4" // } // } // } // ] // }, lineStyle: { normal: { width: 3, color: "black", shadowColor: 'rgba(0,0,0,0.4)', shadowBlur: 10, shadowOffsetY: 10 } }, data: [432, 409, 437, 413, 442, 412, 456, 392, 390, 433, 445, 410, 396, 379, 368] }, { //定位入睡开始时间 name: '定位1', type: 'line', smooth: false, symbolSize: 0, data: [ ["2019-3-5 20:00:00", 0] ] }, { //定位起床结束时间 name: '定位2', type: 'line', smooth: false, symbolSize: 0, data: [ ["2019-3-6 10:00:00", 0] ] }] };