echarts note
文章目录
加载主题
内置主题
内置主题 macarons 和 infographic 直接传入名称即可
如:myCharts = echarts.init(document.getElementById('main'), 'macarons')
扩展主题
(coffee语法)
载入单个主题
require [
'echarts'
'echarts/theme/gray'
'echarts/chart/line'
], (ec, theme) ->
# 课程访问量
myChart1 = ec.init document.getElementById('chart_id_1'), theme
......
return
载入多个主题
# 载入gray主题
require [
'echarts/theme/gray'
], (theme) ->
window.gray = theme
return
# 载入helianthus主题
require [
'echarts/theme/helianthus'
], (theme) ->
window.helianthus = theme
return
require [
'echarts'
'echarts/chart/line'
], (ec, theme) ->
# 使用主题
myChart1 = ec.init document.getElementById('chart_id_1'), gray
myChart2 = ec.init document.getElementById('chart_id_2'), helianthus
......
return