brushAction.js 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. var echarts = require("../../echarts");
  2. /**
  3. * payload: {
  4. * brushIndex: number, or,
  5. * brushId: string, or,
  6. * brushName: string,
  7. * globalRanges: Array
  8. * }
  9. */
  10. echarts.registerAction({
  11. type: 'brush',
  12. event: 'brush',
  13. update: 'updateView'
  14. }, function (payload, ecModel) {
  15. ecModel.eachComponent({
  16. mainType: 'brush',
  17. query: payload
  18. }, function (brushModel) {
  19. brushModel.setAreas(payload.areas);
  20. });
  21. });
  22. /**
  23. * payload: {
  24. * brushComponents: [
  25. * {
  26. * brushId,
  27. * brushIndex,
  28. * brushName,
  29. * series: [
  30. * {
  31. * seriesId,
  32. * seriesIndex,
  33. * seriesName,
  34. * rawIndices: [21, 34, ...]
  35. * },
  36. * ...
  37. * ]
  38. * },
  39. * ...
  40. * ]
  41. * }
  42. */
  43. echarts.registerAction({
  44. type: 'brushSelect',
  45. event: 'brushSelected',
  46. update: 'none'
  47. }, function () {});