Closed AshishGupta001 closed 7 years ago
The idea is to have as many datasets want to have and just setting the colors in chartjs.php. In fact, if I have 5 datasets and have only added three colors, the last two will have a problem. Your code is fine, the only problem is that little is configurable for other users. This can be a solution only if the number of colors is less than the number of datasets.
You already contribiu with any open source project? You can send me a Pull Request and I do merge their code. It would be the same, just implementing the random color if there is no defined color.
Send a Pull Request will be better because it will keep your name on the script and will serve as an incentive for contributions in other projects. Leave their signatures on their solutions!
Thanks for feedback!
Thanks Felix. That's very thoughtful of you. Would LOVE to collaborate with you and contribute in the laravel-chartjs project.
Right now I am tying some loose ends for the app I was working on (had to deploy for demo purpose). Once done I will send a pull request and maybe enhance the current implementation.
BTW I opened one other issue #4 which seems you are currently developing. Wondering whether you can share some timeline when it will be available.
Thanks Ashish
On Thu, Feb 11, 2016 at 9:17 AM, Felix Costa notifications@github.com wrote:
The idea is to have as many datasets want to have and just setting the colors in chartjs.php. In fact, if I have 5 datasets and have only added three colors, the last two will have a problem. Your code is fine, the only problem is that little is configurable for other users. This can be a solution only if the number of colors is less than the number of datasets.
You already contribiu with any open source project? You can send me a Pull Request and I do merge their code. It would be the same, just implementing the random color if there is no defined color.
Send a Pull Request will be better because it will keep your name on the script and will serve as an incentive for contributions in other projects. Leave their signatures on their solutions!
Thanks for feedback!
— Reply to this email directly or view it on GitHub https://github.com/fxcosta/laravel-chartjs/issues/5#issuecomment-182690867 .
Wow, finally new version is coming! :D
Hello! i found $this->colours = config('chartjs.colours') in ChartjsServiceProvider How can i use auto color?
In current impl, number of datasets in any chart is limited to just 3. This seems is due to the colours[] array defined in config/chart.js.
I have workedaround this issue by generating the colors for each dataset at run time. Thought this could be useful to other users of laravel-chartjs. Feel free to use the code below. Note: I have not done extensive testing but it seems to work for me.
/resources/ChartBar.php (within method 'render')