• Resolved stan255

    (@stan255)


    Hi,
    I added this Chart javascript code to Shortcoder and place the Shortcoder on a page. However, it didn’t show anything.

    <canvas id="myChart"></canvas>
    <script>
    var ctx = document.getElementById('myChart').getContext('2d');
    var chart = new Chart(ctx, {
        type: 'line',
        data: {
            labels: ['2014', '2015', '2016', '2017', '2018', '2019', '2020'],
            datasets: [{
                label: 'Occupancy',
                backgroundColor: 'rgb(255, 99, 132)',
                data: [96.1, 94.0, 96.5, 97.6, 97.5, 98.2, 98.3]
            }]
        },
    });
    </script>

    I also placed this directly into WordPress editor without Shortcoder and nothing too.

    I know this should show a chart because I tried this with another Javascript plugin and it works.

    Does Shortcoder work with this type of javascript code?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Adding Chart javascript to Shortcoder not working’ is closed to new replies.