asantibanez / livewire-charts

Neat Livewire Charts for your Laravel projects
MIT License
805 stars 120 forks source link

pieChartModel with values instead of percentages #74

Open pdesena opened 2 years ago

pdesena commented 2 years ago

Hello there.

What a practical and functional tool. I have an issue that I need to resolve. In the Pie chart, withDataLabels() presents the percentages. Is there a way to show the values or amounts received in each addSlice($value...) instead of percentages?

I have searched in the models, and in livewire-charts/app.js but I can't find where to configure it. I hope you can help me.

Grettings and thank you for the support

image
ESCALOS commented 1 year ago

Modify the file public/vendor/livewire-charts/app.js in {key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t){return t.Fixed(1)+"%"} by {key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t,opts){return opts.w.config.series[opts.seriesIndex]}