简体   繁体   中英

React apex pie chart not showing label

I am trying to plot a series using a pie/radial chart to react. As per the documentation, I am passing the showAlways: true property that keeps showing a certain value in the middle of the chart even when the cursor is hovered or not hovered over the radial area.

But the following property does not seem to work in my case. Here is the link to the working snippet.

https://codesandbox.io/s/amazing-violet-wrp7y

I am not sure what's going wrong with the code here. Any help to resolve the same.

Your total.formatter function was not returning after calculating the total.

Here is the updated code

formatter(w) {
  return w.globals.seriesTotals.reduce((a, b) => a + b, 0)
}

Updated CodeSandbox

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM