File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ function sqlpage_chart() {
3535 for ( const c of document . querySelectorAll ( "[data-pre-init=chart]" ) ) {
3636 try {
3737 const data = JSON . parse ( c . querySelector ( "data" ) . innerText ) ;
38+ const chartContainer = c . querySelector ( '.chart' ) ;
39+ chartContainer . innerHTML = "" ;
3840 const is_timeseries = ! ! data . time ;
3941 /** @type { Series } */
4042 const series_map = { } ;
@@ -71,7 +73,7 @@ function sqlpage_chart() {
7173 type : data . type || 'line' ,
7274 fontFamily : 'inherit' ,
7375 parentHeightOffset : 0 ,
74- height : c . style . height ,
76+ height : chartContainer . style . height ,
7577 stacked : ! ! data . stacked ,
7678 toolbar : {
7779 show : ! ! data . toolbar ,
@@ -143,8 +145,7 @@ function sqlpage_chart() {
143145 series,
144146 } ;
145147 if ( labels ) options . labels = labels ;
146- c . innerHTML = "" ;
147- const chart = new ApexCharts ( c , options ) ;
148+ const chart = new ApexCharts ( chartContainer , options ) ;
148149 chart . render ( ) ;
149150 if ( window . charts ) window . charts . push ( chart ) ;
150151 else window . charts = [ chart ] ;
You can’t perform that action at this time.
0 commit comments