Last active
July 11, 2016 01:43
-
-
Save avishaan/fd8b991347ff892f595f to your computer and use it in GitHub Desktop.
Dashboard MongoDB object format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// basic json document template | |
var graphBaseTemplate = { | |
'_id': '0012938801abfe', //auto assigned by database | |
'kHospitalName': 'kKaiser', | |
'kHospitalId': '0012938801abf1', | |
'kGraphName': 'kCostSavings', | |
'kGraphId': '0012938801abf2', | |
'kDepartmentName': 'kHospitalWide', | |
'kDepartmentId': '0012938801abf3', | |
'datasets': datasets | |
}; | |
// single line graph | |
datasets = [{ | |
'labels': ['January', 'February', 'March', 'April', 'May', 'June', 'July'], | |
'data': [65, 59, 80, 81, 56, 55, 40], | |
'datetime': ['2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z'] // optional field | |
}]; | |
// single line graph with average | |
datasets = [{ | |
'labels': ['January', 'February', 'March', 'April', 'May', 'June', 'July'], | |
'data': [65, 59, 80, 81, 56, 55, 40], | |
'average': 70 | |
}]; | |
// single bar graph | |
datasets = [{ | |
'labels': ['Physician 1', 'Physician 2', 'Physician 3', 'Physician 4', 'Physician 5'], | |
'data': [65, 59, 80, 81, 56] | |
}]; | |
// two line graph with same labels | |
datasets = [{ | |
'labels': ['January', 'February', 'March', 'April'], | |
'data': [[65, 59], [80, 81], [56, 55], [40, 45]], | |
'datetime': ['2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z'] | |
}]; | |
// two line graph with two labels | |
datasets = [{ | |
'labels': ['January2015', 'February2015', 'March2015', 'April2015', 'May2015', 'June2015', 'July2015'], | |
'data': [65, 59, 80, 81, 56, 55, 40], | |
'datetime': ['2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z'] | |
}, { | |
'labels': ['January2014', 'February2014', 'March2014', 'April2014', 'May2014', 'June2014', 'July2014'], | |
'data': [65, 59, 80, 81, 56, 55, 40], | |
'datetime': ['2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z', '2015-12-22T04:24:58.597Z'] | |
}]; |
don't embed graph level label on each data element (if applicable)
consider adding graph title
consider adding graph subtitle
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
need chart type somewhere in there