Category : charts

I worked on laravel charts to display my data but i never find a way to add a parameter inside the query itself. Is there any solution to this? My current query public function handler(Request $request): Chartisan { ->select(DB::raw(‘COUNT(e.id)’)) ->rightJoin(‘test_cases as c’,’e.case_id’,’=’,’c.id’) ->rightJoin(‘test_suites as s’,’c.suite_id’,’=’,’s.id’) ->rightJoin(‘build_versions as b’,’e.build_id’,’=’,’b.id’) ->rightJoin(‘configuration as f’,’f.id’,’=’,’e.finalconfig_id’) ->rightJoin(‘baseconfig_configuration as bc’,’bc.config_id’,’=’,’f.id’) ->rightJoin(‘base_config ..

Read more

I am using Larapex charts for my laravel project but I cannot make the chart render when using a variable that contains my values retrieved from the database. $userLogins = User::select(DB::raw("COUNT(*) as count")) ->whereYear(‘last_login_at’, date(‘Y’)) ->groupBy(DB::raw("Month(last_login_at)")) ->pluck(‘count’); The variable above retrives following values: [1,1,3,1,1,1,1] Which I then try to place within the chart $chart = ..

Read more

I’m using Laravel and I want to pass variable to external js file here is controller code : public function reports() { $phone = Product::where(‘type’,’phone’)->where(‘year’,’2018′)->get(); $phoneCount =count($phone); $laptop = Product::where(‘type’,’laptop’)->where(‘year’,’2018′)->get(); $laptopCount =count($laptop); } return view(‘report’, [‘phone’ => $phoneCount,’laptop’=>$laptopCount ]); and here is external chart.js code but its not work data: { labels: ["phone","laptop"], datasets: [ ..

Read more

I have been able to set the library and display the sample chart successfully using this: return Chartisan::build() ->labels([‘First’, ‘Second’, ‘Third’]) ->dataset(‘Sample’, [1, 2, 3]) ->dataset(‘Sample 2′, [3, 2, 1]); I tried setting up the chart with data from my database but I couldn’t. I noticed that all helpers are not accessible from the BaseChart ..

Read more

I was asked to make a graph where I should extract the names, along with the amount it has per year. The way I did it was just to bring the total and the year for each portal name. $portalInmobiliario = Ticket::selectRaw(‘year(created_at) as anio, count(id) as total’)->where(‘source_id’,1)->groupBy(‘anio’)->get(); $tocToc = Ticket::selectRaw(‘year(created_at) as anio, count(id) as total’)->where(‘source_id’,2)->groupBy(‘anio’)->get(); ..

Read more

I followed the guide on https://charts.erik.cat/guide/ to install Chartisan with echarts in my Laravel 7.4 framework. Everything works fine and I receive a chart. The chart is triggered with this handler function: public function handler(Request $request): Chartisan { return Chartisan::build() ->labels([‘First’, ‘Second’, ‘Third’]) ->dataset(‘Sample’, [1, 2, 3]) ->dataset(‘Sample 2’, [3, 2, 1]); } The dataset ..

Read more

I am following this guide: https://github.com/asantibanez/livewire-charts after installing the necessary dependencies. In my laravel project i imported: livewire -> dashboard view -> dashboard.blade.php in routes/web.php I put the following code: Route::middleware([‘auth:sanctum’, ‘verified’])->get(‘/’, [Dashboard::class])->name(‘livewire.dashboard’); but I get: Sourc..

Read more

I have a table "echatillon_de_commande" public $table = ‘order_tab’; public $fillable = [‘departement’,’pat_nom’,’pat_prenom’,’pat_email’,’pat_telephone1′,’pat_rue1′,’detail_adresse’,’pat_postal’,’pat_ville’,’pat_pays’, ‘produits_detail’,’referance’]; and I wish to have the months of commands and the number of commands placed per month. I can display the result on this view @foreach($commandes as $Echantillon_demande) <div> {{ date(‘d-M-Y’, strtotime($Echantillon_demande->created_at)) }} </div> @endforeach and pass its values in this ..

Read more

I installed Laravel v7 Charts and created a FieldChart <?php declare(strict_types = 1); namespace AppCharts; use ChartisanPHPChartisan; use ConsoleTVsChartsBaseChart; use IlluminateHttpRequest; class FieldChart extends BaseChart { public function handler(Request $request): Chartisan { return Chartisan::build() ->labels([‘First’, ‘Second’, ‘Third’]) ->dataset(‘Sample’, [1, 2, 3]) ->dataset(‘Sample 2’, [3, 2, 1]); } } I want to use this FiledChart class ..

Read more

I am trying to create a chart for my data but to no avail, I use laravel. I don’t know how to convert data to highchart accordingly. I refer to the demos to be able to understand this problem but still no results. https://www.highcharts.com/demo/line-labels enter image description here Source: Laravel Sta..

Read more

In my project I use Laravel 7.2 with ui bootstrap/vue and want to display a chart from Chart.js. I donĀ“t want to use any plugins or modules and I prefer like to organize it by myself. I have tried to implement by this article: https://www.chartjs.org/docs/latest/getting-started/integration.html Nevertheless it shows an empty canvas element. This is my ..

Read more