We have released a new chart library fully built-in Compose and Kotlin. You can check it out in our ...
d
We have released a new chart library fully built-in Compose and Kotlin. You can check it out in our GitHub repo. Some of its features: • Line Charts • Bar Charts • Grouped Bar Charts • Pie Charts • Donut Charts • Combined Charts Charts are fully customizable with a Compose taste. Additionally, YCharts has also accessibility support. Feel free to check out YCharts here, and provide us with any feedback you may have
💯 6
🔥 8
📊 3
👌🏻 1
👀 3
👍 2
❤️ 3
🍩 2
👌🏽 2
🙌 2
📈 2
👌 1
1
👌 11
😮 1
k
One suggestion, in your README code blocks set the language of the block to
kotlin
to get syntax highlighting
Copy code
```kotlin

```
2
l
Have y’all considered compose multiplatform support? Curious if there’s any android dependency or if this could be moved to support JVM or even native compose.
💯 6
👀 1
c
I like how the first dot on the linechart is clipped, but dislike how the third one isn't 😂, but I've got a feeling I'm going to enjoy using this library sometime very soon!
🙌 1
d
@Kevin Del Castillo We will update the README, Thank you for the suggestion
@Landry Norris As of now we are considered only for android. Soon we will start for multi-platform
🚀 3
@czuckie We will look into that issue, Thank you for your feedback
a
cc @Andrei Kislitsyn
Looks interesting. API seems rather raw. Also it is not clear, if you support interactivity.
d
Yes @altavir We are supporting user interactions
a
Ah, and it seems it does not support desktop target. It's a pity.
d
@altavir We are on it
👍 5
l
hi! I am trying to use your library for line chart, but Y labels never matching to the Y point value. This is a bug or I don't use correctly your library?
d
Could you help me to understand more, @Luigi Giustiniani
l
The max Y value of my dataset (21f) is not drawn on the top of the graph, so I cannot calculate the correct Y scale and the corresponding Y label
This is my code block
Copy code
val yAxisData = AxisData.Builder()
                .steps(5)
                .labelAndAxisLinePadding(20.dp)
                .labelData { i ->
                    // Add yMin to get the negative axis values to the scale
                    val yMin = pointsData.minOf { it.y }
                    val yScale = 5
                    (yMin + (i * yScale)).formatToSinglePrecision()
                }.build()
d
@Luigi Giustiniani In the above graph YAxis data is proper as per your code, Could you provide the data set
l
This is my test dataset
Copy code
val pointsData: List<Point> =
                listOf(
                    Point(1f, 19f),
                    Point(2f, 10f),
                    Point(3f, 10f),
                    Point(4f, 11f),
                    Point(5f, 11f),
                    Point(6f, 11f),
                    Point(7f, 11f),
                    Point(8f, 12f),
                    Point(9f, 13f),
                    Point(10f, 15f),
                    Point(11f, 18f),
                    Point(12f, 21f),
                    Point(13f, 18f),
                    Point(14f, 18f),
                    Point(15f, 21f),
                    Point(16f, 19f),
                    Point(17f, 19f),
                    Point(18f, 19f),
                    Point(19f, 19f),
                    Point(20f, 19f),
                    Point(21f, 20f),
                    Point(22f, 20f),
                    Point(23f, 20f),
                    Point(24f, 19f),
                    Point(25f, 19f),
                    Point(26f, 19f),
                    Point(27f, 19f),
                    Point(28f, 19f),
                    Point(29f, 19f),
                    Point(30f, 19f),
                    Point(31f, 19f),
                    Point(32f, 19f),
                    Point(33f, 19f),
                    Point(34f, 19f),
                    Point(35f, 19f),
                    Point(36f, 19f),
                    Point(37f, 19f),
                    Point(38f, 19f)

                )
d
Hi @Luigi Giustiniani, Thank you for reporting the issue, We are on it. As a quick fix, you can modify the source code of yStep value calculation, in two place 1- As part yAxisDataBuilder ”
Copy code
.labelData { i ->
    // Add yMin to get the negative axis values to the scale
    val yMin = pointsData.minOf { it.y }
    val yMax = pointsData.maxOf { it.y }
    val yScale = (yMax - yMin)/steps
    ((i * yScale) + yMin).formatToSinglePrecision()
}
2- LineChartExtension.kt Line number: 31-> return Triple(yMin, yMax, temp)
👍 1
a
we can move the discussion to the #science chat. I understand it is not exactly about science, but the discussion about plots is mostly there.
p
How about WEB?
a
There are a lot of plotting libraries for web
p
supporting jb-compose ?
a
You can use React/plain js components inside comopse for web. We can discuss it in #science
👍 1
2239 Views