Open Flash Chart Version 2 – JSON File Definition

Scatter Line Plot Type Attributes Object



NOTE: Items in bold red represent patches that may or may not be added to OFC-2.



The “scatter_line” plot type is used to plot a series of points with a line drawn between each point.

It can optionally color fill an area defined by the series of points. The “base” for the area can be defined as a Y line, an X line or a point (X,Y).



{"type":”scatter_line”, "text":”Scatter Line with Area”,

tip”: “[#x#,#y#] #size#”,

width”: 2, “colour”: “#d01f3c”, “dot-size”: 5,

area-style”:{“colour”:”#b0101c”, ”alpha”:0.5, ”y”:0 },

"dot-style": { "type":"anchor", "sides":5, "hollow":true,

"background-colour":"#104a80", "background-alpha": 0.4,

"width":1, “on-click”:”http://www.google.com” },

values”: [ {“x”:1,“y”:1}, {“x”:2,“y”:2}, {“x”:3,“y”:4, “on-click”:”http://yahoo.com”} ] }



OBJECT

ATTRIBUTE

VALID VALUES

DEFAULT

NOTES





This table defines attributes for a scatter_line element object


type”

scatter_line”

undefined

Must be set to “scatter_line” to define a scatter line plot.


text”

Name of the Plot”

“”

The name of the plot is displayed in the Legend and is available in tooltips via the #key# magic value variable


width”

0 to n

2

Width in pixels of the line. Zero (0) is a hairline.


colour”

#RRGGBB” hex string

#3030d0”

Defines the color of the line and the points


dot-size”

0 to n

5

Defines the radius in pixels of the circle for the points. Anchors fit inside the circle.


tip”

ToolTip text”

*See notes

Specifies the text to display in the pop up tool tip.

* Default is “[#x#,#y#] #size#” which displays the X, Y and dot-size values.


area-style”

Object defining an area fill

undefined

If defined then causes the area “under” the plot to be color filled.

* See “area-style” definition table below.


dot-style”

Object defining the default point style for the chart

undefined

If defined then the points will be drawn as defined otherwise they will be a simple circle.


values”

Array of value objects defining points to be plotted

[...]

Defines an array of points to be plotted.

* See “values” definition table below.




Definition of the the “area-style” object within the “scatter_line” type element object. If this object is defined then the area between the plot and the defined area base is coloured in. The base for the area to be filled can be an X line, a Y line or an (X,Y) point.

OBJECT

ATTRIBUTE

VALID VALUES

DEFAULT

NOTES

area-style”






colour”

#RRGGBB” hex string



undefined

undefined

Color for area “under” the plot.

Undefined causes the area to be colored the same as the plot's color.


alpha”

Real number 0 to 1

1

Specifies the opacity of the color filled area.

Ranges from 0 (transparent) to 1 (totally opaque).


x”

Any number



undefined

undefined

Specifies the X component for the base of the filled area. If the Y component is not defined then the base will be a vertical line at the value X; otherwise, the base will be the point (X, Y).


y”

Any number



undefined

undefined

Specifies the Y component for the base of the filled area. If the X component is not defined then the base will be a horizontal line at the value Y; otherwise, the base will be the point (X, Y).





Definition of the the “dot-style” object within the “scatter_line” type element object. If this object is defined then the points of the line will be drawn with the defined characteristics. Values in this object override values defined at the plot level.

OBJECT

ATTRIBUTE

VALID VALUES

DEFAULT

NOTES

dot-style”






type”

point”

dot”

star”

bow”

anchor”

point”

point = a hollow circle

dot = a filled circle

star = a 5 pointed star

bow = a bow tie

anchor = a 3 to n sided object


alpha”

Real number 0 to 1

1

Specifies the opacity of the line for the anchor, bow and star


hollow”

true or false

false

Specifies whether the anchor should have a the center filled with the background-colour


background-colour”

#RRGGBB” hex string

undefined

Specifies the fill color for a hollow anchor


background-alpha”

Real number 0 to 1

1

Specifies the opacity of the fill color for a hollow anchor


dot-size”

0 to n

5

Defines the radius in pixels of the circle for the points. Anchors fit inside the circle.


tip”

ToolTip text”

*See notes

Specifies the text to display in the pop up tool tip.

* Default is “[#x#,#y#] #size#” which displays the X, Y and dot-size values.


halo-size”

0 to n

0

Number of pixels around the anchor to erase forming a gap between the anchor and the line coming in to it.


rotation”

-180 to 180

0

Specifies degrees of rotation to apply to the anchor.


sides”

3 to 360

3

Number of sides of an “anchor” type


width”

0 to n

2

Width of the line drawn for the anchor. 0 is a hairline.


on-click”

user defined text

undefined

Function or URL to invoke when the point is clicked on



Definition of the “values” array of point objects within the “scatter_line” type element object. Any of the values in the “dot-style” can be overridden here as well.

OBJECT

ATTRIBUTE

VALID VALUES

DEFAULT

NOTES





This table defines point objects within the “values” array for a scatter_line element object


x”

Any number



null

-1

Specifies the X component for the point.



If null is specified then the point will not be visible and it will generate a gap in the line. The line will pick up again with the next point.


y”

Any number

-1

Specifies the Y component for the point.


type”

point”

dot”

star”

bow”

anchor”

point”

point = a hollow circle

dot = a filled circle

star = a 5 pointed star

bow = a bow tie

anchor = a 3 to n sided object


alpha”

Real number 0 to 1

1

Specifies the opacity of the line for the anchor, bow and star


hollow”

true or false

false

Specifies whether the anchor should have a the center filled with the background-colour


background-colour”

#RRGGBB” hex string

undefined

Specifies the fill color for a hollow anchor


background-alpha”

Real number 0 to 1

1

Specifies the opacity of the fill color for a hollow anchor


dot-size”

0 to n

5

Defines the radius in pixels of the circle for the points. Anchors fit inside the circle.


tip”

ToolTip text”

*See notes

Specifies the text to display in the pop up tool tip.

* Default is “[#x#,#y#] #size#” which displays the X, Y and dot-size values.


halo-size”

0 to n

0

Number of pixels around the anchor to erase forming a gap between the anchor and the line coming in to it.


rotation”

-180 to 180

0

Specifies degrees of rotation to apply to the anchor.


sides”

3 to 360

3

Number of sides of an “anchor” type


width”

0 to n

2

Width of the line drawn for the anchor. 0 is a hairline.


on-click”

user defined text

undefined

Function or URL to invoke when the point is clicked on