網站首頁 編程語言 正文
前言
示例來自 Echarts 官網:https://echarts.apache.org/examples/zh/editor.html?c=line-stack
如下圖所示,這是默認圖例的顏色,我們接下來進行更改。
實現代碼
主要是 color
調色盤的配置,具體可看文檔。
option = {
title: {
text: ''
},
tooltip: {
trigger: 'axis'
},
// 更改圖例默認顏色(依次應用)
color:['red', 'black', 'yellow', 'pink', 'cyan'],
// end
legend: {
data: ['郵件營銷', '聯盟廣告', '視頻廣告', '直接訪問', '搜索引擎']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
},
yAxis: {
type: 'value'
},
series: [
{
name: '郵件營銷',
type: 'line',
stack: '總量',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '聯盟廣告',
type: 'line',
stack: '總量',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: '視頻廣告',
type: 'line',
stack: '總量',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: '直接訪問',
type: 'line',
stack: '總量',
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: '搜索引擎',
type: 'line',
stack: '總量',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
};
效果
完成。
原文鏈接:https://wangjiabin.blog.csdn.net/article/details/116118213
相關推薦
- 2022-06-17 C語言詳細講解多維數組與多維指針_C 語言
- 2023-06-20 React?DOM-diff?節點源碼解析_React
- 2023-06-17 Hugo?Config模塊構建實現源碼剖析_Golang
- 2022-08-17 React自定義hook的方法_React
- 2023-07-07 sklearn.model_selection模塊介紹
- 2022-12-06 React.memo?和?useMemo?的使用問題小結_React
- 2022-12-06 C#實現跑馬燈效果的示例代碼_C#教程
- 2021-12-10 linux系統文件共享samba配置教程_Linux
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支