Skip to content

Looking for a way to add lines to a LineProvider after the initial definition #892

Answered by Gowsky
zell-mbc asked this question in Questions
Discussion options

You must be logged in to vote

Hello @zell-mbc. Do you actually need to add Lines to an existing LineProvider (which is possible)? Or are you just looking to fix the duplication issue that you mentioned? If it's the latter, then you can just use something like this:

LineCartesianLayer.LineProvider.series(
    buildList {
        add(LineCartesianLayer.rememberLine(LineCartesianLayer.LineFill.single(fill(chartColors[0]))))
        add(LineCartesianLayer.rememberLine(LineCartesianLayer.LineFill.single(fill(chartColors[1]))))
        if (showBodyFat) {
            add(LineCartesianLayer.rememberLine(LineCartesianLayer.LineFill.single(fill(chartColors[3]))))
        }
        if (showLinearTrendline) {
            add(Line…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@zell-mbc
Comment options

Answer selected by zell-mbc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants