Skip to content
Lisa Zhang edited this page Dec 3, 2013 · 2 revisions

WikiAPI ReferenceNumeral

The function polyjs.numeral() takes a specification object spec and renders a single number. This number could be the value of some statistical operation on one of the data columns. This page explains the attributes that can be set through the spec object. The attributes fall into the following categories:

Aesthetics

Actually, there is only one aesthetic var. It should be mapped to the data column (or statistics) whose value you would like displayed.

spec.var

Type Aesthetic Mapping Object
Statistical Aggregation Allowed

spec.data

Type Polyjs Data Object
Required Yes

This should be a Polychart.js data object that is used to created the numeral. See the data section of the API reference for more details.

spec.filter

Type Filter Object
Required No (Optional)

This is an optional attribute that could be defined if not all data points are to be visualized. See more at Filter.

spec.dom

Type String
Required Yes

A DOM element or an identifier of a DOM element to plot the numeral in.

spec.width

Type Int
Required No (Optional)
Default 200

The width of the numeral in pixels.

spec.height

Type Int
Required No (Optional)
Default 100

The height of the numeral in pixels.

spec.title

Type String
Required No (Optional)
Default The aesthetic mapped to `spec.var`

The title of the numeral.