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.

Histogram With Line

Edit pageLast modified: 30 November 2023
val random = java.util.Random(42)

val sampleDf = dataFrameOf(
    "sample" to List(1000) { random.nextGaussian() }
)

sampleDf.plot {
    statBin("sample", binsOption = BinsOption.byNumber(15)) {
        bars {
            alpha = 0.9
            x(Stat.x)
            y(Stat.count)
        }
        line {
            x(Stat.x)
            y(Stat.count)
            color = Color.RED
            width = 1.5
            type = LineType.LONGDASH
        }
    }
}
Histogram With Line