Skip to content

Broken render on Brave (Chrome) browser? #10539

@DavidGarciaCat

Description

@DavidGarciaCat

Expected behavior

I would expect to see the rendered chart in the same way it's rendered on Firefox or Safari

Safari example:

Screenshot 2022-08-01 at 18 05 44

Firefox example:

Screenshot 2022-08-01 at 18 06 16

Current behavior

Legend and Axes length/space is being ignored

Brave (Chrome) example:

Screenshot 2022-08-01 at 18 07 08

Reproducible sample

( code sample below - data provided through AJAX/JSON call )

Optional extra steps/info to reproduce

Chart.js is being included through CDN

https://cdn.jsdelivr.net/npm/chart.js

And I use this code

    $(function () {
        const usersCountOverTimeChartJsonData = $.ajax('/admin/stats/users/count', {
            'type': 'GET',
            'dataType': 'json',
            'success': function (data) {
                const usersCountOverTimeChartLabels = [];
                const usersCountOverTimeChartDataSetActivated = [];
                const usersCountOverTimeChartDataSetPending = [];

                $.each(data, function(month, values) {
                    usersCountOverTimeChartLabels.push(month);
                    usersCountOverTimeChartDataSetActivated.push(values.activated);
                    usersCountOverTimeChartDataSetPending.push(values.pending);
                });

                const usersCountOverTimeChartData = {
                    labels: usersCountOverTimeChartLabels,
                    datasets: [{
                        label: 'Activated',
                        backgroundColor: 'rgb(58, 110, 165)',
                        borderColor: 'rgb(58, 110, 165)',
                        data: usersCountOverTimeChartDataSetActivated,
                    },{
                        label: 'Activation Pending',
                        backgroundColor: 'rgb(224, 151, 0)',
                        borderColor: 'rgb(224, 151, 0)',
                        data: usersCountOverTimeChartDataSetPending,
                    }]
                };

                const usersCountOverTimeChartConfig = {
                    type: 'line',
                    data: usersCountOverTimeChartData,
                    options: { plugins: { legend: { position: 'bottom' } } }
                };

                const usersCountOverTimeChart = new Chart(
                    document.getElementById('usersCountOverTimeChart'),
                    usersCountOverTimeChartConfig
                );
            },
        });
    });

Possible solution

No response

Context

No response

chart.js version

v3.8.2

Browser name and version

Brave - Version 1.41.100 Chromium: 103.0.5060.134 (Official Build) (arm64)

Link to your project

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions