st-comp 0.0.27 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "st-comp",
3
3
  "public": true,
4
- "version": "0.0.27",
4
+ "version": "0.0.29",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -101,7 +101,7 @@
101
101
  formatter: (name: string) => {
102
102
  const item: any = props.data.find((i: any) => i.name === name)
103
103
  return `${name}
104
- ${item.value}(${round(multiply(divide(item.value, total), 100))}%)`
104
+ ${item.label || item.value}(${typeof item.percent === 'number' ? item.percent : round(multiply(divide(item.value, total), 100))}%)`
105
105
  }
106
106
  },
107
107
  series: [
@@ -120,7 +120,7 @@ ${item.value}(${round(multiply(divide(item.value, total), 100))}%)`
120
120
  label: {
121
121
  show: true,
122
122
  position: 'inside',
123
- formatter: (info: any) => info.value,
123
+ formatter: (info: any) => info?.data?.label || info.value,
124
124
  fontSize: 14,
125
125
  color: '#000',
126
126
  },