Order
Declaration
janela_pane Order, :revenue
Esta página ainda está em inglês. Ver em inglês.
Reference
Every renderer Janela ships (table, bar, line, doughnut, and pie), drawn live against this demo's own
data, with the declaration that produced it beside it. Built from nothing but janela_pane
and what Janela exposes for exactly this: a time dimension can bucket by
hour, day, week, month, quarter, and year, and a form offers 5, 10, 20, 50, 100 as a
row limit, and a breakdown by a category can be ordered (desc, asc, label, and label_desc). Beside each pane is a control for every other option a pane takes: a chart's height
(1 to 5), whether a bar shows its value, how prominent a
single value is (1 to 3), and up to 3
companion columns on a table. Each appears only while the renderer chosen is one it changes, and the
declaration rewrites itself to match, so it can be copied. This is a host page built from the gem's helpers, not one of the engine's own (ADR 027).
Every row a query returns, as it is. Nothing else is drawn without a measure, so this is the one renderer every model can demonstrate.
Declaration
janela_pane Order, :revenue
Declaration
janela_pane PageView, :views
Declaration
janela_pane WholesaleOrder, :revenue
A measure compared across a categorical dimension: one bar per value, the shape for ranking or comparing a handful of groups.
Declaration
janela_pane Order, :revenue, by: :status, as: :bar
Declaration
janela_pane PageView, :views, by: :page, as: :bar
Declaration
janela_pane WholesaleOrder, :revenue, by: :status, as: :bar
A measure tracked over a time dimension, bucketed by whatever granularity that dimension offers.
Declaration
janela_pane Order, :revenue, by: :placed_on, as: :line, granularity: :month
Declaration
janela_pane PageView, :views, by: :viewed_on, as: :line, granularity: :month
Declaration
janela_pane WholesaleOrder, :revenue, by: :placed_on, as: :line, granularity: :month
A measure split across a categorical dimension as parts of a whole. Drawn as SVG with a legend of buttons, so it reads without JavaScript and every slice can be reached from the keyboard.
Declaration
janela_pane Order, :revenue, by: :status, as: :doughnut
Declaration
janela_pane PageView, :views, by: :page, as: :doughnut
Declaration
janela_pane WholesaleOrder, :revenue, by: :status, as: :doughnut
The same split as a doughnut, without the hole. Best with a handful of values: past eight, the rest share one neutral colour.
Declaration
janela_pane Order, :revenue, by: :status, as: :pie
Declaration
janela_pane PageView, :views, by: :page, as: :pie
Declaration
janela_pane WholesaleOrder, :revenue, by: :status, as: :pie
A line chart can read as a total to date, and carry up to three more series over the same months, each a line or bars on the left axis or a right one. Here orders placed and orders shipped are both to date, with orders per month as bars on the right.
Declaration
janela_pane Order, :orders, by: :placed_on, as: :line, granularity: :month, cumulative: true, value_labels: true, series: [ { measure: :orders, by: :shipped_on, cumulative: true, title: "Orders shipped to date" }, { measure: :orders, as: :bar, axis: :right, title: "Orders per month" } ]
Set in the options a pane takes, not by a control here: Charts and Their Options says what each key does (ADR 062).