#### Category : chart.js

Found in [consoletvschartssrcChartsServiceProvider.php] Error Found this error.. any ideas Sourc..

I need the value of chart show after name of data for example ([colour of data] Car 50, [colour of data] Motorcycle 200). I’ve tried change the value of legend title but it doesn’t work at all Here is it my code var ctx = document.getElementById(‘top-five’).getContext(‘2d’); var myChartpie = new Chart(ctx, { type: ‘pie’, data: ..

I have a table showing branches expenses such as (branch: 1, total: 100)(branch: 2, total: 400) and it could be more than 2 branches and I would like to show them in a line chart with chart.js. my question here is how to have multi datasets based on how many branches the table has. I ..

This is my query to get the product name and total quantity sold. $prd = DB::table(‘order_details’) ->join(‘products’, ‘order_details.product_id’, ‘=’, ‘products.id’) ->select(‘products.name’, DB::raw(‘SUM(quantity) as quantity’)) ->groupBy(‘products.name’) ->orderBy(‘quantity’, ‘desc’) ->get(); return$prd; This is the output. [ { "name": "PINK", "quantity": "22" }, { "name": "WHITE", "quantity": "14" }, { "name": "RED", "quantity": "13" } ] But ..

I don’t know how to address this question properly but my problem is I can’t display my data in my chart using chart.js and laravel. To start with, I have a "sales" table in my database, and it has "total" and "created_at" fields which are the data that I wanted to reflect on my chart. ..

I’m using chart.js for showing statistics of reviews and messages of a user, but I’m getting problems with the scripts, now the stats are working but I got this error Cannot find element: #app and I don’t know how to manage that. If I use defer in this script (now I deleted it to see ..

I’m trying to create a statistics view, but chart.js gives me problems. I tried to delete defer from the app.js script tag and it works but it gave me problems on all the rest of the website. Here is the stats.view in which I’m trying to make work the scripts and the canvas, but with ..

Can someone direct me to example how can I use https://www.chartjs.org/chartjs-plugin-annotation/guide/usage.html with Laravel http://lavacharts.com/ Lavacharts package? I tried to add config to "annotations" array (as in example http://lavacharts.com/#chart-bar) but with no luck. which steps i need to reproduce to get this plugin to work with my existing charts? tnx! Y Sourc..

I´m traying to create statistics from my database. I´m changing application and before statistics was created from call table. But i change this and i was created a new table statistics and have this column: id, id_ployed, call_id, created_at(nullable), updated_at(nullable) and data example for example: 52,60,88988,4 53,60,88989,10 54,60,88990,6 62,9,88999,1 i have this function in my ..

I want to make a bar stacked graph with 2 datasets with Chartjs 6 – Laravel 8 $chart->labels($resultados1); $chart->dataset(‘Dataset1′,’bar’,$resultados2)->backgroundColor(collect([‘#7158e2’])); $chart->dataset(‘Dataset2′,’bar’,$resultados3)->backgroundColor(collect([‘#1158e2’])); //>>>>>>>>$chart->scales(‘xAxes’,’stacked’ => true , ‘yAxes’ => [‘stacked’ => true]);<<<<<<<<<<<<<<<<<<<<<< But obviously this last commented line is wrong I’ve found how to make this by javascript but I need to put this on laravel code easily .. Read more im trying to pass the content of the database to the dataset for the chartjs but the errors says UNEXPECTED TOKEN < IN JSON AT POSITION 0. this chartjs version is 7 samplechart.php <?php declare(strict_types = 1); namespace AppCharts; use ChartisanPHPChartisan; use ConsoleTVsChartsBaseChart; use IlluminateHttpRequest; class SampleChart extends BaseChart { /** * Handles the HTTP .. Read more I’m currently doing the dashboard in our project and can’t progress because of this error. Call to undefined method AppChartsSampleChart::labels(). I suspect that I missed some installation and configurations but I’ve done it several times now. SampleChart.php <?php declare(strict_types = 1); namespace AppCharts; use ChartisanPHPChartisan; use ConsoleTVsChartsBaseChart; use IlluminateHttpRequest; class SampleChart extends BaseChart { /** .. Read more I am new to laravel and with chart.js I did surf online but didn’t find the proper solution yet, Any help and suggestions would be great. Here is the link to a similar issue with some code overview. Please tell me if you need anything else. Hey guys,I need help to display datalabels from chartjs .. Read more So here I’ve called an array to display dates and their orders but I cannot see Data-labels, And this script is old but it works with hard written datasets and labels, Any ideas why it’s messed? Basically what the below code does is when you click the button it changes and calls that var to .. Read more so I’m trying to get data for my chart from the database and I want it to display a number of orders per day scenario well I tried this code and it gives me full unformatted dates from the database. Any ideas on how to change it to date/month??$data = DB::table(‘analytics’)->get(); $attrs = array(); .. Read more I don’t know, how much time I lost looking for solution for this issue. I wanted to use Chart.js in my Laravel project, so I followed instructions described here. composer require fx3costa/laravelchartjs (runned) Fx3costaLaravelChartJsProvidersChartjsServiceProvider::class (added in the right place) npm i chart.js (used to install chart.js) In my controller and blade I used code from .. Read more I am using chart.js, Laravel 5.4 and blade templates. I have to show doughnut chart and when user click on particular area then it should show the name of selected label and value belongs to it in the modal but firstly I am not able to get label name when user click on doughnut chart. .. Read more I´m traying to create a graphic in my app developed in Laravel 5.6. I´m sending all my data from my controller with one array.$callSend = array(); foreach($result as$call){ array_push($callSend, Cita::where(‘id_llamada’,$call->id) ->with("estado") ->get()); } Cita it´s my model to get all my data this return this: (754) [Array(1), Array(1), Array(1), Array(1), Array(1), Array(1), Array(1), ..

var ctx = document.getElementById("myLineChart").getContext(‘2d’); var myLineChart = new Chart(ctx, { type: ‘line’, data: { labels: [ @foreach($year as$year) "{{$year->year}}", @endforeach ], datasets: [ { label: ‘A’, data: [ @foreach($data1 as $dt1) {{$dt1->total}}, @endforeach ], borderColor: ‘rgba(75, 192, 192, 1)’, backgroundColor: ‘rgba(75, 192, 192, 0.2)’, }, { label: ‘B’, data: [ @foreach($data2 as$dt2) {{$dt2->total}}, .. Read more I am importing my chart js code from <script src="{{ asset(‘/css/tailwind/js/charts-bars.js’) }}" defer></script> I have some data from the controller and may I ask is it possible to pass the data to this script before the chart gets rendered? My charts-bars.js code const barConfig = { type: ‘bar’, data: { labels: [‘January’, ‘February’, ‘March’, ‘April’, .. Read more I’m currently working on a dashboard and im trying to display a score across a lot of people. Here is my chart.js code. <script> const labels = [ @foreach($all_staff as $staff) @php$i++; @endphp ‘{{ $i }}’, @endforeach ]; const data = { labels: labels, datasets: [{ label: ‘My First dataset’, backgroundColor: ‘rgb(255, 99, 132)’, .. Read more I would like to ask how install and integrate [email protected] with my laravel application. I use cdn links right now but later it wont be an option for me later. Used cdn links: <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"</script> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> Method I tried: Installing chartjs npm i [email protected] Add this line in webpack.mix.js: mix.copy(‘node_modules/chart.js/dist/chart.js’, ‘public/chart.js/chart.js’); Then .. Read more I’m using Chartisan with Chart.js & Laravel. How do I make use of these hooks to access the more complicated styling options in Chart.js? https://chartisan.dev/documentation/frontend/hooks#Custom-Hooks https://www.chartjs.org/docs/latest/samples/scale-options/grid.html <div x-data="{chart: null}" x-init="chart = new Chartisan({ el: ‘#{{$chartPath }}’, url: ‘@chart(\$chartPath)’, hooks: new ChartisanHooks() .datasets([{ type: ‘line’, fill: true, borderColor: ‘#BBE9DE’, tension: 0.1 }]) {{– .options({ title: ..