composer update

This commit is contained in:
2019-06-23 10:14:30 +00:00
parent a56db5ea2b
commit ec4506ebf4
790 changed files with 35767 additions and 7663 deletions
+542
View File
@@ -0,0 +1,542 @@
<?php
namespace ConsoleTVs\Charts\Classes;
use Balping\JsonRaw\Encoder;
use Balping\JsonRaw\Raw;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\View;
class BaseChart
{
/**
* Stores the chart ID.
*
* @var string
*/
public $id;
/**
* Stores the chart datasets.
*
* @var array
*/
public $datasets = [];
/**
* Stores the dataset class to be used.
*
* @var object
*/
protected $dataset = DatasetClass::class;
/**
* Stores the chart labels.
*
* @var array
*/
public $labels = [];
/**
* Stores the chart container.
*
* @var string
*/
public $container = '';
/**
* Stores the chart options.
*
* @var array
*/
public $options = [];
/**
* Stores the plugins options.
*
* @var array
*/
public $plugins = [];
/**
* Stores the plugin views.
*
* @var array
*/
public $pluginsViews = [];
/**
* Stores the chart script.
*
* @var string
*/
public $script = '';
/**
* Stores the chart type.
*
* @var string
*/
public $type = '';
/**
* Stores the API url if the chart is loaded over API.
*
* @var string
*/
public $api_url = '';
/**
* Determines if the loader is show.
*
* @var bool
*/
public $loader = true;
/**
* Determines if the loader color.
*
* @var string
*/
public $loaderColor = '#22292F';
/**
* Stores the height of the chart.
*
* @var int
*/
public $height = 400;
/**
* Stores the width of the chart.
*
* @var int
*/
public $width = null;
/**
* Stores the available chart letters to create the ID.
*
* @var array
*/
public $scriptAttributes = [
'type' => 'text/javascript',
];
/**
* Stores the available chart letters to create the ID.
*
* @var string
*/
private $chartLetters = 'abcdefghijklmnopqrstuvwxyz';
/**
* Chart constructor.
*/
public function __construct()
{
$this->id = substr(str_shuffle(str_repeat($x = $this->chartLetters, ceil(25 / strlen($x)))), 1, 25);
}
/**
* Adds a new dataset to the chart.
*
* @param string $name
* @param array|Collection $data
*/
public function dataset(string $name, string $type, $data)
{
if ($data instanceof Collection) {
$data = $data->toArray();
}
$dataset = new $this->dataset($name, $type, $data);
array_push($this->datasets, $dataset);
return $dataset;
}
/**
* Set the chart labels.
*
* @param array|Collection $labels
*
* @return self
*/
public function labels($labels)
{
if ($labels instanceof Collection) {
$labels = $labels->toArray();
}
$this->labels = $labels;
return $this;
}
/**
* Set the chart options.
*
* @param array|Collection $options
* @param bool $overwrite
*
* @return self
*/
public function options($options, bool $overwrite = false)
{
if (!empty($options['plugins'])) {
$options['plugins'] = new Raw(trim(preg_replace('/\s\s+/', ' ', $options['plugins'])));
}
if ($options instanceof Collection) {
$options = $options->toArray();
}
if ($overwrite) {
$this->options = $options;
} else {
$this->options = array_replace_recursive($this->options, $options);
}
return $this;
}
/**
* Set the plugins options.
*
* @param array|Collection $options
* @param bool $overwrite
*
* @return self
*/
public function plugins($plugins, bool $overwrite = true)
{
if ($plugins instanceof Collection) {
$plugins = $plugins->toArray();
}
if ($overwrite) {
$this->plugins = $plugins;
} else {
$this->plugins = array_replace_recursive($this->plugins, $plugins);
}
return $this;
}
/**
* Set the chart container.
*
* @param string $container
*
* @return self
*/
public function container(string $container = null)
{
if (!$container) {
return View::make($this->container, ['chart' => $this]);
}
$this->container = $container;
return $this;
}
/**
* Set the chart script.
*
* @param string $script
*
* @return self
*/
public function script(string $script = null)
{
if (count($this->datasets) == 0 && !$this->api_url) {
throw new \Exception('No datasets provided, please provide at least one dataset to generate a chart');
}
if (!$script) {
return View::make($this->script, ['chart' => $this]);
}
$this->script = $script;
return $this;
}
/**
* Set the chart type.
*
* @param string $type
*
* @return self
*/
public function type(string $type)
{
$this->type = $type;
return $this;
}
/**
* Set the chart height.
*
* @param int $height
*
* @return self
*/
public function height(int $height)
{
$this->height = $height;
return $this;
}
/**
* Set the chart width.
*
* @param int $width
*
* @return self
*/
public function width(int $width)
{
$this->width = $width;
return $this;
}
/**
* Formats the type to be a correct output.
*
* @return string
*/
public function formatType()
{
return $this->type ? $this->type : $this->datasets[0]->type;
}
/**
* Formats the labels to be a correct output.
*
* @return string
*/
public function formatLabels()
{
return Encoder::encode($this->labels);
}
/**
* Formats the chart options.
*
* @param bool $strict
*
* @return string
*/
public function formatOptions(bool $strict = false, bool $noBraces = false)
{
if (!$strict && count($this->options) === 0) {
return '';
}
$options = Encoder::encode($this->options);
return $noBraces ? substr($options, 1, -1) : $options;
}
/**
* Formats the plugins options.
*
* @param bool $strict
*
* @return string
*/
public function formatPlugins(bool $strict = false, bool $noBraces = false)
{
if (!$strict && count($this->plugins) === 0) {
return '';
}
$plugins = str_replace('"', '', Encoder::encode($this->plugins));
return $noBraces ? substr($plugins, 1, -1) : $plugins;
}
/**
* Use this to pass values to json without any modification
* Useful for defining callbacks.
*
* @param string $value
*
* @return \Balping\JsonRaw\Raw
*/
public function rawObject(string $value)
{
return new Raw($value);
}
/**
* Reset the chart options.
*
* @return self
*/
public function reset()
{
return $this->options([], true);
}
/**
* Formats the datasets for the output.
*
* @return string
*/
public function formatDatasets()
{
// This little boy was commented because it's not compatible
// in laravel < 5.4
//
// return Collection::make($this->datasets)
// ->each
// ->matchValues(count($this->labels))
// ->map
// ->format($this->labels)
// ->toJson();
return Encoder::encode(
Collection::make($this->datasets)
->each(function ($dataset) {
$dataset->matchValues(count($this->labels));
})
->map(function ($dataset) {
return $dataset->format($this->labels);
})
->toArray()
);
}
/**
* Indicates that the chart information will be loaded over API.
*
* @param string $api_url
*
* @return self
*/
public function load(string $api_url)
{
$this->api_url = $api_url;
return $this;
}
/**
* Determines if the chart should show a loader.
*
* @param bool $loader
*
* @return self
*/
public function loader(bool $loader)
{
$this->loader = $loader;
return $this;
}
/**
* Determines the loader color.
*
* @param string $color
*
* @return self
*/
public function loaderColor(string $color)
{
$this->loaderColor = $color;
return $this;
}
/**
* Alias for the formatDatasets() method.
*
* @return string
*/
public function api()
{
return $this->formatDatasets();
}
/**
* Sets an HTML attribute the the script tag of the chart.
*
* @param string $key
* @param string $value
*
* @return self
*/
public function setScriptAttribute(string $key, string $value)
{
$this->scriptAttributes[$key] = $value;
return $this;
}
/**
* Returns the string formatting of the script attributes.
*
* @return string
*/
public function displayScriptAttributes(): string
{
$result = '';
foreach ($this->scriptAttributes as $key => $value) {
echo " {$key}=\"{$value}\"";
}
return $result;
}
/**
* Formats the container options.
*
* @param string $type
* @param bool $maxIfNull
*
* @return string
*/
public function formatContainerOptions(string $type = 'css', bool $maxIfNull = false)
{
$options = '';
$height = ($maxIfNull && !$this->height) ? '100%' : $this->height;
$width = ($maxIfNull && !$this->width) ? '100%' : $this->width;
switch ($type) {
case 'css':
$options .= " style='";
(!$height) ?: $options .= "height: {$height}px !important;";
(!$width) ?: $options .= "width: {$width}px !important;";
$options .= "' ";
break;
case 'js':
if ($height) {
if (is_int($height)) {
$options .= "height: {$height}, ";
} else {
$options .= "height: '{$height}', ";
}
}
if ($width) {
if (is_int($width)) {
$options .= "width: {$width}, ";
} else {
$options .= "width: '{$width}', ";
}
}
break;
default:
(!$height) ?: $options .= " height='{$this->height}' ";
(!$this->width) ?: $options .= " width='{$this->width}' ";
}
return $options;
}
}
+59
View File
@@ -0,0 +1,59 @@
<?php
namespace ConsoleTVs\Charts\Classes\C3;
use ConsoleTVs\Charts\Classes\BaseChart;
use ConsoleTVs\Charts\Features\C3\Chart as ChartFeatures;
use Illuminate\Support\Collection;
class Chart extends BaseChart
{
use ChartFeatures;
/**
* C3 dataset class.
*
* @var object
*/
public $dataset = Dataset::class;
/**
* Initiates the C3 Line Chart.
*
* @return self
*/
public function __construct()
{
parent::__construct();
$this->container = 'charts::c3.container';
$this->script = 'charts::c3.script';
return $this;
}
/**
* Formats the datasets.
*
* @return void
*/
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(),
]);
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace ConsoleTVs\Charts\Classes\C3;
use ConsoleTVs\Charts\Classes\DatasetClass;
use ConsoleTVs\Charts\Features\C3\Dataset as DatasetFeatures;
class Dataset extends DatasetClass
{
use DatasetFeatures;
/**
* Creates a new dataset with the given values.
*
* @param string $name
* @param string $type
* @param array $values
*/
public function __construct(string $name, string $type, array $values)
{
parent::__construct($name, $type, $values);
}
/**
* Formats the dataset for chartjs.
*
* @return array
*/
public function format()
{
return array_merge([$this->name], $this->values);
}
}
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace ConsoleTVs\Charts\Classes\Chartjs;
use ConsoleTVs\Charts\Classes\BaseChart;
use ConsoleTVs\Charts\Features\Chartjs\Chart as ChartFeatures;
class Chart extends BaseChart
{
use ChartFeatures;
/**
* Chartjs dataset class.
*
* @var object
*/
public $dataset = Dataset::class;
/**
* Initiates the Chartjs Line Chart.
*
* @return self
*/
public function __construct()
{
parent::__construct();
$this->container = 'charts::chartjs.container';
$this->script = 'charts::chartjs.script';
return $this->options([
'maintainAspectRatio' => false,
'scales' => [
'xAxes' => [],
'yAxes' => [
[
'ticks' => [
'beginAtZero' => true,
],
],
],
],
]);
}
}
@@ -0,0 +1,41 @@
<?php
namespace ConsoleTVs\Charts\Classes\Chartjs;
use ConsoleTVs\Charts\Classes\DatasetClass;
use ConsoleTVs\Charts\Features\Chartjs\Dataset as DatasetFeatures;
class Dataset extends DatasetClass
{
use DatasetFeatures;
/**
* Creates a new dataset with the given values.
*
* @param string $name
* @param string $type
* @param array $values
*/
public function __construct(string $name, string $type, array $values)
{
parent::__construct($name, $type, $values);
$this->options([
'borderWidth' => 2,
]);
}
/**
* Formats the dataset for chartjs.
*
* @return array
*/
public function format()
{
return array_merge($this->options, [
'data' => $this->values,
'label' => $this->name,
'type' => $this->type,
]);
}
}
+129
View File
@@ -0,0 +1,129 @@
<?php
namespace ConsoleTVs\Charts\Classes;
use Illuminate\Support\Collection;
class DatasetClass
{
/**
* Defines the name of the dataset.
*
* @var string
*/
public $name = 'Undefined';
/**
* Defines the dataset type.
*
* @var string
*/
public $type = '';
/**
* Stores the dataset values.
*
* @var array
*/
public $values = [];
/**
* Stores the dataset options.
*
* @var array
*/
public $options = [];
/**
* Defines the undefined color.
*
* @var string
*/
public $undefinedColor = '#22292F';
/**
* Creates a new dataset with the given values.
*
* @param string $name
* @param string $type
* @param array $values
*/
public function __construct(string $name, string $type, array $values)
{
$this->name = $name;
$this->type = $type;
$this->values = $values;
return $this;
}
/**
* Set the dataset type.
*
* @param string $type
*
* @return self
*/
public function type(string $type)
{
$this->type = $type;
return $this;
}
/**
* Set the dataset values.
*
* @param array|Collection $values
*
* @return self
*/
public function values($values)
{
if ($values instanceof Collection) {
$values = $values->toArray();
}
$this->values = $values;
return $this;
}
/**
* Set the dataset options.
*
* @param array|Collection $options
* @param bool $overwrite
*
* @return self
*/
public function options($options, bool $overwrite = false)
{
if ($overwrite) {
$this->options = $options;
} else {
$this->options = array_replace_recursive($this->options, $options);
}
return $this;
}
/**
* Matches the values of the dataset with the given number.
*
* @param int $values
* @param bool $strict
*
* @return void
*/
public function matchValues(int $values, bool $strict = false)
{
while (count($this->values) < $values) {
array_push($this->values, 0);
}
if ($strict) {
$this->values = array_slice($this->values, 0, $values);
}
}
}
+69
View File
@@ -0,0 +1,69 @@
<?php
namespace ConsoleTVs\Charts\Classes\Echarts;
use ConsoleTVs\Charts\Classes\BaseChart;
use ConsoleTVs\Charts\Features\Echarts\Chart as ChartFeatures;
class Chart extends BaseChart
{
use ChartFeatures;
/**
* Chartjs dataset class.
*
* @var object
*/
public $dataset = Dataset::class;
/**
* Store the theme for the chart.
*
* @var string
*/
public $theme = 'default';
/**
* Initiates the Chartjs Line Chart.
*
* @return self
*/
public function __construct()
{
parent::__construct();
$this->container = 'charts::echarts.container';
$this->script = 'charts::echarts.script';
return $this->options([
'legend' => [
'show' => true,
],
'tooltip' => [
'show' => true,
],
'xAxis' => [
'show' => true,
],
'yAxis' => [
'show' => true,
],
]);
}
/**
* Formats the options.
*
* @return self
*/
public function formatOptions(bool $strict = false, bool $noBraces = false)
{
$this->options([
'xAxis' => [
'data' => json_decode($this->formatLabels()),
],
]);
return parent::formatOptions($strict, $noBraces);
}
}
@@ -0,0 +1,67 @@
<?php
namespace ConsoleTVs\Charts\Classes\Echarts;
use ConsoleTVs\Charts\Classes\DatasetClass;
use ConsoleTVs\Charts\Features\Echarts\Dataset as DatasetFeatures;
use Illuminate\Support\Collection;
class Dataset extends DatasetClass
{
use DatasetFeatures;
/**
* Store the private datasets that contains a special formating.
*
* @var array
*/
public $specialDatasets = ['pie'];
/**
* Creates a new dataset with the given values.
*
* @param string $name
* @param string $type
* @param array $values
*/
public function __construct(string $name, string $type, array $values)
{
parent::__construct($name, $type, $values);
}
/**
* Formats the dataset for chartjs.
*
* @return array
*/
public function format(array $labels = [])
{
return array_merge($this->options, [
'data' => $this->getValues($labels),
'name' => $this->name,
'type' => strtolower($this->type),
]);
}
/**
* Get the formated values.
*
* @param array $labels
*
* @return array
*/
protected function getValues(array $labels)
{
if (in_array(strtolower($this->type), $this->specialDatasets)) {
return Collection::make($this->values)
->map(function ($value, $key) use ($labels) {
return [
'name' => $labels[$key],
'value' => $value,
];
})->toArray();
}
return $this->values;
}
}
+85
View File
@@ -0,0 +1,85 @@
<?php
namespace ConsoleTVs\Charts\Classes\Frappe;
use ConsoleTVs\Charts\Classes\BaseChart;
use ConsoleTVs\Charts\Features\Frappe\Chart as ChartFeatures;
class Chart extends BaseChart
{
use ChartFeatures;
/**
* Frappe dataset class.
*
* @var object
*/
public $dataset = Dataset::class;
/**
* Stores the default colors.
*
* @var array
*/
public $default_colors = [
'#E3342F', '#F6993F', '#FFED4A', '#38C172', '#4DC0B5', '#3490DC', '#6574CD', '#9561E2', '#F66D9B',
];
/**
* Determines the special charts.
*
* @var array
*/
public $special_datasets = [
'pie', 'percentage',
];
/**
* Initiates the Frappe Chart.
*
* @return self
*/
public function __construct()
{
parent::__construct();
$this->container = 'charts::frappe.container';
$this->script = 'charts::frappe.script';
return $this->options([
'barOptions' => [
'spaceRatio' => 0.75,
],
]);
}
/**
* Format the datasets.
*
* @param bool $strict
* @param bool $noBraces
*
* @return self
*/
public function formatOptions(bool $strict = false, bool $noBraces = false)
{
$colors = [];
$default = 0;
foreach ($this->datasets as $dataset) {
$color = $this->default_colors[$default];
if (array_key_exists('color', $dataset->options)) {
$color = $dataset->options['color'];
unset($dataset->options['color']);
} else {
$default++;
}
array_push($colors, $color);
}
$this->options([
'colors' => $colors,
]);
return parent::formatOptions($strict, $noBraces);
}
}
+39
View File
@@ -0,0 +1,39 @@
<?php
namespace ConsoleTVs\Charts\Classes\Frappe;
use ConsoleTVs\Charts\Classes\DatasetClass;
use ConsoleTVs\Charts\Features\Frappe\Dataset as DatasetFeatures;
class Dataset extends DatasetClass
{
use DatasetFeatures;
/**
* Creates a new dataset with the given values.
*
* @param string $name
* @param string $type
* @param array $values
*/
public function __construct(string $name, string $type, array $values)
{
parent::__construct($name, $type, $values);
$this->options([]);
}
/**
* Formats the dataset for chartjs.
*
* @return array
*/
public function format()
{
return array_merge($this->options, [
'values' => $this->values,
'name' => $this->name,
'chartType' => $this->type,
]);
}
}
@@ -0,0 +1,82 @@
<?php
namespace ConsoleTVs\Charts\Classes\Fusioncharts;
use ConsoleTVs\Charts\Classes\BaseChart;
use ConsoleTVs\Charts\Features\Fusioncharts\Chart as ChartFeatures;
use Illuminate\Support\Collection;
class Chart extends BaseChart
{
use ChartFeatures;
/**
* Chartjs dataset class.
*
* @var object
*/
public $dataset = Dataset::class;
/**
* Theese array stores the types that are maintained to fusioncharts.
*
* @var array
*/
public $keepType = ['pie2d', 'doughnut2d'];
/**
* Determines the combo type of chart.
*
* @var array
*/
public $comboType = 'mscombi2d';
/**
* Initiates the Chartjs Line Chart.
*
* @return self
*/
public function __construct()
{
parent::__construct();
$this->container = 'charts::fusioncharts.container';
$this->script = 'charts::fusioncharts.script';
return $this->options([
'bgColor' => '#ffffff',
'borderAlpha' => 0,
'canvasBorderAlpha' => 0,
'usePlotGradientColor' => false,
'plotBorderAlpha' => 0,
'divlineColor' => '#22292F',
'divLineIsDashed' => true,
'showAlternateHGridColor' => false,
'captionFontBold' => true,
'captionFontSize' => 14,
'subcaptionFontBold' => false,
'subcaptionFontSize' => 14,
'legendBorderAlpha' => 0,
'legendShadow' => 0,
'hoverfillcolor' => '#CCCCCC',
'piebordercolor' => '#FFFFFF',
'hoverfillcolor' => '#CCCCCC',
'use3DLighting' => false,
'showShadow' => false,
]);
}
/**
* Formats the labels for fusioncharts.
*
* @return string
*/
public function formatLabels()
{
return Collection::make($this->labels)
->map(function ($label) {
return ['label' => $label];
})
->toJson();
}
}
@@ -0,0 +1,98 @@
<?php
namespace ConsoleTVs\Charts\Classes\Fusioncharts;
use ConsoleTVs\Charts\Classes\DatasetClass;
use ConsoleTVs\Charts\Features\Fusioncharts\Dataset as DatasetFeatures;
use Illuminate\Support\Collection;
class Dataset extends DatasetClass
{
use DatasetFeatures;
/**
* Store the private datasets that contains a special formating.
*
* @var array
*/
public $specialDatasets = ['pie2d', 'doughnut2d'];
/**
* Creates a new dataset with the given values.
*
* @param string $name
* @param string $type
* @param array $values
*/
public function __construct(string $name, string $type, array $values)
{
parent::__construct($name, $type, $values);
}
/**
* Dataset representation.
*
* @var array
*/
public function format(array $labels = [])
{
return array_merge($this->options, [
'data' => $this->formatValues($labels),
'seriesName' => $this->name,
'renderAs' => strtolower($this->type),
]);
}
/**
* Formats the chart values.
*
* @param array $labels
*
* @return array
*/
protected function formatValues(array $labels)
{
$values = Collection::make($this->values);
if (in_array(strtolower($this->type), $this->specialDatasets)) {
$colors = $this->getColors($labels);
return $values->map(function ($value, $key) use ($colors, $labels) {
$val = [
'label' => $labels[$key],
'value' => $value,
];
if ($colors->count() > 0) {
$val['color'] = $colors->get($key);
}
return $val;
})->toArray();
}
return $values->map(function ($value) {
return [
'value' => $value,
];
})->toArray();
}
/**
* Get the chart colors.
*
* @param array $labels
*
* @return Collection
*/
protected function getColors(array $labels)
{
$colors = Collection::make(array_key_exists('color', $this->options) ? $this->options['color'] : []);
while ($colors->count() < count($labels)) {
$colors->push($this->undefinedColor);
}
return $colors;
}
}
@@ -0,0 +1,56 @@
<?php
namespace ConsoleTVs\Charts\Classes\Highcharts;
use ConsoleTVs\Charts\Classes\BaseChart;
use ConsoleTVs\Charts\Features\Highcharts\Chart as ChartFeatures;
class Chart extends BaseChart
{
use ChartFeatures;
/**
* Chartjs dataset class.
*
* @var object
*/
public $dataset = Dataset::class;
/**
* Initiates the Highcharts Line Chart.
*
* @return self
*/
public function __construct()
{
parent::__construct();
$this->container = 'charts::highcharts.container';
$this->script = 'charts::highcharts.script';
return $this->options([
'credits' => [
'enabled' => false,
],
'title' => [
'text' => null,
],
]);
}
/**
* Format the options for highcharts.
*
* @return string
*/
public function formatOptions(bool $strict = false, bool $noBraces = false)
{
$this->options([
'xAxis' => [
'categories' => json_decode($this->formatLabels()),
],
]);
return parent::formatOptions($strict, $noBraces);
}
}
@@ -0,0 +1,93 @@
<?php
namespace ConsoleTVs\Charts\Classes\Highcharts;
use ConsoleTVs\Charts\Classes\DatasetClass;
use ConsoleTVs\Charts\Features\Highcharts\Dataset as DatasetFeatures;
use Illuminate\Support\Collection;
class Dataset extends DatasetClass
{
use DatasetFeatures;
/**
* Store the private datasets that contains a special formating.
*
* @var array
*/
public $specialDatasets = ['pie'];
/**
* Creates a new dataset with the given values.
*
* @param string $name
* @param string $type
* @param array $values
*/
public function __construct(string $name, string $type, array $values)
{
parent::__construct($name, $type, $values);
}
/**
* Dataset representation.
*
* @var array
*/
public function format(array $labels = [])
{
return array_merge($this->options, [
'data' => $this->formatValues($labels),
'name' => $this->name,
'type' => strtolower($this->type),
]);
}
/**
* Formats the values.
*
* @param array $labels
*
* @return array
*/
protected function formatValues(array $labels)
{
if (in_array(strtolower($this->type), $this->specialDatasets)) {
$colors = $this->getColors($labels);
return Collection::make($this->values)
->map(function ($value, $key) use ($colors, $labels) {
$val = [
'name' => $labels[$key],
'y' => $value,
];
if ($colors->count() > 0) {
$val['color'] = $colors->get($key);
}
return $val;
})->toArray();
}
return $this->values;
}
/**
* Get the dataset colors;.
*
* @param array $labels
*
* @return Collection
*/
protected function getColors(array $labels)
{
$colors = Collection::make(array_key_exists('color', $this->options) ? $this->options['color'] : []);
while ($colors->count() < count($labels)) {
$colors->push($this->undefinedColor);
}
return $colors;
}
}
+3
View File
@@ -0,0 +1,3 @@
# Charts Classes
All the charts classes are located in this folder