Line Settings
val museumVisitors = dataFrameOf("date", "visitors")(
LocalDate(2023, 1, 1), 120,
LocalDate(2023, 1, 15), 95,
LocalDate(2023, 2, 1), 110,
LocalDate(2023, 2, 15), 123,
LocalDate(2023, 3, 1), 130,
LocalDate(2023, 3, 15), 140,
LocalDate(2023, 4, 1), 150,
LocalDate(2023, 4, 15), 160,
LocalDate(2023, 5, 1), 175,
LocalDate(2023, 5, 15), 180
).convert("date").to<String>()
museumVisitors.plot {
line {
x("date")
y("visitors")
type = LineType.DASHED
color = Color.PURPLE
width = 2.5
}
}
val date = listOf(
LocalDate(2023, 1, 1),
LocalDate(2023, 1, 15),
LocalDate(2023, 2, 1),
LocalDate(2023, 2, 15),
LocalDate(2023, 3, 1),
LocalDate(2023, 3, 15),
LocalDate(2023, 4, 1),
LocalDate(2023, 4, 15),
LocalDate(2023, 5, 1),
LocalDate(2023, 5, 15)
).map { it.toString() }
val visitors = listOf(120, 95, 110, 123, 130, 140, 150, 160, 175, 180)
plot {
line {
x(date)
y(visitors)
type = LineType.DASHED
color = Color.PURPLE
width = 2.5
}
}
Last modified: 23 November 2023