
echarts相关
墨语轩
这个作者很懒,什么都没留下…
展开
-
echarts 线性渐变方向
渐变使用方式:1、new echarts.graphic.LinearGradient2、type: linear拿官网的例子举例:Examples - Apache ECharts这个图中渐变核心部分: series: [ { type: 'bar', showBackground: true, itemStyle: { color: new echarts.graphic.LinearGradient(0, 0.原创 2022-05-10 19:11:11 · 5743 阅读 · 1 评论 -
echart 柱状图指定柱子颜色
配置项:const colors = [ { start: '#00bfbf', end: '#95f205' }, { start: '#00bfbf', end: '#02a7f0' }, { start: '#00bfbf', end: '#95f205' }, { start: '#00bfbf', end: '#02a7f0' }, { start: '#00bfbf', ..原创 2022-02-26 00:30:16 · 2280 阅读 · 0 评论 -
echarts 半圆形进度条
图例:配置项:// 进度百分比var value = 20option = { // backgroundColor: '#36467E', title: [{ text: '半圆进度条', left: 'center', top: '70%', textStyle: { color: '#2892E8', fontSize: 14 }...原创 2022-02-26 00:32:55 · 6876 阅读 · 0 评论 -
echartr 饼图 hover 时各个 item 的数据在中间显式
如图:option = { series: [ { name: 'aaa', type: 'pie', radius: ['20%', '40%'], label: { show: false, position: 'center', formatter: '{value|{c}} \n {name|{b}} \n {percent|{d}}%', rich: {原创 2022-02-22 22:01:16 · 762 阅读 · 0 评论 -
echarts自适应问题,echarts中怎么改变字体单位实现自适应
最初想着怎么给echarts设置vw单位或者rem,echart中怎么把legend的单位设置为vw或者rem来使表格自适应,后面发现行不通。项目中使用px-to-vw包,将所有px转为对应的vw,所有可以根据相同比例进行缩放,做到自适应效果。但是使用了echarts图表,图表中的fontSize和legend的大小等默认都是px单位。当屏宽为4K屏时,其他地方元素字体等都能适应,但是echa...原创 2019-10-14 08:45:43 · 11964 阅读 · 8 评论 -
echarts dataZoom 基本用法,给 yAxis 增加滚动条
现有一个 echarts 图表,需要在 y 轴方向上设置一个滚动条,可以滚动数据,x 轴显现的数据固定不动不能跟随滚动条滚动,所以不能直接使用外层盒子的 overflow: auto。可以使用 echarts 的 dataZoom 组件来实现 dataZoom: [ { type: 'slider', show: true, // 设置组件控制的y轴 yAxisIndex: 0, right: 40, top:原创 2022-01-18 00:15:42 · 4806 阅读 · 1 评论 -
timeLine 的使用
timeLine 的type 可以是value,time,category,当我们使用 time 时,data 里面的时刻数据会按照时间先后顺序自动从小到大排序到时间轴上,比如,你的数据是:['2021-08-13 08:00:00','2021-08-13 09:00:00','2021-08-13 10:00:00','2021-08-13 11:00:00','2021-08-13 12:00:00','2021-08-13 06:00:00']那么时间轴上会将最后一个数据原创 2021-11-30 23:05:13 · 953 阅读 · 0 评论 -
雷达图基础配置
以备后面拿了配置项用作提示:配置项:option = { title: { text: '基础雷达图' }, legend: { data: ['预算分配', '实际开销'] }, radar: { // shape: 'circle', indicator: [ { name: '销售', max: 6500}, { name: '管理',.原创 2021-09-01 22:43:33 · 520 阅读 · 0 评论 -
饼图修改引导线,相邻数据留白,给每个item项设置相应的边框颜色
配置项:const pieChartData = [ { legendname: 'aaa', value: 53, percent: '15.4%', itemStyle: { color: '#e7e702' }, name: 'aaa | 15.4%' }, { legendname: 'bbb', value: 67, percent: '22.4%', itemStyle: { .原创 2021-08-26 23:27:46 · 1367 阅读 · 0 评论 -
柱状图配置项例子
这个柱状图官方示例里面一大堆,主要拿出来看一下各个组件的配置配置项:option = { title: { text: 'test', textStyle: { fontSize: 12, color: '#666' }, // title 的位置 left: 25, top: 20 }, xAxis: { type: 'category', data: ['1月', '2月', '3月',原创 2021-08-16 23:55:36 · 210 阅读 · 0 评论 -
堆叠柱状图 自定义绘图
配置:option = { xAxis: { type: 'value', show: false }, yAxis: { type: 'category', show: false }, grid: { left: 0, right: 0, top: 0, bottom: 0 }, series: [ { name: 'aaa', type: 'bar', da..原创 2021-08-18 23:51:59 · 450 阅读 · 0 评论 -
无坐标轴图表
例子1:折线图配置项:option = { xAxis: { type: 'category', // 隐藏x轴 show: false, // 坐标轴两边留白策略 boundaryGap: false }, yAxis: { // 隐藏y轴 show: false }, // 控制图表底板的位置 grid: { left: 0, right: 0, top: 0, bottom: 0原创 2021-08-14 17:51:32 · 285 阅读 · 0 评论 -
echarts 饼图鼠标移上去不放大突出
鼠标移上去的 item 不会凸出了 hoverAnimation: false,emphasis 里面的 itemStyle 可以设置移上去的 item 样式option = { title: { text: '某站点用户访问来源', subtext: '纯属虚构', left: 'center' }, tooltip: { trigger: 'item' }, legend: { ..原创 2021-08-10 23:14:37 · 7533 阅读 · 1 评论