Would be just “nice to have”. But this of course is not a problem at all.
What I see is: when using two charts via shortcode there is no additional http request for loading the (locally stored) chart.js script - but the CPU time is much higher.
Beside that the chart via shortcode is not responsive out of the box in comparison to the basic implementation.
Can I avoid multiple script loadings for multiple charts when loading the chart.js script once via content file? As far I have tested this should work.
If it worked like this I wouldn’t see advantages of the shortcode implementation by shen-yu in 2023 no more.
Thank you very much!
I’ll keep on going with the regular method I think.
But good to have that documented for others who are searching for these keywords.
I checked the pagespeed today.
I inserted 6 radar charts into one post to illustrate 4 different properties.
The local file delivery of chart.js adds 63kb of zipped data transfer.
The calculation of all charts adds in sum up additional 200 ms of CPU time.
For me it’s fine for that amount of charts enriching the other content.
Loading time for the whole document now takes ~1.0s for first view. I’m fine with that