diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e718b2a..72b1cfad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,25 @@ +- 3.1.9 + - Fixing bug where using `setOptions` instead of the constructor skipped the processing of `png` and `material` attributes. + +- 3.1.8 + - Production build of the Lava.js module. + +- 3.1.7 + - Added the tag lavacharts to the config publishing. + Use `php artisan vendor:publish --tag=lavacharts` + If that does not work, try to clear the cache with `php artisan config:clear` and re-publish with `--force`. + +- 3.1.6 + - The event callback within lava.js was modified to pass back the chart and the datatable so users can interact with either during an event. This solves issue [#203](https://github.com/kevinkhill/lavacharts/issues/203) + +- 3.1.5 + - Adding DonutChart alias class back + +- 3.1.4 + - Chart's should resize properly on page resize. + - 3.1.3 + - Adding support for date columns to be null which enables support for Gantt charts to have linked sections. - Adding JavascriptDate class that mimics the way the Javascript Date object is created. (I wanted to be able to copy and paste google's examples into addRows) - 3.1.1 & 3.1.2 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 00000000..54f03c40 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,14 @@ +# Contributors + +Thank you for finding bugs, helping me fix them, pull requests, issues and anything else. + + - [deringer](https://github.com/deringer) + - [MicahKV](micah138@yahoo.com) + - [rajivseelam](https://github.com/rajivseelam) + - [SendDerek](https://github.com/SendDerek) + - [stevebauman](https://github.com/stevebauman) + - [Stonos](https://github.com/Stonos) + - [tobias-kuendig](https://github.com/tobias-kuendig) + - [twify93](https://github.com/twify93) + +If your name is not on this list and needs to be, I'm sorry! Please add it in a pull request and I will merge it in. diff --git a/README.md b/README.md index 41117750..616aafbc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Lavacharts 3.1.8 +# Lavacharts 3.1.9 [![Total Downloads](https://img.shields.io/packagist/dt/khill/lavacharts.svg?style=plastic)](https://packagist.org/packages/khill/lavacharts) [![License](https://img.shields.io/packagist/l/khill/lavacharts.svg?style=plastic)](http://opensource.org/licenses/MIT) @@ -59,7 +59,11 @@ If you are using Lavacharts with Silex, Lumen or your own Composer project, that ## Laravel To integrate Lavacharts into Laravel, a ServiceProvider has been included. -### Laravel 5.x +### Laravel ~5.5 +Thanks to the fantastic new [Package Auto-Discovery](https://laravel-news.com/package-auto-discovery) feature added in 5.5, you're ready to go, no extra configuration required :) + + +### Laravel ~5.4 Register Lavacharts in your app by adding these lines to the respective arrays found in `config/app.php`: ```php elementId = new ElementId($options['elementId']); } + + $this->setExtendedAttributes(); } + /** + * Set extended chart attributes from the assigned options, if present. + * + * @since 3.1.9 + */ + protected function setExtendedAttributes() + { + if (method_exists($this, 'setPngOutput') && + array_key_exists('png', $this->options)) + { + $this->setPngOutput($this->options['png']); + + unset($this->options['png']); + } + + if (method_exists($this, 'setMaterialOutput') && + array_key_exists('material', $this->options)) + { + $this->setMaterialOutput($this->options['material']); + + unset($this->options['material']); + } + } + + /** * Returns the chart type. * diff --git a/src/Support/Customizable.php b/src/Support/Customizable.php index 47cb7807..291048b9 100644 --- a/src/Support/Customizable.php +++ b/src/Support/Customizable.php @@ -59,20 +59,30 @@ public function __call($method, $arg) * * @param string $option * @param mixed $value + * @return self */ public function setOption($option, $value) { $this->options[$option] = $value; + + return $this; } /** * Sets the values of the customized class with an array of key value pairs. * * @param array $options + * @return self */ public function setOptions(array $options) { $this->options = $options; + + if (method_exists($this, 'setExtendedAttributes')) { + $this->setExtendedAttributes(); + } + + return $this; } /** @@ -80,10 +90,13 @@ public function setOptions(array $options) * * @since 3.0.5 * @param array $options + * @return self */ public function mergeOptions(array $options) { $this->options = array_merge($this->options, $options); + + return $this; } /**