'ChartJS Tooltip

I am using ChartJS on my project, I followed the integration as indicated on the ChartJS website. My problem is the following My error.

I tried several things like :

options: { tooltips: { enabled: false }, ... }

Chart.defaults.global.tooltips.enabled = false;

My blade with the script for ChartJS

@extends('layout.admin.masterAdmin')

@section('title', 'All Tickets')
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
@section('content')

    <div class="">
        <canvas id="myChart"></canvas>
    </div>
    <script>
        const labels = 'Status';
        const data = {
            labels: labels,
            datasets: [{
                label: 'My First Dataset',
                data: [65, 59, 80, 81, 56, 55, 40],
                backgroundColor: [
                    'rgba(255, 99, 132, 0.2)',
                    'rgba(255, 159, 64, 0.2)',
                    'rgba(255, 205, 86, 0.2)',
                    'rgba(75, 192, 192, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(153, 102, 255, 0.2)',
                    'rgba(201, 203, 207, 0.2)'
                ],
                borderColor: [
                    'rgb(255, 99, 132)',
                    'rgb(255, 159, 64)',
                    'rgb(255, 205, 86)',
                    'rgb(75, 192, 192)',
                    'rgb(54, 162, 235)',
                    'rgb(153, 102, 255)',
                    'rgb(201, 203, 207)'
                ],
                borderWidth: 1
            }]
        };

        const ctx = document.getElementById('myChart').getContext("2d");
        const myChart= new Chart(ctx)
        {
            config = {
                type: 'bar',
                data: data,
                options: {
                    scales: {
                        y: {
                            beginAtZero: true
                        }
                    }
                },
            };
        }

    </script>


@endsection

Thank you, for all the answers you can give me



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source