How to force y Axis to use floating point precision?
- Dominant language
- Kotlin
- Stars
- 744
- Forks
- 27
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Description
I used this code from kandy examples:
```
val years = listOf(1, 2, 3, 4, 5)
val cost = listOf(62.7, 39.3, 72.1, 73.7, 68.5)
plot {
line {
x(years)
y(cost)
type = LineType.SOLID
}
}
```
And when you hover over the resultant plot values, we see y axis labels that correctly show values with decimal point like 62.7, 72.1 etc.

But if I use this dataset instead:
```
val years2 = listOf(1, 2, 3, 4, 5)
val cost2 = listOf(95.0, 2.2, 3.3, 4.4, 5.5)
plot {
line {
x(years2)
y(cost2)
type = LineType.SOLID
}
}
```
I get a plot where all y values are rounded off to the nearest integer. I don't understand what is causing this and how to force y axis to be of Double type.

How do I force y axis to use decimal values?
Contributor guide
Research direction
Reproduce the two Kotlin plotting snippets from the issue and compare the y-axis label behavior when the values span a wide range. Trace the y-axis scale and label-formatting entry points to determine why decimal values are rounded, then verify that the affected plot displays decimal labels without changing the first example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100