fix: 饼图、词云图、雷达图优化默认数据

main
hong.yang
parent d3188aa672
commit bb5ba79e4e

@ -163,14 +163,12 @@ const setting = [
// 模拟数据
const data = [
{ name: 'X6', star: 297 },
{ name: 'G', star: 506 },
{ name: 'AVA', star: 805 },
{ name: 'G2Plot', star: 1478 },
{ name: 'L7', star: 2029 },
{ name: 'G6', star: 7100 },
{ name: 'F2', star: 7346 },
{ name: 'G2', star: 10178 },
{ type: '分类一', value: 27 },
{ type: '分类二', value: 25 },
{ type: '分类三', value: 18 },
{ type: '分类四', value: 15 },
{ type: '分类五', value: 10 },
{ type: '其他', value: 5 }
]
const optionHandler = `
@ -190,13 +188,13 @@ const option = {
// 图表内边距
appendPadding: [0, 0, 0, 0],
data,
xField: 'name',
yField: 'star',
xField: 'type',
yField: 'value',
startAngle: - Math.PI / 2, // 起始角度
maxAngle: 270, //最大旋转角度,
radius: 0.8,
color: [],
colorField: 'name',
colorField: 'type',
innerRadius: 0.2,
barStyle: {
lineCap: 'round', // 可选项round 和 square

@ -1,6 +1,6 @@
// 配置版本号
const version = '2023111401'
const version = '2023111501'
// 分类
const category = 'WordCloud'
// 标题
@ -70,7 +70,7 @@ const setting = [
type: 'inputNumber',
field: 'fontSizeMin',
optionField: 'fontSizeMin',
value: 24,
value: 18,
tabName: 'custom',
groupName: 'graph'
},
@ -79,7 +79,7 @@ const setting = [
type: 'inputNumber',
field: 'fontSizeMax',
optionField: 'fontSizeMax',
value: 80,
value: 60,
tabName: 'custom',
groupName: 'graph'
},
@ -96,514 +96,50 @@ const setting = [
}
]
// 模拟数据
const data = [
{
x: 'China',
value: 1383220000,
category: 'asia'
},
{
x: 'India',
value: 1316000000,
category: 'asia'
},
{
x: 'United States',
value: 324982000,
category: 'america'
},
{
x: 'Indonesia',
value: 263510000,
category: 'asia'
},
{
x: 'Brazil',
value: 207505000,
category: 'america'
},
{
x: 'Pakistan',
value: 196459000,
category: 'asia'
},
{
x: 'Nigeria',
value: 191836000,
category: 'africa'
},
{
x: 'Bangladesh',
value: 162459000,
category: 'asia'
},
{
x: 'Russia',
value: 146804372,
category: 'europe'
},
{
x: 'Japan',
value: 126790000,
category: 'asia'
},
{
x: 'Mexico',
value: 123518000,
category: 'america'
},
{
x: 'Ethiopia',
value: 104345000,
category: 'africa'
},
{
x: 'Philippines',
value: 104037000,
category: 'asia'
},
{
x: 'Egypt',
value: 93013300,
category: 'africa'
},
{
x: 'Vietnam',
value: 92700000,
category: 'asia'
},
{
x: 'Germany',
value: 82800000,
category: 'europe'
},
{
x: 'Democratic Republic of the Congo',
value: 82243000,
category: 'africa'
},
{
x: 'Iran',
value: 80135400,
category: 'asia'
},
{
x: 'Turkey',
value: 79814871,
category: 'asia'
},
{
x: 'Thailand',
value: 68298000,
category: 'asia'
},
{
x: 'France',
value: 67013000,
category: 'europe'
},
{
x: 'United Kingdom',
value: 65110000,
category: 'europe'
},
{
x: 'Italy',
value: 60599936,
category: 'europe'
},
{
x: 'Tanzania',
value: 56878000,
category: 'africa'
},
{
x: 'South Africa',
value: 55908000,
category: 'africa'
},
{
x: 'Myanmar',
value: 54836000,
category: 'asia'
},
{
x: 'South Korea',
value: 51446201,
category: 'asia'
},
{
x: 'Colombia',
value: 49224700,
category: 'america'
},
{
x: 'Kenya',
value: 48467000,
category: 'africa'
},
{
x: 'Spain',
value: 46812000,
category: 'europe'
},
{
x: 'Argentina',
value: 43850000,
category: 'america'
},
{
x: 'Ukraine',
value: 42541633,
category: 'europe'
},
{
x: 'Sudan',
value: 42176000,
category: 'africa'
},
{
x: 'Uganda',
value: 41653000,
category: 'africa'
},
{
x: 'Algeria',
value: 41064000,
category: 'africa'
},
{
x: 'Poland',
value: 38424000,
category: 'europe'
},
{
x: 'Iraq',
value: 37883543,
category: 'asia'
},
{
x: 'Canada',
value: 36541000,
category: 'america'
},
{
x: 'Morocco',
value: 34317500,
category: 'africa'
},
{
x: 'Saudi Arabia',
value: 33710021,
category: 'asia'
},
{
x: 'Uzbekistan',
value: 32121000,
category: 'asia'
},
{
x: 'Malaysia',
value: 32063200,
category: 'asia'
},
{
x: 'Peru',
value: 31826018,
category: 'america'
},
{
x: 'Venezuela',
value: 31431164,
category: 'america'
},
{
x: 'Nepal',
value: 28825709,
category: 'asia'
},
{
x: 'Angola',
value: 28359634,
category: 'africa'
},
{
x: 'Ghana',
value: 28308301,
category: 'africa'
},
{
x: 'Yemen',
value: 28120000,
category: 'asia'
},
{
x: 'Afghanistan',
value: 27657145,
category: 'asia'
},
{
x: 'Mozambique',
value: 27128530,
category: 'africa'
},
{
x: 'Australia',
value: 24460900,
category: 'australia'
},
{
x: 'North Korea',
value: 24213510,
category: 'asia'
},
{
x: 'Cameroon',
value: 23248044,
category: 'africa'
},
{
x: 'Ivory Coast',
value: 22671331,
category: 'africa'
},
{
x: 'Madagascar',
value: 22434363,
category: 'africa'
},
{
x: 'Niger',
value: 21564000,
category: 'africa'
},
{
x: 'Sri Lanka',
value: 21203000,
category: 'asia'
},
{
x: 'Romania',
value: 19760000,
category: 'europe'
},
{
x: 'Burkina Faso',
value: 19632147,
category: 'africa'
},
{
x: 'Syria',
value: 18907000,
category: 'asia'
},
{
x: 'Mali',
value: 18875000,
category: 'africa'
},
{
x: 'Malawi',
value: 18299000,
category: 'africa'
},
{
x: 'Chile',
value: 18191900,
category: 'america'
},
{
x: 'Kazakhstan',
value: 17975800,
category: 'asia'
},
{
x: 'Netherlands',
value: 17121900,
category: 'europe'
},
{
x: 'Ecuador',
value: 16737700,
category: 'america'
},
{
x: 'Guatemala',
value: 16176133,
category: 'america'
},
{
x: 'Zambia',
value: 15933883,
category: 'africa'
},
{
x: 'Cambodia',
value: 15626444,
category: 'asia'
},
{
x: 'Senegal',
value: 15256346,
category: 'africa'
},
{
x: 'Chad',
value: 14965000,
category: 'africa'
},
{
x: 'Zimbabwe',
value: 14542235,
category: 'africa'
},
{
x: 'Guinea',
value: 13291000,
category: 'africa'
},
{
x: 'South Sudan',
value: 12131000,
category: 'africa'
},
{
x: 'Rwanda',
value: 11553188,
category: 'africa'
},
{
x: 'Belgium',
value: 11356191,
category: 'europe'
},
{
x: 'Tunisia',
value: 11299400,
category: 'africa'
},
{
x: 'Cuba',
value: 11239004,
category: 'america'
},
{
x: 'Bolivia',
value: 11145770,
category: 'america'
},
{
x: 'Somalia',
value: 11079000,
category: 'africa'
},
{
x: 'Haiti',
value: 11078033,
category: 'america'
},
{
x: 'Greece',
value: 10783748,
category: 'europe'
},
{
x: 'Benin',
value: 10653654,
category: 'africa'
},
{
x: 'Czech Republic',
value: 10578820,
category: 'europe'
},
{
x: 'Portugal',
value: 10341330,
category: 'europe'
},
{
x: 'Burundi',
value: 10114505,
category: 'africa'
},
{
x: 'Dominican Republic',
value: 10075045,
category: 'america'
},
{
x: 'Sweden',
value: 10054100,
category: 'europe'
},
{
x: 'United Arab Emirates',
value: 10003223,
category: 'asia'
},
{
x: 'Jordan',
value: 9889270,
category: 'asia'
},
{
x: 'Azerbaijan',
value: 9823667,
category: 'asia'
},
{
x: 'Hungary',
value: 9799000,
category: 'europe'
},
{
x: 'Belarus',
value: 9498600,
category: 'europe'
},
{
x: 'Honduras',
value: 8866351,
category: 'america'
},
{
x: 'Austria',
value: 8773686,
category: 'europe'
},
{
x: 'Tajikistan',
value: 8742000,
category: 'asia'
},
{
x: 'Israel',
value: 8690220,
category: 'asia'
},
{
x: 'Switzerland',
value: 8417700,
category: 'europe'
},
{
x: 'Papua New Guinea',
value: 8151300,
category: 'australia'
}
{ name: '大屏设计器', value: 9900 },
{ name: '折线图', value: 6181 },
{ name: '柱状图', value: 4386 },
{ name: '饼图', value: 4055 },
{ name: '散点图', value: 2467 },
{ name: '雷达图', value: 2244 },
{ name: '树图', value: 1898 },
{ name: '面积图', value: 1484 },
{ name: '地图', value: 1112 },
{ name: '热力图', value: 965 },
{ name: '仪表盘', value: 847 },
{ name: '漏斗图', value: 582 },
{ name: '进度条', value: 555 },
{ name: '环图', value: 550 },
{ name: '玉珏图', value: 462 },
{ name: '词云', value: 366 },
{ name: '3D组件', value: 360 },
{ name: '边框', value: 282 },
{ name: '装饰', value: 273 },
{ name: '自定义组件', value: 1265 },
{ name: '文本', value: 6181 },
{ name: '数字', value: 4386 },
{ name: '超链接', value: 1222 },
{ name: '图片', value: 2438 },
{ name: '视频', value: 1361 },
{ name: '表格', value: 9876 },
{ name: '排名', value: 1112 },
{ name: '轮播', value: 965 },
{ name: '时间', value: 2847 },
{ name: '跑马灯', value: 582 },
{ name: '指标卡', value: 555 }
]
// 配置处理脚本
const optionHandler = 'option.wordStyle.fontSize = [option.fontSizeMin, option.fontSizeMax]'
// 数据处理脚本
const dataHandler = 'let wordFieldValue = setting.find(settingItem=>settingItem.field === \'wordField\').value\n' +
const optionHandler = 'option.wordStyle.fontSize = [option.fontSizeMin, option.fontSizeMax]\n' +
'let wordFieldValue = setting.find(settingItem=>settingItem.field === \'wordField\').value\n' +
'if (wordFieldValue) {\n' +
' option.colorField = wordFieldValue\n' +
'}'
// 数据处理脚本
const dataHandler = ''
// 图表配置 new Line('domName', option)
const option = {
// 数据将要放入到哪个字段中
@ -611,13 +147,13 @@ const option = {
// 图表内边距
appendPadding: [0, 0, 0, 0],
data,
wordField: 'x',
wordField: 'name',
weightField: 'value',
colorField: 'category',
colorField: 'name',
color: ['#6b74e4', '#4391f4', '#38bbe5', '#69d6fd', '#36c6a0'],
wordStyle: {
fontFamily: 'Verdana',
fontSize: [24, 80]
fontSize: [12, 60]
},
fontSizeMin: 24,
fontSizeMax: 80,

@ -1,6 +1,6 @@
// 配置版本号
const version = '2023111401'
const version = '2023111501'
// 分类
const category = 'Radar'
// 标题
@ -231,6 +231,15 @@ const setting = [
tabName: 'custom',
groupName: 'legend'
},
{
label: 'y轴最小值',
type: 'inputNumber',
field: 'yAxis_min',
optionField: 'yAxis.min',
value: 0,
tabName: 'custom',
groupName: 'yAxis'
},
// 内边距 appendPadding
{
label: '',
@ -245,28 +254,17 @@ const setting = [
// 模拟数据
const data = [
{ item: 'Design', user: 'a', score: 70 },
{ item: 'Design', user: 'b', score: 30 },
{ item: 'Development', user: 'a', score: 60 },
{ item: 'Development', user: 'b', score: 70 },
{ item: 'Marketing', user: 'a', score: 50 },
{ item: 'Marketing', user: 'b', score: 60 },
{ item: 'Users', user: 'a', score: 40 },
{ item: 'Users', user: 'b', score: 50 },
{ item: 'Test', user: 'a', score: 60 },
{ item: 'Test', user: 'b', score: 70 },
{ item: 'Language', user: 'a', score: 70 },
{ item: 'Language', user: 'b', score: 50 },
{ item: 'Technology', user: 'a', score: 50 },
{ item: 'Technology', user: 'b', score: 40 },
{ item: 'Support', user: 'a', score: 30 },
{ item: 'Support', user: 'b', score: 40 },
{ item: 'Sales', user: 'a', score: 60 },
{ item: 'Sales', user: 'b', score: 40 },
{ item: 'UX', user: 'a', score: 50 },
{ item: 'UX', user: 'b', score: 60 }
{ name: '支撑及时性', star: 300, type: '当前得分' },
{ name: '基本能力', star: 450, type: '当前得分' },
{ name: '支撑规范性', star: 200, type: '当前得分' },
{ name: '满意度', star: 420, type: '当前得分' },
{ name: '工作质量', star: 380, type: '当前得分' },
{ name: '支撑及时性', star: 380, type: '平均得分' },
{ name: '基本能力', star: 420, type: '平均得分' },
{ name: '支撑规范性', star: 300, type: '平均得分' },
{ name: '满意度', star: 350, type: '平均得分' },
{ name: '工作质量', star: 400, type: '平均得分' }
]
// 配置处理脚本
const optionHandler = 'option.legend = option.legendEnable ? {position: setting.find(settingItem=>settingItem.field === \'legendPosition\').value} : false;' +
'\n if (option.legendEnable) {\n' +
@ -284,9 +282,9 @@ const option = {
appendPadding: [0, 0, 0, 0],
renderer: 'canvas',
data,
xField: 'item',
yField: 'score',
seriesField: 'user',
xField: 'name',
yField: 'star',
seriesField: 'type',
legendEnable: false,
legendLayout: 'vertical',
legendPosition: 'top',
@ -325,6 +323,7 @@ const option = {
size: 2
},
yAxis: {
min: 0,
label: false,
grid: {
alternateColor: 'rgba(0, 0, 0, 0.04)'

@ -1,6 +1,6 @@
// 配置版本号
const version = '2023111401'
const version = '2023111501'
// 分类
const category = 'Radar'
// 标题
@ -214,6 +214,15 @@ const setting = [
tabName: 'custom',
groupName: 'grid'
},
{
label: 'y轴最小值',
type: 'inputNumber',
field: 'yAxis_min',
optionField: 'yAxis.min',
value: 0,
tabName: 'custom',
groupName: 'yAxis'
},
// 内边距 appendPadding
{
label: '',
@ -228,13 +237,11 @@ const setting = [
// 模拟数据
const data = [
{ name: 'G2', star: 10371 },
{ name: 'G6', star: 7380 },
{ name: 'F2', star: 7414 },
{ name: 'L7', star: 2140 },
{ name: 'X6', star: 660 },
{ name: 'AVA', star: 885 },
{ name: 'G2Plot', star: 1626 }
{ name: '支撑及时性', star: 300 },
{ name: '基本能力', star: 450 },
{ name: '支撑规范性', star: 200 },
{ name: '满意度', star: 420 },
{ name: '工作质量', star: 380 },
]
// 配置处理脚本
@ -290,6 +297,7 @@ const option = {
yAxis: {
// line: null,
tickLine: null,
min: 0,
label: false,
grid: {
line: {

@ -270,6 +270,10 @@ const option = {
}
},
color: ['#6b74e4', '#4391f4', '#38bbe5', '#69d6fd', '#36c6a0'],
pieStyle: {
stroke: '#000000',
lineWidth: 0
},
label: {
autoRotate: true,
type: 'inner',

Loading…
Cancel
Save