AbstractChart.js 967 B

1234567891011121314151617181920212223242526272829303132333435
  1. Ext.define('Ext.chart.overrides.AbstractChart', {
  2. override: 'Ext.chart.AbstractChart',
  3. // In Modern toolkit, if chart element style has no z-index specified,
  4. // some chart surfaces with higher z-indexes (e.g. overlay)
  5. // may end up on top of modal dialogs shown over the chart.
  6. zIndex: 0,
  7. updateLegend: function (legend, oldLegend) {
  8. this.callParent([legend, oldLegend]);
  9. if (legend && legend.isDomLegend) {
  10. this.add(legend);
  11. }
  12. },
  13. onItemRemove: function (item, index, destroy) {
  14. var map = this.surfaceMap,
  15. type = item.type,
  16. items = map && map[type];
  17. this.callParent([item, index, destroy]);
  18. if (items) {
  19. Ext.Array.remove(items, item);
  20. if (items.length === 0) {
  21. delete map[type];
  22. }
  23. }
  24. },
  25. doDestroy: function () {
  26. this.destroyChart();
  27. this.callParent();
  28. }
  29. });