@@ -82,6 +82,41 @@ export const XAxisDirectionOptions = [
82
82
83
83
export type XAxisDirectionType = ValueFromOption < typeof XAxisDirectionOptions > ;
84
84
85
+ // Add this new code block:
86
+ // Realistic pie chart demo data with proper categories and values
87
+ export const defaultPieChartData = [
88
+ {
89
+ category : "Market Share" ,
90
+ name : "Samsung" ,
91
+ value : 21.8
92
+ } ,
93
+ {
94
+ category : "Market Share" ,
95
+ name : "Apple" ,
96
+ value : 20.5
97
+ } ,
98
+ {
99
+ category : "Market Share" ,
100
+ name : "Xiaomi" ,
101
+ value : 13.4
102
+ } ,
103
+ {
104
+ category : "Market Share" ,
105
+ name : "Oppo" ,
106
+ value : 8.8
107
+ } ,
108
+ {
109
+ category : "Market Share" ,
110
+ name : "Vivo" ,
111
+ value : 8.1
112
+ } ,
113
+ {
114
+ category : "Market Share" ,
115
+ name : "Others" ,
116
+ value : 27.4
117
+ }
118
+ ] ;
119
+
85
120
export const noDataAxisConfig = {
86
121
animation : false ,
87
122
xAxis : {
@@ -241,8 +276,8 @@ export type CharOptionCompType = keyof typeof ChartOptionMap;
241
276
242
277
export const chartUiModeChildren = {
243
278
title : withDefault ( StringControl , trans ( "echarts.defaultTitle" ) ) ,
244
- data : jsonControl ( toJSONObjectArray , i18nObjs . defaultDataSource ) ,
245
- xAxisKey : valueComp < string > ( "" ) , // x-axis, key from data
279
+ data : jsonControl ( toJSONObjectArray , defaultPieChartData ) ,
280
+ xAxisKey : valueComp < string > ( "name " ) ,
246
281
xAxisDirection : dropdownControl ( XAxisDirectionOptions , "horizontal" ) ,
247
282
xAxisData : jsonControl ( toArray , [ ] ) ,
248
283
series : SeriesListComp ,
0 commit comments