chart.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * @description 图表类
  3. * @params {Object} 图表 option
  4. * @params {Number} 横坐标百分比 x
  5. * @params {Number} 纵坐标百分比 y
  6. * @params {Number} 宽度百分比 width
  7. * @params {Number} 高度百分比 height
  8. * @params {Number} 图表类型 type
  9. */
  10. export default class chartClass {
  11. constructor({
  12. type,
  13. option,
  14. x = 0,
  15. y = 0,
  16. width = 300,
  17. height = 300,
  18. Xdata = [],
  19. Ydata = [],
  20. BarXdata = [],
  21. BarYdata = [],
  22. LineXdata = [],
  23. LineYdata = [],
  24. ScatterXdata = [],
  25. ScatterYdata = [],
  26. formFilterAlignData = [], //条件过滤字段
  27. }) {
  28. this.id = Math.random();
  29. this.option = option;
  30. this.x = x;
  31. this.y = y;
  32. this.width = width;
  33. this.height = height;
  34. this.type = type;
  35. this.Xdata = Xdata;
  36. this.Ydata = Ydata;
  37. this.BarXdata = BarXdata;
  38. this.BarYdata = BarYdata;
  39. this.LineXdata = LineXdata;
  40. this.LineYdata = LineYdata;
  41. this.ScatterXdata = ScatterXdata;
  42. this.ScatterYdata = ScatterYdata;
  43. this.formFilterAlignData = formFilterAlignData;
  44. }
  45. }