app/Statistics/Google/ChartChildren.php
public function chartChildren(): string
    {
        $data = [
            [
                I18N::translate('Century'),
                I18N::translate('Average number')
            ]
        ];

        foreach ($this->queryRecords() as $record) {
            $data[] = [
                $this->century_service->centuryName((int) $record->century),
                (float) $record->num
            ];
        }

        $chart_title   = I18N::translate('Average number of children per family');
        $chart_options = [
            'title' => $chart_title,
            'subtitle' => '',
            'legend' => [
                'position'  => 'none',
            ],
            'vAxis' => [
                'title' => I18N::translate('Number of children'),
            ],
            'hAxis' => [
                'title' => I18N::translate('Century'),
            ],
            'colors' => [
                '#84beff'
            ],
        ];

        return view(
            'statistics/other/charts/column',
            [
                'data'          => $data,
                'chart_options' => $chart_options,
                'chart_title'   => $chart_title,
            ]
        );
    }
public function chartChildren(): string
    {
        $data = [
            [
                I18N::translate('Century'),
                I18N::translate('Average number')
            ]
        ];

        foreach ($this->queryRecords() as $record) {
            $data[] = [
                $this->century_service->centuryName((int) $record->century),
                (float) $record->num
            ];
        }

        $chart_title   = I18N::translate('Average number of children per family');
        $chart_options = [
            'title' => $chart_title,
            'subtitle' => '',
            'legend' => [
                'position'  => 'none',
            ],
            'vAxis' => [
                'title' => I18N::translate('Number of children'),
            ],
            'hAxis' => [
                'title' => I18N::translate('Century'),
            ],
            'colors' => [
                '#84beff'
            ],
        ];

        return view(
            'statistics/other/charts/column',
            [
                'data'          => $data,
                'chart_options' => $chart_options,
                'chart_title'   => $chart_title,
            ]
        );
    }
public function chartChildren ( ) : string { $ data = [ [ I18N :: translate ( 'Century' ) , I18N :: translate ( 'Average number' ) ] ] ; foreach ( $ this -> queryRecords ( ) as $ record ) { $ data [ ] = [ $ this -> century_service -> centuryName ( ( int ) $ record -> century ) , ( float ) $ record -> num ] ; } $ chart_title = I18N :: translate ( 'Average number of children per family' ) ; $ chart_options = [ 'title' => $ chart_title , 'subtitle' => '' , 'legend' => [ 'position' => 'none' , ] , 'vAxis' => [ 'title' => I18N :: translate ( 'Number of children' ) , ] , 'hAxis' => [ 'title' => I18N :: translate ( 'Century' ) , ] , 'colors' => [ '#84beff' ] , ] ; return view ( 'statistics/other/charts/column' , [ 'data' => $ data , 'chart_options' => $ chart_options , 'chart_title' => $ chart_title , ] ) ; }
Creates a children per family chart.

@return string
Creates a children per family chart .