ArielMejiaDev / larapex-charts

A Laravel wrapper for apex charts
https://larapex-charts.netlify.app/
MIT License
284 stars 84 forks source link

Adding support for Sparklines chart type #57

Closed jamesmills closed 1 year ago

jamesmills commented 2 years ago

Following on from this thread on Twitter .

These are the bad boys I'm looking for!

https://apexcharts.com/javascript-chart-demos/sparklines/basic/ https://apexcharts.com/javascript-chart-demos/dashboards/modern/

At first look I think we can just create a new chart type class but I'm not sure, I'm going to take a look this week.

jamesmills commented 2 years ago

So it looks like in the scrip.blade.php file if you add the sparkline enabled flag this automatically works.

chart: {
            type: '{!! $chart->type() !!}',
            ...
            foreColor: '{!! $chart->foreColor() !!}',
            sparkline: {
                enabled: true
            },
        },

So now I'll investigate if we can add something like a setSparkline() or similar on the ArielMejiaDev\LarapexCharts\LarapexChart class.

Then update the script.blade.php file to include this if enabled.

Just need to investigate what needs to be done for the other implementations like Vue etc. Looks like we need to update the toJson() function to check if Sparkline is enabled.

jamesmills commented 2 years ago

@ArielMejiaDev if I look at PR'ing this would it make it into prod or would we have to wait for a new version?

ArielMejiaDev commented 1 year ago

Sorry for the delay @jamesmills I had been busy, your contributions are awesome, your PR was added in the 4.x release, I add a new release 5.0.0 it resolves some issues related to publish unnecessary files.