Skip to content
g0e edited this page Feb 17, 2014 · 1 revision

Dataset Formatting

  • dataset consists array of series
  • like [series1, series2, series3, ...]
  • series is an object that
  • must have values property.
    • values consists array of {x:value, y:value, z:value} (z is optional).
    • value must be Number or Date or String. ccd3 will detect scale-type by this value.
  • may have name property(used in tooltip and legend)
  • may have color property.
  • may have visible property. Default is true.

Dataset Sample

[
	{
		name : "series1",
		color : "red",
		series_type : "bar",
		visible : true, 
		values : [
			{
				x: new Date("2014/01/27"),
				y: 68.15791393164545
			},
			{
				x: new Date("2014/01/28"),
				y: 65.25313461665064
			},
			{
				x: new Date("2014/01-29"),
				y: 84.24908308777958
			},
			{
				x: new Date("2014/01/30"),
				y: 68.07700398843735
			},
			{
				x: new Date("2014/01/31"),
				y: 84.82268058229239
			}
		]
	},
	{
		name : "series2",
		color : "blue",
		series_type : "line",
		visible : true, 
		values : [
			{
				"x": new Date("2014/01/27"),
				"y": 82.89636445231736
			},
			{
				"x": new Date("2014/01/28"),
				"y": 68.83642327971758
			},
			{
				"x": new Date("2014/01/29"),
				"y": 60.396177172660835
			},
			{
				"x": new Date("2014/01/30"),
				"y": 56.29262088797987
			},
			{
				"x": new Date("2014/01/31"),
				"y": 59.04308908618987
			}
		]
	}
]

Clone this wiki locally