ui Chart PIEFeature
# ui.Chart.PIEFeature
# ui.Chart.PIEFeature.byProperty
通过制定矢量数据的属性property绘制
函数 | 返回值 |
---|---|
ui.Chart.PIEFeature.byProperty(feature,xProperty,seriesProperty) | ui.Chart.PIEFeature.byProperty |
参数 | 类型 | 说明 |
---|---|---|
feature | Object|List | feature、featureCollection、list、矢量数据或者列表 |
xProperty | String|List | 字符串、x轴参数(矢量数据的属性) |
seriesProperty | String | 分组依据的属性名称 |
var fCol = pie.FeatureCollection([
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '一季度',
a: 10,
b: 12.1,
c: 20
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '二季度',
a: 21,
b: 9,
c: 10
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '三季度',
a: 13,
b: 5.1,
c: 8
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '四季度',
a: 7,
b: 9.1,
c: 13
})
]);
var chart = ui.Chart.PIEFeature.byProperty({
features: fCol,
seriesProperty: "label",
xProperties: ["a", 'c']
}).setChartType("column")
.setSeriesNames(['一季度', "二季度", "三季度", "四季度"])
.setOptions({
title: {
name: "测试byProperty方法"
},
xAxis: {
name: "时间"
},
yAxis: {
name: "收入(百万)"
},
series: {
0: {
showSymbol: true,
symbolSize: 4,
lineColor: "red"
},
1: {
showSymbol: true,
symbolSize: 4,
lineColor: "blue",
smooth: true
}
}
});
print(chart)
# ui.Chart.PIEFeature.byFeature
通过制定矢量数据的feature绘制
函数 | 返回值 |
---|---|
ui.Chart.PIEFeature.byFeature(features,xProperty,yProperty) | ui.Chart.PIEFeature.byFeature |
参数 | 类型 | 说明 |
---|---|---|
features | Object|List | feature、featureCollection、list、矢量数据或者列表 |
xProperty | String|List | x轴属性参数 |
yProperty | List | 列表,y轴参数(矢量数据的属性) |
/**
* @File : ui.Chart.PIEFeature.byFeature
* @Time : 2022/2/14
* @Author : piesat
* @Version : 1.0
* @Contact : 400-890-0662
* @License : (C)Copyright 航天宏图信息技术股份有限公司
* @Desc : 通过制定矢量数据的feature绘制
*/
var fCol = pie.FeatureCollection([
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '一季度',
a: 10,
b: 12.1,
c: 20
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '二季度',
a: 21,
b: 9,
c: 10
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '三季度',
a: 13,
b: 5.1,
c: 8
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '四季度',
a: 7,
b: 9.1,
c: 13
})
])
var chart = ui.Chart.PIEFeature.byFeature({
features: fCol,
xProperty: "label",
yProperties: ["a", "b"]
// yProperties: null
}).setChartType("line")
.setSeriesNames(['A', "B"])
.setOptions({
title: {
name: "测试byFeature方法"
},
xAxis: {
name: "时间"
},
yAxis: {
name: "收入(百万)"
},
series: {
0: {
showSymbol: true,
symbolSize: 4,
lineColor: "red"
},
1: {
showSymbol: true,
symbolSize: 4,
lineColor: "blue",
smooth: true
}
}
})
print(chart)
# ui.Chart.PIEFeature.groups
分组绘制
函数 | 返回值 |
---|---|
ui.Chart.PIEFeature.groups(features,xProperty,yProperty,seriesProperty) | ui.Chart.PIEFeature.groups |
参数 | 类型 | 说明 |
---|---|---|
features | Object|List | feature、featureCollection、list、矢量数据或者列表 |
xProperty | List | x轴属性参数 |
yProperty | List | y轴属性参数 |
seriesProperty | String | 分组依据的属性名称 |
/**
* @File : ui.Chart.PIEFeature.groups
* @Time : 2022/2/14
* @Author : piesat
* @Version : 1.0
* @Contact : 400-890-0662
* @License : (C)Copyright 航天宏图信息技术股份有限公司
* @Desc : 分组绘制
*/
var fCol = pie.FeatureCollection([
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '一季度',
a: 10,
b: 12.1,
c: 20,
warm: 1
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '二季度',
a: 21,
b: 9,
c: 10,
warm: 2
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '三季度',
a: 13,
b: 5.1,
c: 8,
warm: 0
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
label: '四季度',
a: 7,
b: 9.1,
c: 13,
warm: 1
})
]);
var chart = ui.Chart.PIEFeature.groups({
features: fCol,
xProperty: "label",
yProperty: "a",
seriesProperty: "warm"
}).setChartType("column")
.setSeriesNames(['A', "B", "C"])
.setOptions({
title: {
name: "测试groups方法"
},
xAxis: {
name: "日期"
},
yAxis: {
name: "收入(百万)"
},
series: {
0: {
color: "red"
},
1: {
color: "blue"
},
2: {
color: "green"
}
}
})
print(chart)
# ui.Chart.PIEFeature.histogram
直方图统计绘制
函数 | 返回值 |
---|---|
ui.Chart.PIEFeature.histogram(features,property,maxBuckets,minBucketWidth) | ui.Chart.PIEFeature.histogram |
参数 | 类型 | 说明 |
---|---|---|
features | Object|List | feature、featureCollection、list、矢量数据或者列表 |
property | List | 统计属性 |
maxBuckets | Number | 最大分组数 |
minBucketWidth | Number | 每一组最小宽度 |
/**
* @File : ui.Chart.PIEFeature.histogram
* @Time : 2022/2/14
* @Author : piesat
* @Version : 1.0
* @Contact : 400-890-0662
* @License : (C)Copyright 航天宏图信息技术股份有限公司
* @Desc : 直方图统计绘制
*/
// 12, 14, 14, 14, 16, 18, 20, 20, 21, 23, 27, 27, 27, 29, 31,
// 31, 32, 32, 34, 36, 40, 40, 40, 40, 40, 42, 51, 56, 60, 65
var fCol = pie.FeatureCollection([
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 14
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 14
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 14
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 16
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 18
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 20
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 20
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 21
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 23
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 27
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 27
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 27
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 29
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 31
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 31
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 32
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 32
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 34
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 36
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 40
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 40
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 40
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 40
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 40
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 42
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 51
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 56
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 60
}),
pie.Feature(pie.Geometry.Point([
115.85816308592939,
39.91121360393521
]), {
a: 65
})
]);
var chart = ui.Chart.PIEFeature.histogram({
features: fCol,
property: "a"
}).setChartType("column")
.setSeriesNames(['A'])
.setOptions({
title: {
name: "测试histogram方法"
},
xAxis: {
name: "类型"
},
yAxis: {
name: "数量"
},
series: {
0: {
color: "red"
}
}
})
print(chart)
有问题,我来改改 (opens new window)
上次更新: 2022/05/25, 10:34:19