This package provides us with pie charts, donut charts, area charts, line charts, and others. With the help of this package, we can easily create and render charts in our Laravel application without writing any JavaScript code. In this article I will use the first method. Larapex Charts is a Laravel wrapper around ApexCharts. In other cases, use instructions from this article. If Vue.js is disabled, you can paste scripts directly into the content section. You can set graph data directly from the PHP. Initializing graphs from blade files is very convenient. Next, rebuild JavaScript assets: npm run dev 3. To do this add following code to resources/js/bootstrap.js: import Chart from 'chart.js' Īfter this ChartJS will be available as a Chart in the app.js and from the window object in the. If you want to use ChartJS in your blade files, make it available in the window object. Run the following command to do this: npm install chart.js -save It makes the JQuery variable ($) available in the window object. You should install it manually using the command below: npn install jquery -saveĪfter this, add the following code to the r esources/js/bootstrap.js file: window.$ = require('jquery')
0 Comments
Leave a Reply. |