Posted in charts
1716
11:58 pm, April 3, 2023
 

Simple Line chart with Chart.js

a nice simple line chart example with fill using chart.js

HTML

<canvas id="myChart" style="width:100%;max-width:700px"></canvas>

Scripts

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

Javascript

const xValues = [50,60,70,80,90,100,110,120,130,140,150];  
const yValues = [7,8,8,9,9,9,10,11,14,14,15];  
  
new Chart("myChart", {  
  type: "line",  
  data: {  
    labels: xValues,  
    datasets: [{  
      backgroundColor:"rgba(0,0,255,1.0)",  
      borderColor: "rgba(0,0,255,0.1)",  
      data: yValues  
    }]  
  },  
  options:{}  
});

View Statistics
This Week
14
This Month
182
This Year
462

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
Don't look to be the next Facebook, try to solve a real problem instead.
Unknown
Random CSS Property

font-stretch

The font-stretch CSS descriptor allows authors to specify a normal, condensed, or expanded face for the fonts specified in the @font-face rule.
font-stretch (@font-face) css reference