Getting Started

Quickly get started with Koala Plot
  1. Use the Kotlin Multiplatform Wizard to create a new project.
  2. Include Koala Plot core as a dependency in your project: implementation(io.github.koalaplot:koalaplot-core:<version>)

First Plot

The below plots the function \( y=x^2 \) with x from 1 to 10:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
fun main() = singleWindowApplication {
    val data = buildList {
        for (i in 1..10) {
            add(DefaultPoint(i.toFloat(), i * i.toFloat()))
        }
    }

    XYGraph(
        rememberFloatLinearAxisModel(data.autoScaleXRange()),
        rememberFloatLinearAxisModel(data.autoScaleYRange())
    ) {
        LinePlot(
            data,
            lineStyle = LineStyle(SolidColor(Color.Blue))
        )
    }
}
/examples/src/jvmMain/kotlin/io/github/koalaplot/example/Line1.kt

Line1

You can also refer to the samples project for more examples.


Last modified January 26, 2026: Update getting started page. (b6827bc)