Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

chart js two y axis

var canvas = document.getElementById('chart');
new Chart(canvas, {
  type: 'line',
  data: {
    labels: ['1', '2', '3', '4', '5'],
    datasets: [{
      label: 'A',
      yAxisID: 'A',
      data: [100, 96, 84, 76, 69]
    }, {
      label: 'B',
      yAxisID: 'B',
      data: [1, 1, 1, 1, 0]
    }]
  },
  options: {
    scales: {
      yAxes: [{
        id: 'A',
        type: 'linear',
        position: 'left',
      }, {
        id: 'B',
        type: 'linear',
        position: 'right',
        ticks: {
          max: 1,
          min: 0
        }
      }]
    }
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: discount calculations javaScript 
Javascript :: javascript object entries 
Javascript :: send file discord js v12 
Javascript :: form.select react bootstrap 
Javascript :: import json file python online 
Javascript :: jquery id click 
Javascript :: parse int into 2 digits format javascript 
Javascript :: moment add 6 months 
Javascript :: if media queries jquery 
Javascript :: get checked radio button value jquery by name 
Javascript :: vue print date 
Javascript :: iterate formData 
Javascript :: react open url with button 
Javascript :: js fetch send json 
Javascript :: save token in localstorage 
Javascript :: get pods running on a node 
Javascript :: Mongoose - populate nested array 
Javascript :: how to create infinite loop in javascript 
Javascript :: query select multiple classes 
Javascript :: jquery data attribute 
Javascript :: scrollheight jquery 
Javascript :: loop through map in js 
Javascript :: javascript set checkbox checked based on value 
Javascript :: Use History React Router v6 app 
Javascript :: return random rows sqlite 
Javascript :: how to show bootstrap 5 modal using jquery 
Javascript :: javascript seconds to date 
Javascript :: curl post json file 
Javascript :: how to append rows in table using jquery each function 
Javascript :: remove appended element jquery 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =