public function withViews(callable $viewsDefinitionCallback)
    {
        $definition = new ChartViewDefinition($this->dataSource);
        $viewsDefinitionCallback($definition);
        $views = $definition->finalize();

        call_user_func($this->callback, new ChartDisplay($this->name, $this->dataSource, $views));
    }
public function withViews(callable $viewsDefinitionCallback)
    {
        $definition = new ChartViewDefinition($this->dataSource);
        $viewsDefinitionCallback($definition);
        $views = $definition->finalize();

        call_user_func($this->callback, new ChartDisplay($this->name, $this->dataSource, $views));
    }
public function withViews ( callable $ viewsDefinitionCallback ) { $ definition = new ChartViewDefinition ( $ this -> dataSource ) ; $ viewsDefinitionCallback ( $ definition ) ; $ views = $ definition -> finalize ( ) ; call_user_func ( $ this -> callback , new ChartDisplay ( $ this -> name , $ this -> dataSource , $ views ) ) ; }
Defines the views of the chart

Example:
<code>
->withViews(function (ChartViewDefinition $view) {
$view->name('default', 'Default')
->asDefault()
->orderByAsc('axis-name');
});
</code>

@param callable $viewsDefinitionCallback

@return void
Defines the views of the chart