Skip to content

Axis Scales — Log, Pow, and Symlog

Dataface's default measure-axis scale is linear. When a metric spans several orders of magnitude — population counts, payload masses, request latencies — a linear scale compresses small values into an unreadable sliver near zero. Set scale.type on the measure axis to switch to a logarithmic, power, or symmetric-log scale instead.

type: log

axis_y.scale.type: log is first-class on line and area charts: Dataface validates the authoring surface (see below) and lets Vega-Lite own tick placement natively (log-decade ticks, computed from the data — never a fixed tick count).

source: examples_db
queries:
  populations:
    type: values
    columns: [year, population]
    values:
      - ["1800", 990000000]
      - ["1900", 1650000000]
      - ["1950", 2536000000]
      - ["2000", 6127000000]
      - ["2025", 8200000000]
charts:
  world_population_log:
    query: populations
    type: line
    title: World Population (log scale)
    x: year
    y: population
    style:
      axis_y:
        scale:
          type: log
rows:
  - world_population_log
18001900195020002025100M200M300M400M500M1G2G3G4G5G10GWorld Population (Log Scale) Data as of 16:49 UTC on 5 Aug 2026 made with dataface

base sets the log base (default: Vega-Lite's 10):

style:
  axis_y:
    scale:
      type: log
      base: 2

type: pow / type: sqrt / type: symlog

These scale types reach Vega-Lite the same way type: log does, but without a first-class tick story — Dataface passes them straight through and does not validate or specialize tick placement for them the way it does for log. exponent configures pow; constant configures symlog. Unlike log, their domains can include 0, so — verified — they don't hit the log-specific area-mark rendering issue below and need no explicit domain.

style:
  axis_y:
    scale:
      type: pow
      exponent: 0.5

Rules

A handful of authoring combinations are rejected at compile time rather than silently producing a misleading chart:

Rule Why
base requires type: log (same for exponent/type: pow, constant/type: symlog) These params are meaningless without the matching scale type.
type: log + zero: true A log domain cannot include 0.
type: log on a bar chart A bar's length encodes magnitude from zero — meaningless on a log scale. Use line or area instead.
type: log + axis_y.ticks.count A target tick count is meaningless on a log axis; Vega-Lite computes log-decade ticks natively.

See the YAML Schema Reference for the full ScaleStyle field list.