I’m trying to use the highchart library on weweb because the chartJS plugin is not adequate for my use case.
So I added the highcharts installation script in the : <script src="https://code.highcharts.com/highcharts.js"></script>
Then I added an HTML embed element, in which I put the simple code to create the first chart, according to the highchart tutorial:
But when I’m in preview mode, the chart doesn’t show up.
Did some of you manage to integrate this library or another one? Do you see a mistake in what I did?
Damn, I’m not familiar enough with Javascript. I might try to do it, but it will take me far too long.
I was chatting in the chat room several weeks ago, and was told that after a recent weweb release, the code in the head of a page would be supported in preview mode.
What did I misunderstand?
Custom scripts and css added at page or project level do not render in preview mode but only in the live app.
A custom script in an html element will be executed.
Dynamic values you put inside the html element may expose you to XSS attacks because it updates the element innerHTML directly. See this example.
Also the code inside script tags in the html element is executed using eval.
Custom elements avoid this kind of problem, that’s because it’s the best practice.
Be mindful of the security concerns and choose what you want to use.
Ok, i try to di this.
I followed the instructions to create a component. The local installation didn’t work so I went to stackblitz.com and created a Vite.js project. The installation is going well. The project is on Git and I try to import the component on weweb. But the build is failing:
We confirmed that one of our customer successfully create an internal component using the highchart Vuejs library.
Let’s use this thread to help you through the dev process