Skip to content

Viz.Jitter

Renders a jitter plot as an SVG data URI showing value distribution as scattered points

DaxLib.SVG.Viz.Jitter( axisRef, measureRef, color, width, height )
Parameter Type Required Default Description
axisRef ANYREF EXPR Axis reference column
measureRef NUMERIC EXPR Measure expression
color STRING BLANK() Optional point color. Defaults to Power BI theme color
width INT64 120 Optional: SVG width. Defaults to 120
height INT64 48 Optional: SVG height. Defaults to 48

STRING SVG Jitter Plot

DaxLib.SVG.Viz.Jitter(
    Products[Product],  // axisRef
    [Total Cost],       // measureRef
    ,                   // color
    200,                // width
    60                  // height
)
// Returns an SVG data URI with an embedded jitter plot
// Set as a measure with DataCategory = "ImageUrl"
function 'DaxLib.SVG.Viz.Jitter' =
        (
            axisRef: ANYREF EXPR,
            measureRef: NUMERIC EXPR,
            color: STRING = BLANK(),
            width: INT64 = 120,
            height: INT64 = 48
        ) =>

            VAR _Marks =
                DaxLib.SVG.Compound.Jitter(
                    0, 
                    0, 
                    width, 
                    height,
                    axisRef, 
                    measureRef, 
                    color
                )

            RETURN
                IF( NOT ISBLANK( _Marks ), DaxLib.SVG.SVG( "100%", "100%", _Marks, "0 0 " & width & " " & height ) )