dreamRs / billboarder

:bar_chart: R Htmlwidget for billboard.js
https://dreamrs.github.io/billboarder/
Other
174 stars 21 forks source link

Negative value in bauge / gauge #9

Open TimTeaFan opened 5 years ago

TimTeaFan commented 5 years ago

I tried using negative values in a billboarder::bauge in shiny and somehow it seems like negative values are not displayed - am I doing something wrong or is this a known issue?

Further, when using positive values while having a negative "min" value, only the positive area is rendered, meaning when min = -100 and max = 100 a value of 25 shows only a colored area that equals 25% which is not correct. Again, I might be doing something wrong. If not, is there a fix for this issue?

Update: As far I understand it, this problem seems to be rooted in the billboard.js library itself. So maybe not an issue for this package.

See Code below:

library(shiny)
library(billboarder)

shinyApp(

    ui = fluidPage(

        baugeOutput(outputId = "gauge")

    ),

    server = function(input, output) {

        output$gauge <- renderBauge({

                            bauge(
                                value = -25, # alternatively use 25 instead of -25
                                min = -100,
                                max = 100,
                                colors = c("#FF0000"),
                                label_format = suffix("")
            )

        })

    }

)
pvictor commented 5 years ago

Hello,

This isn't currently supported, I asked the question here : https://github.com/naver/billboard.js/issues/1071 if you want to follow up.

Victor