Skip to content

importing js library for charts #410

Answered by MWedl
unfrs asked this question in Q&A
Feb 12, 2025 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

SysReptor officially only supports chart.js, but it is possible to import and use other libraries. However, the solution is quite hacky. Here is an example for d3.js but you might be able to use highcharts as well.

The general appraoch is to upload the JS library as asset in the design and then dynamically import it via JavaScript. Then you need to render the chart to SVG or PNG/JPG and include the it as an inline image to HTML.

<component :is="{
    render() {},
    async mounted() {
        const script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = '/assets/name/d3.v7.min.js';
        await new window.Promise(resolve => {
            s…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@aronmolnar
Comment options

@unfrs
Comment options

Answer selected by unfrs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants