Viz.ProgressBar¶
Renders a progress bar as an SVG data URI showing value progression
| Parameter | Type | Required | Description |
|---|---|---|---|
| valueRefExpr | NUMERIC EXPR | Value expression | |
| trackRefExpr | NUMERIC EXPR | Track measure (maximum value) | |
| color | STRING | Optional fill color. Defaults to Power BI theme color | |
| orientation | STRING | Optional orientation: "Horizontal" or "Vertical". Defaults to "Horizontal" | |
| width | INT64 | Optional: SVG width. Defaults to 120 | |
| height | INT64 | Optional: SVG height. Defaults to 48 |
STRING SVG Progress Bar
function 'DaxLib.SVG.Viz.ProgressBar' =
(
valueRefExpr: NUMERIC EXPR,
trackRefExpr: NUMERIC EXPR,
color: STRING,
orientation: STRING,
width: INT64,
height: INT64
) =>
VAR _W = IF( ISBLANK( width ), 120, width )
VAR _H = IF( ISBLANK( height ), 48, height )
VAR _Color = IF( NOT ISBLANK( color ), color, DaxLib.SVG.Color.Theme( "Power BI", 1 ) )
VAR _Marks =
DaxLib.SVG.Compound.ProgressBar(
0, 0, _W, _H, 0, 0,
valueRefExpr, trackRefExpr, _Color, "#E1DFDD", orientation
)
RETURN
IF( NOT ISBLANK( _Marks ), DaxLib.SVG.SVG( "100%", "100%", "0 0 " & _W & " " & _H, _Marks, BLANK() ) )