|
@@ -6,6 +6,7 @@ import { Navbar } from '@d8d/mini-shared-ui-components/components/navbar'
|
|
|
import { ColumnChart } from '@d8d/mini-charts/components/ColumnChart'
|
|
import { ColumnChart } from '@d8d/mini-charts/components/ColumnChart'
|
|
|
import { BarChart } from '@d8d/mini-charts/components/BarChart'
|
|
import { BarChart } from '@d8d/mini-charts/components/BarChart'
|
|
|
import { PieChart } from '@d8d/mini-charts/components/PieChart'
|
|
import { PieChart } from '@d8d/mini-charts/components/PieChart'
|
|
|
|
|
+import { PieChartFCExample } from '@d8d/mini-charts/components/PieChartFCExample'
|
|
|
import { enterpriseStatisticsClient } from '../../api/enterpriseStatisticsClient'
|
|
import { enterpriseStatisticsClient } from '../../api/enterpriseStatisticsClient'
|
|
|
import type {
|
|
import type {
|
|
|
DisabilityTypeDistributionResponse,
|
|
DisabilityTypeDistributionResponse,
|
|
@@ -323,13 +324,6 @@ const Statistics: React.FC<StatisticsProps> = () => {
|
|
|
series={convertToPieData(ageStats)}
|
|
series={convertToPieData(ageStats)}
|
|
|
config={{
|
|
config={{
|
|
|
color: ['#3b82f6', '#10b981', '#f59e0b', '#8b5cf6', '#ef4444'],
|
|
color: ['#3b82f6', '#10b981', '#f59e0b', '#8b5cf6', '#ef4444'],
|
|
|
- fontSize: 10,
|
|
|
|
|
- dataLabel: true,
|
|
|
|
|
- legend: { show: true }
|
|
|
|
|
- }}
|
|
|
|
|
- tooltipFormatter={(item: any) => {
|
|
|
|
|
- const statItem = ageStats.find(s => s.key === item.name)
|
|
|
|
|
- return `${item.name} ${item.data}人 (${statItem?.percentage || 0}%)`
|
|
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
</View>
|
|
</View>
|
|
@@ -358,14 +352,6 @@ const Statistics: React.FC<StatisticsProps> = () => {
|
|
|
series={chartData.series}
|
|
series={chartData.series}
|
|
|
config={{
|
|
config={{
|
|
|
color: ['#3b82f6', '#10b981', '#f59e0b', '#8b5cf6', '#ef4444', '#ec4899'],
|
|
color: ['#3b82f6', '#10b981', '#f59e0b', '#8b5cf6', '#ef4444', '#ec4899'],
|
|
|
- fontSize: 10,
|
|
|
|
|
- dataLabel: true,
|
|
|
|
|
- xAxis: { disableGrid: true },
|
|
|
|
|
- yAxis: {}
|
|
|
|
|
- }}
|
|
|
|
|
- tooltipFormatter={(item: any, category: string) => {
|
|
|
|
|
- const statItem = stats.find(s => s.key === category)
|
|
|
|
|
- return `${category} ${item.data}人 (${statItem?.percentage || 0}%)`
|
|
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
</View>
|
|
</View>
|
|
@@ -423,14 +409,6 @@ const Statistics: React.FC<StatisticsProps> = () => {
|
|
|
series={chartData.series}
|
|
series={chartData.series}
|
|
|
config={{
|
|
config={{
|
|
|
color: ['#3b82f6', '#10b981', '#f59e0b', '#8b5cf6', '#ef4444'],
|
|
color: ['#3b82f6', '#10b981', '#f59e0b', '#8b5cf6', '#ef4444'],
|
|
|
- fontSize: 10,
|
|
|
|
|
- dataLabel: true,
|
|
|
|
|
- xAxis: { disableGrid: true },
|
|
|
|
|
- yAxis: {}
|
|
|
|
|
- }}
|
|
|
|
|
- tooltipFormatter={(item: any, category: string) => {
|
|
|
|
|
- const statItem = stats.find(s => s.key === category)
|
|
|
|
|
- return `${category} ${item.data}人 (${statItem?.percentage || 0}%)`
|
|
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
</View>
|
|
</View>
|
|
@@ -441,6 +419,18 @@ const Statistics: React.FC<StatisticsProps> = () => {
|
|
|
})()}
|
|
})()}
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
|
|
+ {/* PieChartFCExample 测试组件 */}
|
|
|
|
|
+ <View className="card bg-white p-4 mb-4 rounded-lg shadow-sm flex flex-col">
|
|
|
|
|
+ <Text className="font-semibold text-gray-700">饼图示例测试 (PieChartFCExample)</Text>
|
|
|
|
|
+ <View className="mt-3">
|
|
|
|
|
+ <PieChartFCExample
|
|
|
|
|
+ canvasId="pie-chart-fc-example-test"
|
|
|
|
|
+ width={650}
|
|
|
|
|
+ height={400}
|
|
|
|
|
+ />
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+
|
|
|
</ScrollView>
|
|
</ScrollView>
|
|
|
</YongrenTabBarLayout>
|
|
</YongrenTabBarLayout>
|
|
|
)
|
|
)
|