五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

VUE動(dòng)態(tài)排序柱狀圖

2022-03-21 15:00 作者:丘奇小怪  | 我要投稿

1、新建項(xiàng)目,下載echarts

npm install echarts@4.9.0

2、修改helloworld.vue

修改template:

? <div class="echart" id="mychart" :style="myChartStyle"></div>


修改script:

import * as echarts from "echarts";


export default {

? data() {

? ? return {

? ? ? myChart: {},

? ? ? sortData: [], //動(dòng)態(tài)排序數(shù)據(jù)

? ? ? myChartStyle: { float: "left", width: "100%", height: "400px" }, //圖表樣式

? ? ? dynamicSortZZTOption: {

? ? ? ? xAxis: {

? ? ? ? ? max: "dataMax"

? ? ? ? },

? ? ? ? yAxis: {

? ? ? ? ? type: "category",

? ? ? ? ? data: ["A", "B", "C", "D", "E"],

? ? ? ? ? inverse: true,

? ? ? ? ? animationDuration: 300,

? ? ? ? ? animationDurationUpdate: 300,

? ? ? ? ? max: 4 // only the largest 3 bars will be displayed

? ? ? ? },

? ? ? ? series: [

? ? ? ? ? {

? ? ? ? ? ? realtimeSort: true,

? ? ? ? ? ? name: "動(dòng)態(tài)變化",

? ? ? ? ? ? type: "bar",

? ? ? ? ? ? data: [],

? ? ? ? ? ? label: {

? ? ? ? ? ? ? show: true,

? ? ? ? ? ? ? position: "right",

? ? ? ? ? ? ? valueAnimation: true

? ? ? ? ? ? }

? ? ? ? ? }

? ? ? ? ],

? ? ? ? legend: {

? ? ? ? ? show: true

? ? ? ? },

? ? ? ? animationDuration: 3000,

? ? ? ? animationDurationUpdate: 3000,

? ? ? ? animationEasing: "linear",

? ? ? ? animationEasingUpdate: "linear"

? ? ? }

? ? };

? },

? mounted() {

? ? // 圖表初始化

? ? this.myChart = echarts.init(document.getElementById("mychart"));

? ? // 數(shù)據(jù)初始化

? ? for (let i = 0; i < 5; ++i) {

? ? ? this.sortData.push(Math.round(Math.random() * 200));

? ? }

? ? // 數(shù)據(jù)刷新

? ? setInterval(() => {

? ? ? this.pageUpdate();

? ? }, 3000);

? },

? methods: {

? ? // 數(shù)據(jù)刷新

? ? pageUpdate() {

? ? ? console.log(this.dynamicSortZZTOption.series[0].data);

? ? ? this.dynamicSortZZTOption.series[0].data = this.sortData;

? ? ? for (let i = 0; i < this.sortData.length; ++i) {

? ? ? ? if (Math.random() > 0.9) {

? ? ? ? ? this.sortData[i] += Math.round(Math.random() * 2000);

? ? ? ? } else {

? ? ? ? ? this.sortData[i] += Math.round(Math.random() * 200);

? ? ? ? }

? ? ? }

? ? ? this.myChart.setOption(this.dynamicSortZZTOption);

? ? ? //隨著屏幕大小調(diào)節(jié)圖表

? ? ? window.addEventListener("resize", () => {

? ? ? ? this.myChart.resize();

? ? ? });

? ? }

? }

};

刪除style即可。

吐槽:b站檢測(cè)到j(luò)s居然會(huì)警告環(huán)境異常無法提交。。。


VUE動(dòng)態(tài)排序柱狀圖的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
二连浩特市| 永新县| 甘谷县| 子洲县| 崇信县| 平和县| 丹巴县| 德化县| 县级市| 台北市| 南澳县| 明星| 九龙县| 洛扎县| 诸城市| 云霄县| 英山县| 彭阳县| 大丰市| 绥德县| 聂拉木县| 盘山县| 清新县| 永登县| 博野县| 肇源县| 清原| 磐石市| 清河县| 察雅县| 新乡县| 苏尼特右旗| 独山县| 溧水县| 禄丰县| 宿松县| 伊吾县| 治多县| 绩溪县| 资中县| 香港 |