Skip to content

Instantly share code, notes, and snippets.

@brihter
Created September 7, 2019 18:27
Show Gist options
  • Save brihter/3ea0f5d7eebbfce114a68aa47684f849 to your computer and use it in GitHub Desktop.
Save brihter/3ea0f5d7eebbfce114a68aa47684f849 to your computer and use it in GitHub Desktop.
ExtJS 6 Highcharts adapter
// usage:
// {
// xtype: 'ux_highchart',
// highchartCfg: {
// // ...
// }
// }
Ext.define('Ext.ux.Highchart', {
extend: 'Ext.Container',
xtype: 'ux_highchart',
_chart: null,
listeners: {
boxready: function () {
const target = `${this.id}-innerCt`
const cfg = this.initialConfig.highchartCfg
this._chart = Highcharts.chart(target, cfg)
},
resize: function () {
this._chart.reflow()
},
beforedestroy: function () {
this._chart.destroy()
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment