@@ -4,6 +4,7 @@ import { AJAX } from './modules/ajax.ts';
44import { checkFormElementInRange , checkSqlQuery , prepareForAjaxRequest } from './modules/functions.ts' ;
55import { Navigation } from './modules/navigation.ts' ;
66import { CommonParams } from './modules/common.ts' ;
7+ import createProfilingChart from './modules/functions/createProfilingChart.ts' ;
78import highlightSql from './modules/sql-highlight.ts' ;
89import { ajaxRemoveMessage , ajaxShowMessage } from './modules/ajax-message.ts' ;
910import { escapeBacktick , escapeHtml } from './modules/functions/escape.ts' ;
@@ -1369,27 +1370,7 @@ function buildProfilingChart () {
13691370 return ;
13701371 }
13711372
1372- const lang = CommonParams . get ( 'lang' ) ;
1373- const numberFormat = new Intl . NumberFormat ( lang . replace ( '_' , '-' ) , {
1374- style : 'unit' ,
1375- unit : 'second' ,
1376- unitDisplay : 'long' ,
1377- notation : 'engineering' ,
1378- } ) ;
1379-
1380- new window . Chart ( profilingChartCanvas , {
1381- type : 'pie' ,
1382- data : {
1383- labels : chartData . labels ,
1384- datasets : [ { data : chartData . data } ] ,
1385- } ,
1386- options : {
1387- plugins : {
1388- legend : { position : 'bottom' } ,
1389- tooltip : { callbacks : { label : context => context . parsed ? numberFormat . format ( context . parsed ) : '' } } ,
1390- } ,
1391- } ,
1392- } ) ;
1373+ createProfilingChart ( 'profilingChartCanvas' , chartData , 'bottom' ) ;
13931374}
13941375
13951376/**
0 commit comments