Skip to content

Negative value in bauge / gauge #9

@TimTeaFan

Description

@TimTeaFan

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("")
            )
            
        })
        
    }
    
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions