kandy
 
0.8.0
Because kandy 0.8.0 is still in development, this documentation may not be entirely accurate and is subject to change.

Tiles Gradient

Edit pageLast modified: 06 December 2023
val cities = listOf("Yerevan", "Berlin", "Amsterdam", "Paphos")
val random = kotlin.random.Random(42)
val year22 = List(4) { random.nextDouble() }
val year23 = List(4) { random.nextDouble() }
val year24 = List(4) { random.nextDouble() }

val dataset = dataFrameOf(
    "city" to cities,
    "2022" to year22,
    "2023" to year23,
    "2024" to year24
).gather("2022", "2023", "2024").into("year", "value")

dataset.plot {
    tiles {
        x("city")
        y("year") {
            scale = categorical()
            axis.breaks(format = "d")
        }
        fillColor("value")
    }
}
Tiles Gradient