Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

chart js in angular 13

npm i chart.js
Comment

angular chart js

npm install angular-chart.js --save
Comment

angular-chart.js

<canvas id="myChart" width="400" height="400"></canvas>
<script>
const ctx = document.getElementById('myChart').getContext('2d');
const myChart = new Chart(ctx, {
    type: 'bar',
    data: {
        labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
        datasets: [{
            label: '# of Votes',
            data: [12, 19, 3, 5, 2, 3],
            backgroundColor: [
                'rgba(255, 99, 132, 0.2)',
                'rgba(54, 162, 235, 0.2)',
                'rgba(255, 206, 86, 0.2)',
                'rgba(75, 192, 192, 0.2)',
                'rgba(153, 102, 255, 0.2)',
                'rgba(255, 159, 64, 0.2)'
            ],
            borderColor: [
                'rgba(255, 99, 132, 1)',
                'rgba(54, 162, 235, 1)',
                'rgba(255, 206, 86, 1)',
                'rgba(75, 192, 192, 1)',
                'rgba(153, 102, 255, 1)',
                'rgba(255, 159, 64, 1)'
            ],
            borderWidth: 1
        }]
    },
    options: {
        scales: {
            y: {
                beginAtZero: true
            }
        }
    }
});
</script>
 
        Copied!
Comment

angular chart

<apx-chart [series]="series" [chart]="chart" [title]="title"></apx-chart>
Comment

PREVIOUS NEXT
Code Example
Javascript :: next js environment variables 
Javascript :: npm hook form 
Javascript :: javascript how to merge arrays 
Javascript :: timestamp to unix time react 
Javascript :: using template literals to create html 
Javascript :: react native tab navigation header 
Javascript :: format string javascript 
Javascript :: multiple conditions for JavaScript .includes() method 
Javascript :: sum of array javascript 
Javascript :: check if div contains background image 
Javascript :: to the power of javascript 
Javascript :: for loop java script 
Javascript :: find remainder in javascript 
Javascript :: javascript replace ios apostrophe 
Javascript :: js select get all options value 
Javascript :: js check if a string is a number 
Javascript :: how to add new line in jsx 
Javascript :: break in if statement js 
Javascript :: Activelink.js 
Javascript :: vuejs reset component 
Javascript :: react native run real device 
Javascript :: javascript check if array is empty or null or undefined 
Javascript :: script tags in react 
Javascript :: add an object to index 0 array js 
Javascript :: download pdf in javascript 
Javascript :: this.setstate prevstate 
Javascript :: How to Check if a Substring is in a String in JavaScript Using the includes() Method 
Javascript :: json to string 
Javascript :: how to generate random text in vue js 
Javascript :: node-schedule job on specific datetime 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =