by 

PlotJax JSON Interface Guide

Note: this is a preliminary specification subject to change.

PlotJax chart data and properties are loaded from a JSON encoded object formatted as follows: (? indicates optional property, underlined values are the defaults)

{
    X: <typespec>,
    ? Y: <typespec>,
    ? Y2:  <typespec>,
    ? Z:  <typespec>,
    ? Labels: {
        ? Font: <fontjson>,
        ? YRotate: <boolean>,
        ? XPosition: 'end' | 'center'
        },
    ? Ticks: "none" |
    	{
        ? Font: <fontjson>,
        ? XAngle: degrees,
        },
    ? Legend: {
        ? Font: <fontjson>,
        Position: "left" | "right" | "below"
        },
    ? Title: {
        String: "string",
        ? Font: <fontjson>,
        ? Position: "top" | "bottom" | [ x, y ]
        },
    ? Signature: {
        String: "string",
        ? Font: <fontjson>,
        ? Position: [ x, y ]
        },
    ? AxisColor: <color> | [ <color>, ... ] | "none",
    ? Grid: {
        ? Color: <color>,
        ? Pattern: 'solid' | 'dash' | 'dot',
        ? Direction: 'vertical' | 'horizontal' | 'both' | 'none',
        ? Layer: 'over' | 'under'
        },
    ? FillColor: <color>,
    ? Background: {
        ? Bands: <color> | [ <value>, <color>, ...]
        ? Color: <color>,
        ? Gradient: 'vertical' | 'horizontal'
        },
    ? Logo: <imgurl>,
    ? Tiled: <boolean>,
    ? Shadow: <boolean>,
    ? Balloon: "offset" | "centered",
    ? Border: 'none' | {
        ? Color: <color>,
        ? Width: <width>
    	},
    ? FontPath: "pathstring",
    ? Fold: [ 'x' | 'y', start, end ],
    Charts: [
        {
            PlotKind: <plotkind>,
            ? PlotID: "string",
            ? ThreeD: <boolean>,             // bars, pie, and lines only
            ? Stacked: <boolean>,       // bars, candles, and areas only
            ? Float: <boolean>,           // bar, and areas only
            ? Size: <typespec>,     // bubbles only
            ? Intensity: <typespec>, // bubbles only
            ? RightAxis: <boolean>,            // true => chart maps Y2 range
            ? Styles: [
            	{
            		? Color: <color>,
            		? Degrees: <integer>,       // polyfit/expfit only
            		? Pattern: 'solid' | 'dash' | 'dot',	// linegraph/curvefit only
            		? Shape:<shape>,
            		? Icon: <URL>,
            		? LineWidth: <number>,        // linegraphs/curvefit only
            		? Name: "string"
            	},
            	...
            ],
            Data: [ <treemap-value-list> | <point-value-list> ]
        }, ...
    ]
}

where:

Specifying Axis Datatypes

<typespec> is an object of
{
    "Type": <datatype>,
    ? "Label": label,
    ? "Format": <format>,
    ? "TickFormat": <format>,
    ? "TickInterval": tickinterval,
    ? "Max": value,
    ? "Min": value,
    ? "Log10" : <boolean>,
    ? "KeepOrigin": <boolean>,
    ? "Mapping": 'normal' | 'reverse'	-- bubble Size and Intensity only
},
where

Specifying Colors

Color may be specified as

Specifying Fonts

<fontjson> is a HTMLCanvasFontFoundry compatible JSON structure; see HTML::Canvas::Font for details

Generating Balloon Tooltips

Tooltip balloons may be assigned to individual datapoints by providing a helper object to the PlotJax constructor that provides a getBalloonContent() method. Refer to the PlotJax Helper Object Definition for details on generating tooltip content.

Specifying Tick and Datapoint Formats

A <format> is either a numeric printf() format specification (for numeric types), or a strftime() format specification (for any datetime/interval types). (Formats are ignored for symbol type).

Only the "%d", "%e", and "%f" printf() format specifiers (including width and precision fields) are supported; any embedded flag values are ignored. Other literals in the format specification will be included in the resulting string.

A modified subset of strftime format specifiers is supported:

The following table lists the acceptable and default formatting for the various datatypes:

TypeFormatsDefault
number subset of printf() format specifiers determined by the range of values.
date strftime() date format specification "%Y-%m-%d"
time strftime() time format specification "%T"
timestamp strftime() timestamp format spec. "%Y-%m-%d %T"
interval year "%<width>d" "%3d"
interval year to month "%<width>d"; month precision is 2 "%3d"; output is "YYYy MMm"
interval month "%<width>d" "%3d"
interval day "%<width>d" "%3d"
interval day to hour "%<width>d", hour is 2 digits "%3d"; "DDDd HHh"
interval day to minute "%<width>d", hour and minutes are 2 digits each "%3d"; "DDDd HH:MM"
interval day to second "%<width>.<subsecs>d", hour, minutes, and seconds are 2 digits; is precision of subseconds "%3.0d" "DDDd HH:MM:SS[.sss]"
interval hour "%<width>.<prec>d" "%3d"
interval hour to minutes "%<width>d", minutes is 2 digits "%3d"; "HHH:MM"
interval hour to second "%<width>.<subsecs>d", minutes and seconds are 2 digits, and is precision of subsecond digits "%3.0d"; "HHH:MM:SS[.sss]"
interval minute "%<width>d" "%3d"
interval minute to second "%<width>.<subsecs>d", seconds is 2digits, and is precision of subsecond digits "%3.0d"; "MM:SS[.sss]"
interval second "%<width>.<prec>f", is precision of subsecond digits "%3.0f"