您好,欢迎来到好走旅游网。
搜索
您的当前位置:首页Echart改变X轴、Y轴、折线的颜色和数值

Echart改变X轴、Y轴、折线的颜色和数值

来源:好走旅游网
Echart改变X轴、Y轴、折线的颜⾊和数值

在操作E-chart时需要根据需求改变颜⾊和属性图1:

option = {xAxis: {

type: 'category',

data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']},

yAxis: {type: 'value'},

series: [{

data: [820, 932, 901, 934, 1290, 1330, 1320],type: 'line',smooth: true}]};

图2:

解决⽅案:

option = {

//标题 title: {

text: title, //标题样式 textStyle: {

fontWeight: 'normal', color: '#fff', },

//top: 20, },

xAxis: {

type: 'category', //x轴字体颜⾊ axisLine: { lineStyle: { color: '#fff' } },

data: ['0822','0823','0824','0826','0827','0828'] },

yAxis: {

type: 'value', //y轴颜⾊

axisLine: { lineStyle: { color: '#fff' } },

//y轴设置为百分⽐ axisLabel: {

formatter: '{value}%', },

//坐标轴内线的样式 splitLine: { lineStyle: { color: '#666',

//type:'dashed'虚线 } } },

series: [{

//折线上数字 label: {

normal: {

show: true, position: 'top', formatter:'{c}%' } },

// 折线颜⾊ itemStyle: { normal: {

color: '#33CCFF', lineStyle: {

color: '#33CCFF' } } },

data:['78.57','50','80','93.33','92.86','100'], type: 'line', smooth: true }] }; ;

if (option && typeof option === \"object\") { myChart.setOption(option, true); } }

E-chart 点击事件

myChart.on('click', function (params) {});

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- haog.cn 版权所有

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务