Highcharts conflict with extjs -


i trying render 3 highcharts inside extjs tab using prototype adapter. rendering multiple bar charts in single page having click event on bars. charts render below first bar charts not click event have registered them. first chart on page has click event. charts below not click-able though have added click events them. when render same page outside extjs component charts , clicks work fine. guessing there conflict highcharts , extjs.

was able replicate issue in jsfilddle http://jsfiddle.net/knpeg/4/

the following javascript code creating extjs component in same highchart rendered 3 times bottom charts have bars not clickable.

            var centertabpanel = new ext.tabpanel({                        region:'center',                        margins: '0 10 0 0',                        id:'center-panel',                                   activetab:0,                        bodystyle:'padding: 8 5 5 8;',                        autoscroll: true,                items:[  {                                         contentel: 'db_snapshots',                                         title: "charts",                                         autoscroll: true,                                         bodystyle: 'background:#fffff0;padding: 8 5 5 8;'                                     }                         ]                     });                         var viewport = new ext.viewport({                         layout:'border',                                     loadmask : {msg:"testloading..."},                                     monitorresize : true,                         items:[                               centertabpanel                                     ]                     });                             viewport.dolayout();               var chart = new highcharts.chart({                     chart: {                         renderto: "container",                         defaultseriestype: 'column',                         plotbackgroundcolor: null,                         plotborderwidth: null,                         plotshadow: false                      },                         title: {                             text: null                         },                         xaxis: {                             categories: ['first','second','third']                         },                          series: [{                             name:"values",                             data: [133, 156, 947]                         }],                         plotoptions: {                             series: {                                 animation: false,                                 cursor: 'text',                                 point: {                                     events: {                                         click: function() {                                             alert("hello");                                         }                                     }                                 },                                 marker: {                                     linewidth: 1                                 }                             },                             line: {                                 size:'100%',                                 allowpointselect: true,                                 cursor: 'pointer',                                 datalabels: {                                     enabled: false                                 }                             },                             bar: {                                 size:'100%',                                 allowpointselect: true,                                 cursor: 'string',                                 datalabels: {                                     enabled: false                                 }                             }                         }                  });                     var chart2 = new highcharts.chart({                     chart: {                         renderto: "container2",                         defaultseriestype: 'column',                         plotbackgroundcolor: null,                         plotborderwidth: null,                         plotshadow: false                      },                         title: {                             text: null                         },                         xaxis: {                             categories: ['first','second','third']                         },                          series: [{                             name:"values",                             data: [133, 156, 947]                         }],                         plotoptions: {                             series: {                                 animation: false,                                 cursor: 'text',                                 point: {                                     events: {                                         click: function() {                                             alert("hello");                                         }                                     }                                 },                                 marker: {                                     linewidth: 1                                 }                             },                             line: {                                 size:'100%',                                 allowpointselect: true,                                 cursor: 'pointer',                                 datalabels: {                                     enabled: false                                 }                             },                             bar: {                                 size:'100%',                                 allowpointselect: true,                                 cursor: 'string',                                 datalabels: {                                     enabled: false                                 }                             }                         }                  });                  var chart3 = new highcharts.chart({                     chart: {                         renderto: "container3",                         defaultseriestype: 'column',                         plotbackgroundcolor: null,                         plotborderwidth: null,                         plotshadow: false                      },                         title: {                             text: null                         },                         xaxis: {                             categories: ['first','second','third']                         },                          series: [{                             name:"values",                             data: [133, 156, 947]                         }],                         plotoptions: {                             series: {                                 animation: false,                                 cursor: 'text',                                 point: {                                     events: {                                         click: function() {                                             alert("hello");                                         }                                     }                                 },                                 marker: {                                     linewidth: 1                                 }                             },                             line: {                                 size:'100%',                                 allowpointselect: true,                                 cursor: 'pointer',                                 datalabels: {                                     enabled: false                                 }                             },                             bar: {                                 size:'100%',                                 allowpointselect: true,                                 cursor: 'string',                                 datalabels: {                                     enabled: false                                 }                             }                         }                  }); 

instead of setting point click, can use workaround, , iterate on each series element (in each chart) , add action svg element "on" trigger.

http://jsfiddle.net/knpeg/5/

 (var = 0; < chart3.series[0].data.length; i++) {             chart3.series[0].data[i].graphic.on('click', function () {                 alert('aaa3');             });         } 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -