微信小店联盟带货小程序

echarts.js 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // ECharts for Mini Program
  2. module.exports = {
  3. init: function(canvas, width, height, dpr) {
  4. const chart = {
  5. setOption: function(option) {
  6. // Basic implementation
  7. this._option = option;
  8. },
  9. getZr: function() {
  10. return {
  11. handler: {
  12. dispatch: function() {},
  13. processGesture: function() {}
  14. }
  15. };
  16. },
  17. clear: function() {},
  18. dispose: function() {}
  19. };
  20. // Add necessary methods
  21. chart.setCanvasCreator = function() {};
  22. chart.getDom = function() { return canvas; };
  23. chart.getWidth = function() { return width; };
  24. chart.getHeight = function() { return height; };
  25. chart.getDevicePixelRatio = function() { return dpr; };
  26. // Add graphic namespace
  27. chart.graphic = {
  28. LinearGradient: function(x, y, x2, y2, colorStops) {
  29. return {
  30. type: 'linear',
  31. x: x,
  32. y: y,
  33. x2: x2,
  34. y2: y2,
  35. colorStops: colorStops
  36. };
  37. }
  38. };
  39. return chart;
  40. }
  41. };