PHP Classes

File: vendors/gentelella/vendors/echarts/src/chart/lines/LinesView.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/gentelella/vendors/echarts/src/chart/lines/LinesView.js   Download  
File: vendors/gentelella/vendors/echarts/src/chart/lines/LinesView.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: 2,085 bytes
 

Contents

Class file image Download
define(function (require) { var LineDraw = require('../helper/LineDraw'); var EffectLine = require('../helper/EffectLine'); var Line = require('../helper/Line'); require('../../echarts').extendChartView({ type: 'lines', init: function () {}, render: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var lineDraw = this._lineDraw; var hasEffect = seriesModel.get('effect.show'); if (hasEffect !== this._hasEffet) { if (lineDraw) { lineDraw.remove(); } lineDraw = this._lineDraw = new LineDraw( hasEffect ? EffectLine : Line ); this._hasEffet = hasEffect; } var zlevel = seriesModel.get('zlevel'); var trailLength = seriesModel.get('effect.trailLength'); var zr = api.getZr(); // Avoid the drag cause ghost shadow // FIXME Better way ? zr.painter.getLayer(zlevel).clear(true); // Config layer with motion blur if (this._lastZlevel != null) { zr.configLayer(this._lastZlevel, { motionBlur: false }); } if (hasEffect && trailLength) { zr.configLayer(zlevel, { motionBlur: true, lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0) }); } this.group.add(lineDraw.group); lineDraw.updateData(data); this._lastZlevel = zlevel; }, updateLayout: function (seriesModel, ecModel, api) { this._lineDraw.updateLayout(); // Not use motion when dragging or zooming var zr = api.getZr(); zr.painter.getLayer(this._lastZlevel).clear(true); }, remove: function (ecModel, api) { this._lineDraw && this._lineDraw.remove(api, true); } }); });