src/Classes/C3/Chart.php
public function formatDatasets()
    {
        $datasets = Collection::make($this->datasets);

        return json_encode([
            'columns' => Collection::make($this->datasets)
                ->each(function ($dataset) {
                    $dataset->matchValues(count($this->labels));
                })
                ->map(function ($dataset) {
                    return $dataset->format($this->labels);
                })
                ->toArray(),
            'type'  => $datasets->first()->type,
            'types' => $datasets->mapWithKeys(function ($d) {
                return [$d->name => $d->type];
            })->toArray(),
        ]);
    }
public function formatDatasets()
    {
        $datasets = Collection::make($this->datasets);

        return json_encode([
            'columns' => Collection::make($this->datasets)
                ->each(function ($dataset) {
                    $dataset->matchValues(count($this->labels));
                })
                ->map(function ($dataset) {
                    return $dataset->format($this->labels);
                })
                ->toArray(),
            'type'  => $datasets->first()->type,
            'types' => $datasets->mapWithKeys(function ($d) {
                return [$d->name => $d->type];
            })->toArray(),
        ]);
    }
public function formatDatasets ( ) { $ datasets = Collection :: make ( $ this -> datasets ) ; return json_encode ( [ 'columns' => Collection :: make ( $ this -> datasets ) -> each ( function ( $ dataset ) { $ dataset -> matchValues ( count ( $ this -> labels ) ) ; } ) -> map ( function ( $ dataset ) { return $ dataset -> format ( $ this -> labels ) ; } ) -> toArray ( ) , 'type' => $ datasets -> first ( ) -> type , 'types' => $ datasets -> mapWithKeys ( function ( $ d ) { return [ $ d -> name => $ d -> type ] ; } ) -> toArray ( ) , ] ) ; }
Formats the datasets.

@return void
Formats the datasets .