# Examples using Apexcharts with uibuilder

**URL:** https://discourse.nodered.org/t/examples-using-apexcharts-with-uibuilder/67827
**Category:** Dashboard
**Tags:** uibuilder
**Created:** [16 September 2022 21:29 UTC](https://discourse.nodered.org/t/examples-using-apexcharts-with-uibuilder/67827 "2022-09-16T21:29:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![OscarF](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@OscarF](https://discourse.nodered.org/u/OscarF)
#### Post date: [16 September 2022 21:29 UTC](https://discourse.nodered.org/t/examples-using-apexcharts-with-uibuilder/67827/1 "2022-09-16T21:29:14Z")

</div>

Hi!

I installed the uibuilder to use apexcharts in node red, but when I try to implement the example on node red, I only get the title, no the chart. The example is [this](https://github.com/TotallyInformation/node-red-contrib-uibuilder/wiki/Integrating-ApexCharts-with-VueJS).

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [17 September 2022 13:00 UTC](https://discourse.nodered.org/t/examples-using-apexcharts-with-uibuilder/67827/2 "2022-09-17T13:00:17Z")

</div>

I have just tested that code with the latest version of node-red and it appears to be working fine. Can you please share your html and js code?

---

<div class="post-metadata">

### Author: ![OscarF](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@OscarF](https://discourse.nodered.org/u/OscarF)
#### Post date: [19 September 2022 15:12 UTC](https://discourse.nodered.org/t/examples-using-apexcharts-with-uibuilder/67827/3 "2022-09-19T15:12:11Z")

</div>

Yes, here is the js code:

```auto
Vue.component('apexchart', VueApexCharts)

// eslint-disable-next-line no-unused-vars
var app1 = new Vue({
    el: '#app',
    data: {
        startMsg : 'Vue has started, waiting for messages',

        // Data for bar chart
        options: {
            chart: {
                id: 'vuechart-example'
            },
            xaxis: {
                categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998]
            }
        },
        series: [{
            name: 'series-1',
            data: [30, 40, 45, 50, 49, 60, 70, 91]
        }],

        // Data for donut chart
        doptions: {},
        dseries: [44, 55, 41, 17, 15]

    }, // --- End of data --- //
    computed: {
    }, // --- End of computed --- //
    methods: {
    }, // --- End of methods --- //

    // Available hooks: init,mounted,updated,destroyed
    mounted: function(){
        / **** REQUIRED** Start uibuilder comms with Node-RED @since v2.0.0-dev3
         * Pass the namespace and ioPath variables if hosting page is not in the instance root folder
         * e.g. If you get continual `uibuilderfe:ioSetup: SOCKET CONNECT ERROR` error messages.
         * e.g. uibuilder.start('/nr/uib', '/nr/uibuilder/vendor/socket.io') // change to use your paths/names
         */
        uibuilder.start()

        var vueApp = this

        // Process new messages from Node-RED
        uibuilder.onChange('msg', function (newVal) {
            if ( typeof newVal.payload === 'number' ){
                // Add new element
                vueApp.dseries.push(newVal.payload)
                // Lose the first element
                vueApp.dseries.shift()
                //console.log(vueApp.dseries)
            }
        })

    } // --- End of mounted hook --- //

}) // --- End of app1 --- //

// EOF

```

and this is the html code:

```auto
<!doctype html><html lang="en"><head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">

    <title>ApexChart/VueJS Example - Node-RED UI Builder</title>
    <meta name="description" content="Node-RED UI Builder - ApexChart/VueJS Example">

    <link rel="icon" href="./images/node-blue.ico">

    <link type="text/css" rel="stylesheet" href="../uibuilder/vendor/bootstrap/dist/css/bootstrap.min.css" />
    <link type="text/css" rel="stylesheet" href="../uibuilder/vendor/bootstrap-vue/dist/bootstrap-vue.css" />

    <link rel="stylesheet" href="./index.css" media="all">
</head><body>
    <div id="app">
        <b-container id="app_container">

            <h1>
                Examples of using <a href="https://apexcharts.com/docs/vue-charts/" target="_blank">ApexChart</a>
                with uibuilder, VueJS and bootstrap-vue
            </h1>

            <b-row>
                <b-card col class="w-50" header="Bar Chart" border-variant="primary" header-bg-variant="primary" header-text-variant="white" align="center">
                        <apexchart width="100%" type="bar" :options="options" :series="series"></apexchart>
                </b-card>

                <b-card col class="w-50" header="Donut Chart" border-variant="primary" header-bg-variant="primary" header-text-variant="white" align="center">
                        <apexchart width="100%" type="donut" :options="doptions" :series="dseries"></apexchart>
                </b-card>
            </b-row>

        </b-container>
    </div>

    <script src="../uibuilder/vendor/socket.io/socket.io.js"></script>
    <script src="../uibuilder/vendor/vue/dist/vue.min.js"></script>
    <script src="../uibuilder/vendor/bootstrap-vue/dist/bootstrap-vue.js"></script>

    <!-- Loading from CDN, use uibuilder to install packages and change to vendor links -->
    <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue-apexcharts"></script>

    <script src="./uibuilderfe.min.js"></script> <!-- //prod version -->
    <script src="./index.js"></script>

</body></html>

```

I only get this on the chart page:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/a/ca9f37e9f19f740142df06d5b14f2f7b3af27511.png)

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [19 September 2022 16:43 UTC](https://discourse.nodered.org/t/examples-using-apexcharts-with-uibuilder/67827/4 "2022-09-19T16:43:58Z")

</div>

You code example works fine for me ..

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/d/fd3cf03a5a4c69918d4fe258a199d404c0958df3.png)

Are you sure you installed the correct **Vue 2** version that is needed for the apexchart library ?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/f/7f252cc95f8f861fb0e32006a85fe6926e2b7fc6.png)

Its a common mistake that people install the Vue 3 library instead for either bootstrap-vue or apexcharts in this case this is not supported.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [19 September 2022 19:30 UTC](https://discourse.nodered.org/t/examples-using-apexcharts-with-uibuilder/67827/5 "2022-09-19T19:30:12Z")

</div>

OK, you should check your browser's dev console for errors. As Andy has suggested, I suspect you've loaded Vue v3 rather than v2 and the fact that your browser window hasn't centred the title with a white background shows that bootstrap-vue is not loaded.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [19 October 2022 19:30 UTC](https://discourse.nodered.org/t/examples-using-apexcharts-with-uibuilder/67827/6 "2022-10-19T19:30:58Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
