laravel-charts icon indicating copy to clipboard operation
laravel-charts copied to clipboard

how to use chart_height

Open jayomayan opened this issue 1 year ago • 1 comments

Tried setting it in option but it doesn't follow the height:

$chart_options = [
        'chart_height' => 750,
            'chart_title' => 'Users',
            'report_type' => 'group_by_date',
            'model' => 'App\Models\User',
            'group_by_field' => 'created_at',
            'group_by_period' => 'day',
            'chart_type' => 'line',
            'filter_days' => 30,
            'show_blank_data'=>true,
            'chart_color' => '79, 142, 191',
            'conditions'  => [
                        
                        ['name' => 'Users', 'condition' => 'account_type = "User" ', 'color' => '','fill' => false],
                    ],
        ];

jayomayan avatar Apr 19 '23 04:04 jayomayan

I'd like to know this too !

I hacked it by containing the chart in a div with set height and adding the following to the javascript file:

responsive: true,
maintainAspectRatio: false,

netm avatar Mar 14 '24 08:03 netm