Echarts
阳光的男夹克
心软的人没遇到 小火慢炖的粥掺了水
展开
-
echarts 显示不清晰问题
echarts文字显示不清晰问题原创 2022-06-11 17:20:23 · 1228 阅读 · 5 评论 -
Echarts name 位置调整
yAxis: { type: 'value', name:'数量', nameTextStyle:{ fontSize: 12, color:'#999999', // name 位置 padding: [0, 0, 0, 0] },},原创 2022-02-15 11:45:04 · 1702 阅读 · 0 评论 -
Echarts 每个柱子设置不同的
<div ref="rightChart" style="width: 100%;height:260px;"></div>rightOptionBar() { // 通过id获取获取画布 const myChart = echarts.init(this.$refs.rightChart,null,{devicePixelRatio: 2}); // 指定图表的配置项和数据 let option = { grid.原创 2021-12-06 15:43:41 · 1209 阅读 · 0 评论 -
Echarts 根据窗口自适应宽高
只需添加以下代码即可myChart.setOption(option);window.addEventListener("resize", function () { myChart.resize();});原创 2021-11-26 14:13:51 · 438 阅读 · 0 评论 -
Echarts 双Y轴刻度线不对齐
刻度线在显示时,双Y轴的分隔段落不一致,导致不对齐问题,那么我们就要两个Y轴的分隔段是一样的option.yAxis[0].max=Math.ceil(Math.max.apply(null,option.series[0].data)/5)*5;option.yAxis[0].interval=Math.ceil(Math.max.apply(null,option.series[0].data)/5);option.yAxis[1].max=Math.ceil(Math.max.apply(nul原创 2021-11-26 14:12:49 · 1650 阅读 · 0 评论 -
Echarts 图例后面增加内容
效果如图只需添加以下代码即可,与 series 平级formatter: function(name) { let data = option.series[0].data; let total = 0; let tarValue; for (let i = 0; i < data.length; i++) { total += data[i].value; if (data[i].name === name) { tarValue = data[i]原创 2021-11-18 13:58:54 · 1084 阅读 · 1 评论 -
Echates timeline实现每一个柱子都有图例
<div style="width:100%;height:300px" id="experChart2"></div>具体方法如下getLoadEchart(id){ let bar_data = [2,3]; let bar_data2 = [23,45]; let myChart = this.$echarts.init(document.getElementById(id)); // prettier-ignore let option = {原创 2021-11-15 09:56:35 · 1226 阅读 · 0 评论 -
Echarts 实现环形进度图
实现效果<div id="mainBottomLeft" style="flex: 2;height:250px;"></div>optionBottomLeft() { // 通过id获取获取画布 const myChart = echarts.init(document.getElementById('mainBottomLeft')); // 指定图表的配置项和数据 let data = 80; let option = { title: {原创 2021-11-04 16:50:25 · 3510 阅读 · 0 评论 -
Echarts 的饼图位置调整
series: [ { name: 'Access From', type: 'pie', // 饼图内圈和外圈大小 radius: ['50%', '65%'], // 饼图位置参数 center: ["30%", "60%"], }]原创 2021-11-04 16:46:34 · 11148 阅读 · 1 评论 -
Echarts 修改图例的位置
legend: { orient: 'vertical', // 'horizontal' data:['测试1','','测试2'], textStyle: { // 图列内容样式 // color: '#fff', // 字体颜色 }, // 位置信息 top:20, right:20 },原创 2021-11-04 16:43:47 · 1116 阅读 · 0 评论 -
Echarts 给Y轴添加单位
yAxis : [ { type : 'value', axisLabel: { show:true, //Y轴数值可添加百分号 formatter: '{value}%', }, }],原创 2021-11-04 16:42:04 · 2452 阅读 · 0 评论 -
Echarts 每个柱子设置不同的图例
效果如下,每个柱子设置了不同的图例 <div id="mainTopLeft" style="width: 100%;height:300px;"></div>optionTopLeft() { let bar_data = [12,23]; //模拟数据 // 通过id获取获取画布 const myChart = echarts.init(document.getElementById('mainTopLeft')); //原创 2021-11-04 16:38:52 · 2811 阅读 · 0 评论 -
Echarts 取消柱状图坐标轴线、设置不同颜色、
取消柱状图坐标轴线 splitLinexAxis: { type: 'value', boundaryGap: [0, 0.01], // 取消坐标线 splitLine: { show: false }, axisLabel: { show: true, textStyle: { // color: '#c3dbff', //更改坐标轴文字颜色 // fontSize : 12 //更改坐标轴文字大小 }原创 2021-08-16 09:18:25 · 1903 阅读 · 0 评论 -
Vue 中使用ECharts
下载Echartsnpm install echarts组件中引入// 局部引入import echarts from 'echarts'// 全局引入 全局引入不能直接写echarts 要写为 this.$echartsimport echarts from 'echarts'Vue.prototype.$echarts = echarts在绘图前我们需要为 ECharts 准备一个具备高宽的 DOM 容器。<template> <!-- 为 EChart原创 2020-09-13 15:48:45 · 222 阅读 · 0 评论 -
Echarts 坐标轴 name 显示不全
Echarts X轴 Y轴 name 显示不全 如图所示解决办法 添加 grid 控制画布内的图形显示位置// 添加 grid 控制画布内的图形显示位置 grid: { left: '15', right: '40', bottom: '30', containLabel: true },原创 2020-10-10 10:59:39 · 1859 阅读 · 0 评论 -
使用Echarts报错 Error in created hook: “TypeError: Cannot read property ‘getAttribute‘ of null“
出现该错误的原因是Echarts的图形容器还未生成就对其进行了初始化所造成的解决办法 只需要延迟初始化就可以,也就是你的 option 使用 this.$nextTick(function () { }) 延迟执行optionPie() { this.$nextTick(function () { // 通过id获取获取画布 const myChart = echarts.init(document.getElementById('pie')); //图表数据 l原创 2020-09-27 15:46:46 · 1864 阅读 · 0 评论