KoalaPlot / koalaplot-core

Koala Plot is a Compose Multiplatform based charting and plotting library written in Kotlin
https://koalaplot.github.io/
MIT License
371 stars 18 forks source link

Time-based axis #64

Open SPC-code opened 3 months ago

SPC-code commented 3 months ago

For dynamic data it is important to have time-based axis (preferably based on Kotlinx-datetime Instant. It requires #63 to work properly.

gsteckman commented 3 months ago

You can use a LongLinearAxisModel for representing date types and use kotlinx-datetime to format it. I have created a sample that does this.

I realize this isn't the same as having a natively supported type, but I don't want to add kotlinx-datetime as a required dependency. This is a good use case for an extension library that people can optionally include to support additional data types.

SPC-code commented 3 months ago

My own crude implementation of time-axis is here: https://git.sciprog.center/kscience/controls-kt/src/branch/dev/controls-visualisation-compose/src/commonMain/kotlin/TimeAxisModel.kt