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

Candlestick Settings DSL

Edit pageLast modified: 27 March 2024
val df = dataFrameOf(
    "date" to List(10) { LocalDate(2022, 1, it + 1) },
    "open" to listOf(10.0, 15.0, 12.0, 18.0, 14.0, 16.0, 20.0, 22.0, 19.0, 25.0),
    "high" to listOf(18.0, 17.0, 20.0, 22.0, 18.0, 22.0, 25.0, 24.0, 27.0, 28.0),
    "low" to listOf(8.0, 10.0, 9.0, 11.0, 12.0, 15.0, 18.0, 17.0, 18.0, 22.0),
    "close" to listOf(15.0, 12.0, 18.0, 14.0, 16.0, 20.0, 22.0, 19.0, 25.0, 23.0),
)

df.plot {
    candlestick("date", "open", "high", "low", "close") {
        increase {
            fillColor = Color.hex("#00fefe")
            alpha = 0.9
        }
        decrease {
            fillColor = Color.hex("#ea2211")
            alpha = 0.5
        }
        borderLine.color = Color.GREY
        width = 0.7
    }
    y.axis.name = "Price, €"
    x.axis.name = "Date"
}
Candlestick Settings DSL