Skip to content

Commit b2526de

Browse files
committed
Fix #244 => Add Double Layer Half Pie ( semi-circle donut) Chart Sample
1 parent 043409c commit b2526de

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

AAInfographicsDemo/Demo/AdditionalContent1/DrawChartWithAAOptionsVC.swift

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class DrawChartWithAAOptionsVC: AABaseChartVC {
7373
case 30: return configureSpiderWebRadarChart()//带有颜色标志带の🕸蜘蛛网状雷达图
7474
case 31: return disableMixedChartInactiveAnimationEffect()//禁用混合图表的 inactive 动画效果
7575
case 32: return adjustBubbleChartMinAndMax()//调整气泡图的 min 和 max 相关属性
76+
case 33: return doubleLayerHalfPieChart()//双层嵌套的玉阕图
7677

7778
default:
7879
return AAOptions()
@@ -1894,6 +1895,52 @@ function () {
18941895
return aaOptions
18951896
}
18961897

1898+
// https://github.com/AAChartModel/AAChartKit-Swift/issues/244
1899+
private func doubleLayerHalfPieChart() -> AAOptions {
1900+
let aaChartModel = AAChartModel()
1901+
.chartType(.pie)
1902+
.title("浏览器市场占比历史对比")
1903+
.subtitle("无任何可靠依据的虚拟数据")
1904+
.dataLabelsEnabled(false)//是否直接显示扇形图数据
1905+
.yAxisTitle("摄氏度")
1906+
.series([
1907+
AASeriesElement()
1908+
.name("Past")
1909+
.size("40%")//尺寸大小
1910+
.innerSize("30%")//内部圆环半径大小占比
1911+
.borderWidth(0)//描边的宽度
1912+
.allowPointSelect(false)//是否允许在点击数据点标记(扇形图点击选中的块发生位移)
1913+
.data([
1914+
["Firefox Past", 3336.2],
1915+
["Chrome Past", 26.8],
1916+
["Safari Past", 88.5],
1917+
["Opera Past", 46.0],
1918+
["Others Past", 223.0],
1919+
]),
1920+
AASeriesElement()
1921+
.name("Now")
1922+
.size("80%")//尺寸大小
1923+
.innerSize("70%")//内部圆环半径大小占比
1924+
.borderWidth(0)//描边的宽度
1925+
.allowPointSelect(false)//是否允许在点击数据点标记(扇形图点击选中的块发生位移)
1926+
.data([
1927+
["Firefox Now", 336.2],
1928+
["Chrome Now", 6926.8],
1929+
["Safari Now", 388.5],
1930+
["Opera Now", 446.0],
1931+
["Others Now", 223.0],
1932+
])
1933+
])
1934+
1935+
let aaOptions = AAOptionsConstructor.configureChartOptions(aaChartModel)
1936+
1937+
aaOptions.plotOptions?.pie?
1938+
.startAngle(-90)
1939+
.endAngle(90)
1940+
1941+
return aaOptions
1942+
}
1943+
18971944
}
18981945

18991946

AAInfographicsDemo/Demo/MainVC.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ class MainVC: UIViewController {
226226
"Spider Web Radar Chart With PlotBands----带有颜色标志带の🕸蜘蛛网状雷达图",
227227
"Disable Mixed Chart Inactive Animation Effect----禁用混合图表的 inactive 动画效果",
228228
"Adjust Bubble Chart Min And Max----调整气泡图的 min 和 max 相关属性",
229+
"doubleLayerHalfPieChart---双层嵌套的玉阕图",
229230
],
230231
/*Custom Tooltip With JavaScript Formatter Function */
231232
[

0 commit comments

Comments
 (0)