slides/asset/common/dark.js (148 lines of code) (raw):
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['exports', 'echarts'], factory);
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
// CommonJS
factory(exports, require('echarts'));
} else {
// Browser globals
factory({}, root.echarts);
}
}(this, function (exports, echarts) {
var log = function (msg) {
if (typeof console !== 'undefined') {
console && console.error && console.error(msg);
}
};
if (!echarts) {
log('ECharts is not Loaded');
return;
}
var contrastColor = '#eee';
var axisCommon = function (isCategory) {
return {
axisLine: {
lineStyle: {
color: contrastColor
}
},
axisTick: {
lineStyle: {
color: contrastColor
}
},
axisLabel: {
textStyle: {
color: contrastColor
}
},
splitLine: {
show: isCategory ? false : true,
lineStyle: {
opacity: 0.5,
color: contrastColor
}
},
splitArea: {
show: isCategory ? true : false,
areaStyle: {
color: ['rgba(0, 0, 0, 0.1', 'transparent']
}
}
};
};
var colorPalette = ['#5793f3', '#d14a61', '#fd9c35', '#675bba', '#fec42c', '#dd4444', '#d4df5a', '#cd4870'];
var theme = {
color: colorPalette,
tooltip: {
axisPointer: {
lineStyle: {
color: contrastColor
},
crossStyle: {
color: contrastColor
}
}
},
legend: {
textStyle: {
color: contrastColor
}
},
textStyle: {
color: contrastColor
},
title: {
textStyle: {
color: contrastColor
}
},
dataZoom: {
textStyle: {
color: '#CDFF5D'
}
},
visualMap: {
textStyle: {
color: contrastColor
}
},
toolbox: {
iconStyle: {
normal: {
borderColor: contrastColor
}
}
},
timeline: {
lineStyle: {
color: contrastColor
},
itemStyle: {
normal: {
color: colorPalette[1]
}
},
label: {
normal: {
textStyle: {
color: contrastColor
}
}
},
controlStyle: {
normal: {
color: contrastColor,
borderColor: contrastColor
}
}
},
timeAxis: axisCommon(true),
logAxis: axisCommon(),
valueAxis: axisCommon(),
categoryAxis: axisCommon(true),
line: {
symbol: 'circle'
},
graph: {
color: colorPalette
},
gauge: {
title: {
textStyle: {
color: contrastColor
}
}
},
candlestick: {
itemStyle: {
normal: {
color: '#FD1050',
color0: '#0CF49B',
borderColor: '#FD1050',
borderColor0: '#0CF49B'
}
}
}
};
theme.categoryAxis.splitLine.show = false;
echarts.registerTheme('dark', theme);
}));