Skip to content

Axes.Baseline

Maps the numeric baseline to plot coordinates honoring orientation

DaxLib.SVG.Axes.Baseline( orientation, yMin, yMax, plotX, plotY, plotWidth, plotHeight )
Parameter Type Required Description
orientation STRING "Horizontal" or "Vertical"
yMin NUMERIC VAL Y-axis minimum value
yMax NUMERIC VAL Y-axis maximum value
plotX NUMERIC VAL Plot area X origin
plotY NUMERIC VAL Plot area Y origin
plotWidth NUMERIC VAL Plot area width
plotHeight NUMERIC VAL Plot area height

TABLE Single-row table with @BaseX and @BaseY

DaxLib.SVG.Axes.Baseline(
    "Vertical",     // orientation
    0,              // yMin
    500,            // yMax
    40,             // plotX
    5,              // plotY
    460,            // plotWidth
    270             // plotHeight
)
// Returns single-row table: { @BaseX, @BaseY }
// Maps the numeric baseline (yMin) to plot coordinates
function 'DaxLib.SVG.Axes.Baseline' =
        (
            orientation: STRING,
            yMin: NUMERIC VAL,
            yMax: NUMERIC VAL,
            plotX: NUMERIC VAL,
            plotY: NUMERIC VAL,
            plotWidth: NUMERIC VAL,
            plotHeight: NUMERIC VAL
        ) =>

            VAR _Orientation = IF( orientation = "Horizontal", "Horizontal", "Vertical" )
            VAR _BaseX = IF( yMax = yMin, plotX, DaxLib.SVG.Scale.Normalize( yMin, yMin, yMax, plotX, plotX + plotWidth ) )
            VAR _BaseY = IF( yMax = yMin, plotY + plotHeight, DaxLib.SVG.Scale.Normalize( yMin, yMin, yMax, plotY + plotHeight, plotY ) )

            RETURN
                ROW(
                    "@BaseX", IF( _Orientation = "Horizontal", _BaseX, plotX ),
                    "@BaseY", IF( _Orientation = "Horizontal", plotY, _BaseY )
                )