Title: Adding Chart javascript to Shortcoder not working
Last modified: October 6, 2020

---

# Adding Chart javascript to Shortcoder not working

 *  Resolved [stan255](https://wordpress.org/support/users/stan255/)
 * (@stan255)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/adding-chart-javascript-to-shortcoder-not-working/)
 * 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)

 *  Thread Starter [stan255](https://wordpress.org/support/users/stan255/)
 * (@stan255)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/adding-chart-javascript-to-shortcoder-not-working/#post-13496493)
 * Fixed.
    Issue with enqueue Chart.js script.

Viewing 1 replies (of 1 total)

The topic ‘Adding Chart javascript to Shortcoder not working’ is closed to new replies.

 * ![](https://ps.w.org/shortcoder/assets/icon.svg?rev=2222236)
 * [Shortcoder — Create Shortcodes for Anything](https://wordpress.org/plugins/shortcoder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcoder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcoder/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcoder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcoder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcoder/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 1 reply
 * 1 participant
 * Last reply from: [stan255](https://wordpress.org/support/users/stan255/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/adding-chart-javascript-to-shortcoder-not-working/#post-13496493)
 * Status: resolved