Php 如何在我的列顶部显示数据标签?

Php 如何在我的列顶部显示数据标签?,php,laravel,charts,chart.js,Php,Laravel,Charts,Chart.js,在搜索文档大约2小时后,没有找到答案(),也许有人会帮我解决这个问题。。。我正在使用Laravel Charts chart.js库。如何在我的列顶部显示数据标签?如DC coulmn上的图片所示: 这是我的代码: <?php namespace App\Http\Controllers; use App\Content; use App\Charts\UserLineChart; use Charts; use Illuminate\Http\Request; class Cha

在搜索文档大约2小时后,没有找到答案(),也许有人会帮我解决这个问题。。。我正在使用Laravel Charts chart.js库。如何在我的列顶部显示数据标签?如DC coulmn上的图片所示:

这是我的代码:

<?php

namespace App\Http\Controllers;

use App\Content;
use App\Charts\UserLineChart;
use Charts;

use Illuminate\Http\Request;

class ChartController extends Controller
{

  public function index(Request $request)
  {
    $content = Content::where('vei_sn', '23333')->get();
    if ($request->has('date_from') && $request->input('date_from') != '' && $request->has('date_to') && $request->input('date_to') != '') {
        $datefrom = $request->input('date_from');
        $dateto = $request->input('date_to');
        $content = $content->whereBetween('op_date', [$datefrom, $dateto]);
    }

      $OBD = $content->where('con_type', 'OBD')->count();
      $DC = $content->where('con_type', 'DC')->count();
      $BSL = $content->where('con_type', 'BSL')->count();
      $content = $content->pluck('con_type', 'con_type');

      $pChart = new UserLineChart;
      $bChart = new UserLineChart;

      $pChart->labels($content->values())->minimalist($display = true);
      $bChart->labels($content->values());
      $pChart->dataset('Connections', 'pie', [$OBD, $DC, $BSL]);
      $bChart->dataset('Connections', 'bar', [$OBD, $DC, $BSL])->options([
        'fill' => false,
      ]);
      return view('chart.index', compact('pChart', 'bChart'));
  }
}