Skip to content

Instantly share code, notes, and snippets.

@danswater
Last active November 16, 2017 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danswater/8c2c63f8ec05075f4f77a52ee6888d0e to your computer and use it in GitHub Desktop.
Save danswater/8c2c63f8ec05075f4f77a52ee6888d0e to your computer and use it in GitHub Desktop.

TIMELOGS

Bar Graph response

{
	"title" : {
		"className" : "h4",
		"enable"    : true,
		"text"      : "Monthly Timelog"
	},
	"chart" : {
		"type"   : "multiBarChart",
		"height" : 350,
		"margin" : {
			"top"    : 20,
			"right"  : 20,
			"bottom" : 45,
			"left"   : 45
		},
		"clipEdge"     : true,
		"duration"     : 500,
		"stacked"      : false,
		"showControls" : false,
		"noData"       : "No data available",
		"xAxis"        : {
			"axisLabel"  : "Jobs Status",
			"showMaxMin" : false
		},
		"yAxis" : {
			"axisLabel"         : "Hours",
			"axisLabelDistance" : -20
		}
	},
	"data" : [ {
		"key"    : "Submitted",
		"values" : [ {
			"x" : "Submitted",
			"y" : 0.00
		} ]
	}, {
		"key"    : "Approved",
		"values" : [ {
			"x" : "Approved",
			"y" : 8.00
		} ]
	}, {
		"key"    : "Rejected",
		"values" : [ {
			"x" : "Approved",
			"y" : 0.00
		} ]
	} ]
}

Pie/Donut Graph response

{
	"title" : {
		"className" : "h4",
		"enable"    : true,
		"text"      : "Monthly Timelog"	
	},
	"chart" :{
		"type"               : "pieChart",
		"donut"              : true,
		"height"             : 350,
		"labelSunbeamLayout" : true,
		"labelThreshold"     : 0.01,
		"labelOutside"       : false,
		"legend"             : {
			"align"       : false,
			"updateState" : false
		},
		"noData"             : "No data Available",
		"showLabels"         : true,
		"transitionDuration" : 500
	},
	"data" : [ {
		"x" : "Submitted",
		"y" : "2.50"
	}, {
		"x" : "Approved",
		"y" : "8.00"
	}, {
		"x" : "Rejected",
		"y" : "3.10"
	} ]
}

Line Chart response

{
	"title" : {
		"className" : "h4",
		"enable"    : true,
		"text"      : "Monthly Timelog"
	},
	"chart" : {
		"type"   : "lineChart",
		"height" : 350,
		"margin" : {
			"top"    : 20,
			"right"  : 20,
			"bottom" : 40,
			"left"   : 55
		},
		"useInteractiveGuideline" : true,

		"xAxis" : {
			"axisLabel"  : "Jobs Status",
			"showMaxMin" : false
		},

		"yAxis" : {
			"axisLabel"         : "Hours",
			"axisLabelDistance" : -10
		},
		"noData"             : "No data Available",
		"showLabels"         : true,
		"transitionDuration" : 500
	},
	"data" : [ {
		"values"      : [ {
			"x" : 0,
			"y" : 0
		}, {
			"x" : 1,
			"y" : 0.0998
		} ],
		"key"         : "Submitted",
		"color"       : "#ff7f0e",
		"strokeWidth" : 2,
		"classed"     : "dashed"
	}, {
		"values" : [ {
			"x" : 0,
			"y" : 0.5
		}, {
			"x" : 1,
			"y" : 0.5249
		} ],
		"key"    : "Approved",
		"color"  : "#2ca02c"
	}, {
		"values" : [ {
			"x" : 0,
			"y" : -0.1910
		}, {
			"x" : 1,
			"y" : -0.2255
		} ],
		"key"    : "Rejected",
		"color"  : "#7777ff"
	} ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment