vue-apexcharts icon indicating copy to clipboard operation
vue-apexcharts copied to clipboard

Formatter of donut labels

Open ARM128bit opened this issue 3 years ago • 3 comments

Good day! When I am trying to split a name of a donut label by a space like on a screenshot below image I get a successful label of donut, line breaks works fine image But when I focus or click to another part of a donut I get a comma between words something like below: image

As a result, line breaks works fine at the first mount.

Best regards, Yuri

ARM128bit avatar Feb 17 '22 14:02 ARM128bit

hey, could you help me get the entity value as lables value? something like this? for example in this they have made number of entities to show in center label value but dont know how to add this in code to get the same result
image

      donut:
        labels:
          show: true
          total:
            show: true
            label: Total
            formatter: |
              EVAL:function(w) {
                return {{states('sensor.processor_use')}} 
                }

itsboo07 avatar Sep 17 '22 21:09 itsboo07

hey, could you help me get the entity value as lables value? something like this? for example in this they have made number of entities to show in center label value but dont know how to add this in code to get the same result image

      donut:
        labels:
          show: true
          total:
            show: true
            label: Total
            formatter: |
              EVAL:function(w) {
                return {{states('sensor.processor_use')}} 
                }

Hi, You can see below an example formatter function where is going calculation of values image

formatter: function(w) { const total = w.globals.seriesTotals.reduce((a, b) => { return a + b; }, 0); return parseFloat(total).toLocaleString(); },

ARM128bit avatar Oct 26 '22 05:10 ARM128bit

I have the same issue as @ARM128bit - can someone help ?

tmcdos avatar Sep 28 '23 13:09 tmcdos