PHP Classes

File: vendors/echarts/src/visual/seriesColor.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/echarts/src/visual/seriesColor.js   Download  
File: vendors/echarts/src/visual/seriesColor.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Gentelella BladeOne
Render templates using Bootstrap for presentation
Author: By
Last change:
Date: 3 years ago
Size: 1,546 bytes
 

Contents

Class file image Download
define(function (require) { var Gradient = require('zrender/graphic/Gradient'); return function (seriesType, styleType, ecModel) { function encodeColor(seriesModel) { var colorAccessPath = [styleType, 'normal', 'color']; var colorList = ecModel.get('color'); var data = seriesModel.getData(); var color = seriesModel.get(colorAccessPath) // Set in itemStyle || colorList[seriesModel.seriesIndex % colorList.length]; // Default color // FIXME Set color function or use the platte color data.setVisual('color', color); // Only visible series has each data be visual encoded if (!ecModel.isSeriesFiltered(seriesModel)) { if (typeof color === 'function' && !(color instanceof Gradient)) { data.each(function (idx) { data.setItemVisual( idx, 'color', color(seriesModel.getDataParams(idx)) ); }); } data.each(function (idx) { var itemModel = data.getItemModel(idx); var color = itemModel.get(colorAccessPath, true); if (color != null) { data.setItemVisual(idx, 'color', color); } }); } } seriesType ? ecModel.eachSeriesByType(seriesType, encodeColor) : ecModel.eachSeries(encodeColor); }; });