https://kotlinlang.org logo
r

Robert Jaros

03/24/2022, 12:10 PM
@Jörg Rade I don't really understand your question in https://github.com/rjaros/kvision/issues/358
j

Jörg Rade

03/24/2022, 1:38 PM
How can I get a legend with (pseudo code): LIGHT_BLUE -> 0 .. 4 BLUE -> 5 .. 8 GREEN -> 9.. 16
etc.
The way colors are specified, differs from the way legendLabels a specified (in KVision)
something like label = ["0..4", "5..9", etc.] would be analogous to
Copy code
return DataSets(
    backgroundColor = buildBgColorList(),
    borderColor = buildBorderColorList(),
    data = buildDataSetsList(),
    label = "test"
)
but label takes only a String not List<String>
Maybe I'm completely lost?
the JS code suggest something like { label: ["Denmark"], backgroundColor: "rgba(60,186,159,0.2)", borderColor: "rgba(60,186,159,1)", title: "dataTitle2", data: [{ x: 258702, y: 7.526, r: 10 }] }
generateLabels
function?
It's available in KVision as
ChartOptions.plugins.legend.labels.generateLabels
j

Jörg Rade

03/24/2022, 2:48 PM
No - I'll give it a try. Thanks!
Worked, i‘ll comment and close the issue later the day.
👍 1
3 Views