1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- // ECharts for Mini Program
- module.exports = {
- init: function(canvas, width, height, dpr) {
- const chart = {
- setOption: function(option) {
- // Basic implementation
- this._option = option;
- },
- getZr: function() {
- return {
- handler: {
- dispatch: function() {},
- processGesture: function() {}
- }
- };
- },
- clear: function() {},
- dispose: function() {}
- };
-
- // Add necessary methods
- chart.setCanvasCreator = function() {};
- chart.getDom = function() { return canvas; };
- chart.getWidth = function() { return width; };
- chart.getHeight = function() { return height; };
- chart.getDevicePixelRatio = function() { return dpr; };
-
- // Add graphic namespace
- chart.graphic = {
- LinearGradient: function(x, y, x2, y2, colorStops) {
- return {
- type: 'linear',
- x: x,
- y: y,
- x2: x2,
- y2: y2,
- colorStops: colorStops
- };
- }
- };
-
- return chart;
- }
- };
|