Topic: Pushed Charts in html content - how to render chart
If I push HTML content with with data-mdb attributes, chart is not rendered. Of course, because it is html content and MDB "don't do that work" for render chart like single page loaded (not pushed content). I know - I can put chart by javascript code.
But my question is: Is possible to call "something" what display chart based on html content (canvas + data-mdb attributes) or I have to do it only by javascript initialization of chart? Somethink what can force MDB process pushed html content to be chart rendered?
kpienkowska staff answered 2 years ago
I don't understand your question. Most charts can be initiated via HTML. More complex needs to be declared with the use of JS.
But if you want to add a chart after HTML content is loaded you have to do it with JS for it to initiate.
meesha81 pro premium priority commented 2 years ago
Hi, yes, if you do ajax call and put some content to the div element, chart is not initialized. And yes - that is your second paragraph - after content loaded and some new html content with chart comes, I have to do it by JS event etc.
kpienkowska staff commented 2 years ago
Sorry, this is the only way.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 5.0.0
- Device: PC
- Browser: Chrome 106
- OS: Win11
- Provided sample code: No
- Provided link: No