Open Flash Chart :: wiki :: JSON :: elements

Bar Charts

All bar charts share these attributes.

{
	"type":		"bar_cylinder" /* string */,
	values:		[] /* array */,
	colour:		'#3030d0' /* string */,
	text:		'' /* string */,		// <-- default not display a key
	'font-size':	12,
	tip:		'#val#<br>#x_label#' /* string */,
	alpha:		0.6,
	'on-click':	null /* string */,
	'axis':		'left' /* string */
}

To specify a particular bar chart you need to set the type value to one of the following strings:

  • 'bar'
  • 'bar_stack'
  • 'bar_sketch':
  • 'bar_glass'
  • 'bar_cylinder'
  • 'bar_cylinder_outline'
  • 'bar_dome'
  • 'bar_round'
  • 'bar_round_glass'
  • 'bar_round3d'
  • 'bar_fade'
  • 'bar_3d'
  • 'bar_filled'
  • 'bar_plastic'
  • 'bar_plastic_flat'
  • 'candle'

The values array can hold numbers or an object that looks like:

{
	colour:		/* if not set inherited from parent */,
	tip:		/* if not set inherited from parent */,
	alpha:		/* if not set inherited from parent */,
	'on-click':	/* if not set inherited from parent */,
	axis:		/* if not set inherited from parent */,
	'on-show':	/* if not set inherited from parent */,
	top:		/* number */,
	bottom:		/* number */
}

Axis should not be set in each bar. Just let all bars inherit from the parent object.

Examples

"elements":[
    {
      "type":      "bar_cylinder",
      "alpha":     0.5,
      "colour":    "#9933CC",
      "text":      "Page views",
      "font-size": 10,
      "values" :   [5,{"top":7,"colour":"#A03030","tip":"#top#<br>hello"},-6,null,7]
    },
    {
      "type":      "bar_cylinder_outline",
      "alpha":     0.7,
      "colour":    "#3030FF",
      "text":      "Page views 2",
      "font-size": 10,
      "values" :   [4,9,9,-6,9]
    },
    {
      "type":      "bar_round_glass",
      "alpha":     0.7,
      "colour":    "#CC0000",
      "values" :   [6,5,7,-5]
    }
]