Pie With Explode
val range by columnOf("0-10m", "10-20m", "20-40m", "40-100m", "100-250m", ">250m",)
val share by columnOf(0.42, 0.23, 0.15, 0.11, 0.06, 0.03)
val explode by columnOf(0.20, 0.0, 0.04, 0.08, 0.12, 0.16)
val df = dataFrameOf(range, share, explode)
df.plot {
pie {
slice(share)
fillColor(range) {
scale = continuous(Color.RED..Color.LIGHT_GREEN)
}
explode(explode)
size = 25.0
}
layout {
style(Style.Void)
}
}
val range = listOf("0-10m", "10-20m", "20-40m", "40-100m", "100-250m", ">250m",)
val share = listOf(0.42, 0.23, 0.15, 0.11, 0.06, 0.03)
val explode = listOf(0.20, 0.0, 0.04, 0.08, 0.12, 0.16)
plot {
pie {
slice(share)
fillColor(range, "range") {
scale = continuous(Color.RED..Color.LIGHT_GREEN)
}
explode(explode)
size = 25.0
}
layout {
style(Style.Void)
}
}
Last modified: 05 August 2024