Reference Manual: (offline | online) Quickstart: (offline | online)

# ui.bar

Function: ui.bar( | range, value, clicked=None, **properties)

This creates a bar widget. The bar widget can be used to display data in a bar graph format, and optionally to report when the user clicks on a location in that bar.

range - The range of values this bar can undertake. The bar is completely full when its value is this number.

value - The value of this bar. It must be between 0 and range, inclusive.

clicked - This is a callback function called when the mouse is clicked in this widget. It is called with a single argument, which is the value corresponding to the location at which the mouse button was clicked. If this function returns a value, that value is returned from ui.interact .

The width and height should be set with the xmaximum and ymaximum properties. For best results, if clicked is set then width should be at least twice as big as range.

## Example

    python:
        # Stats Window
        ui.frame(xpos=0,
                 ypos=0,
                 xanchor='left',
                 yanchor='top',
                 xfill=True,
                 )

        ui.vbox()

        ui.text('Statistics')
        ui.null(height=20)

        for name, range, value in stats:
            ui.hbox()
            ui.text(name, minwidth=150)
            ui.bar(range, value, ypos=0.5, yanchor='center')
            ui.close() # for the ui.hbox

        ui.close() # for the ui.vbox

Reference Manual: (offline | online) Quickstart: (offline | online)