White Arrow icon
Back to all Elements

Chart.js in Webflow

A short tutorial on how to implement a Chart.js plugin in a Webflow project

1. Add the chart.js file to the project. Best is in the page/projects custom code section, before </body> tag.

2. Initiate a canvas with <canvas> tags (HTML embed widget)

3. Call the chart.js and configure options.

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.js"></script>

<canvas id="myChart" width="400" height="400"></canvas>

<script>

 

 var ctx = document.getElementById('myChart');

 var myChart = new Chart(ctx, {

   type: 'bar',

   data: {

     labels: ["1st", "2nd", "3rd", "4th", "5th"],

     datasets: [{

       label: 'Some Label',

       data: [10, 20, 30, 40, 50],

       backgroundColor: ["white", "#A5DBFF", "#B6E5F9", "#D1F0FF", "#8ED3FF"],

     }]

   },

 });

</script>

Copy


Preview:

Share:

A tongue scraper is is so much better in cleaning your tongue instead of the normal brushing it.

Might also interest you:

Round Scroll Indicator / Progress Bar

Cloneable
Interactions
Animation

A round scroll indicator mad with Webflow elements and interactions

Read more
White Arrow icon

Pass Parameters

Cloneable
Code

Pass input fields parameters and add them to the destination URL.

Read more
White Arrow icon

Before / After effect

Cloneable
Tricks
Interactions

A Before / After effect for photos, without any code. Only Webflow's interaction.

Read more
White Arrow icon