
vue-echarts的千奇百变
vue-echarts的千奇百变
yuyu_2019
这个作者很懒,什么都没留下…
展开
-
echart环形图渐变色
【代码】echart环形图渐变色。原创 2023-11-02 15:51:10 · 569 阅读 · 0 评论 -
lenged formatter
legend: { top: 'center', left: '60px', orient: 'vertical', textStyle: { color: '#fff', // 文字颜色 fontSize: 14, }, padding: [50, 20], // 整体padding itemGap: 20, // 每项间距 formatter: (pamars) => { console.log(pamars) let data =原创 2022-01-14 17:07:54 · 625 阅读 · 0 评论 -
echarts 环形图加背景
graphic: { elements: [ { type: 'image', style: { image: "../../assets/images/apps/bi/huan2.png", width: 145, height: 145 }, left: '48px', top: 'center' } ]},原创 2021-08-25 14:51:19 · 3143 阅读 · 0 评论 -
markLine文字换行
markLine: { label: { show: true, // 是否展示文字 formatter: function (params) { return '月平均\n' + params.value } }, data: [ { type: 'average', name: '月平均' } ]}原创 2021-08-04 11:28:03 · 270 阅读 · 0 评论 -
y轴不要出现小数点
yAxis: { max: this.yMax, interval: this.yMax / 4, axisLabel: { // 关键行 formatter: function (value, index) { return value.toFixed(0) } }, type: 'value', axisLine: { // 设置坐标轴和坐标轴字体颜色原创 2021-07-30 16:18:38 · 1162 阅读 · 0 评论 -
echarts导出为pdf
思路1)html2canvas 截图 //两个参数:所需要截图的元素id,截图后要执行的函数, canvas为截图后返回的最后一个canvas html2canvas(document.getElementById('id')) // 根据id截图 .then(function(canvas) { document.body.appendChild(canvas); // 截图成功后做什么 });2)jspdf 生成导出pdfnpm install jspdf --saveim原创 2021-07-27 17:35:01 · 2996 阅读 · 0 评论 -
坐标轴数据不显示
xAxis: { type: 'category', data: ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24'], axisLine: { // 设置坐标轴和坐标轴字体颜色 lineStyle: { color: '#226原创 2021-06-18 10:15:23 · 1511 阅读 · 0 评论 -
markLine警戒线
series: [ { type: 'line', data: [120, 200, 150, 80, 70, 110, 130], areaStyle: { opacity: 0.5 }, symbol: 'circle', itemStyle: { normal: { lineStyle: { width: 1 } } }, markLine: { symbol: "n原创 2021-06-18 09:34:15 · 240 阅读 · 0 评论 -
y轴24小时均分
方法描述max最大值interval间隔 yAxis: { type: 'value', name: '小时', max: 24, interval: 24 / 4, axisLabel: { textStyle: { color: '#5c96d5' }, }, nameTextStyle: { color: '#5c96d5' }, axisLi...原创 2021-05-24 11:02:50 · 171 阅读 · 0 评论 -
vue-echarts resize 自适应宽度
<template> <chart style="width: 100%; height: 350px" ref="chart1" :options="orgOptions" :auto-resize="true"></chart></template>methods: { resizeTheChart () { if (this.$refs && this.$refs原创 2021-04-22 10:15:09 · 3017 阅读 · 0 评论 -
调柱状图
<template> <chart style="width:100%; height:100px;" :options="orgOptions" :auto-resize="true"></chart></template><script>import echarts from 'echarts'export default { name: 'barChartGDYJ', data (.原创 2020-12-16 07:54:03 · 129 阅读 · 0 评论 -
vue-echarts 动态数据重绘
需求:vue-echarts放子组件里父组件传值调用它当父组件的数据变更了子组件里的echart重绘思路:子组件watch监听 props数据的变更当监听到变更重新定义 options的值父组件正常传值即可子组件<template> <chart style="width:160px; height:190px;" ref="yibiaopan" :options="orgOptions" :auto-res原创 2020-12-04 13:50:46 · 2810 阅读 · 0 评论 -
调整仪表盘
<template> <chart style="width:100%; height:250px;" ref="chart1" :options="orgOptions" :auto-resize="true"></chart></template><script>import echarts from 'echarts'export default { name: 'b.原创 2020-12-04 10:34:00 · 231 阅读 · 0 评论 -
Echart常用属性
1)splitLine(网格线)2)axisLine(坐标轴)3)legend(数据分类)原创 2020-11-18 15:46:15 · 1285 阅读 · 0 评论 -
踩坑-echarts的宽度100%变为100px
好像是因为如果一开始容器是隐藏的那写的100%就会自动变为100px解决方法:直接写window.innerWidth<chart ref="chart1" :style="[{width:chartWidth},{height:'320px'}]" :options="orgOptions" :auto-resize="true" @click='onClick'></chart>原创 2020-06-28 15:41:29 · 716 阅读 · 0 评论 -
vue-echarts在ie不兼容
解决:步骤1:cnpm 改为 npm, npm i echarts vue-echarts -S步骤2:npm i resize-detector -S步骤3:vue.config.js文件写入module.exports = { transpileDependencies: [ 'vue-echarts', 'resize-detector', ...转载 2020-01-15 17:25:14 · 1842 阅读 · 0 评论 -
vue-echarts点击事件
<chart style="width:100%; height:320px;" ref="chart1" :options="orgOptions" :auto-resize="true" @click='onClick'></chart>methods: { onClic...原创 2019-12-09 15:27:13 · 4901 阅读 · 0 评论