日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

echarts x和数据对应_echarts 折线图动态x轴及数据

發(fā)布時間:2024/9/15 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 echarts x和数据对应_echarts 折线图动态x轴及数据 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
ECharts

// Step:3 echarts & zrender as a Global Interface by the echarts-plain.js.

// Step:3 echarts和zrender被echarts-plain.js寫入為全局接口

var myChart = echarts.init(document.getElementById('main'));

myChart.setOption({

tooltip : {

trigger: 'axis'

},

toolbox: {

show : true,

feature : {

mark : {show: true},

dataView : {show: true, readOnly: false},

magicType : {show: true, type: ['line', 'bar']},

restore : {show: true},

saveAsImage : {show: true}

}

},

xAxis : [

{

type : 'category',

data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']

}

],

yAxis : [

{

type : 'value',

splitArea : {show : true}

}

],

series : [

{

name:'溫度值',

type:'line',

data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3]

}

]

});

var now = +new Date(1997, 9, 3);

var oneMinutes = 60 * 1000*15;

var value = Math.random() * 1000;

function test() {

var dates = [];

var datas = [];

for (var i = 0; i < 24 * 4; i++) {

now = new Date(+now + oneMinutes);

dates.push(now.getHours() + ":" + now.getMinutes());

value = value + Math.random() * 21 - 10;

datas.push(value);

}

myChart.setOption({

xAxis: [

{

type: 'category',

data: dates

}

],

series: [

{

name: '蒸發(fā)量',

type: 'line',

data: datas

}

]

});

}

運(yùn)行截圖

總結(jié)

以上是生活随笔為你收集整理的echarts x和数据对应_echarts 折线图动态x轴及数据的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。