Last active
February 18, 2020 16:52
-
-
Save typpo/f7ada53b1d2a3bf2ed0f1ff7446fc6f5 to your computer and use it in GitHub Desktop.
Chart.js example
This file contains 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
{ | |
"type": "line", | |
"data": { | |
"labels": [ "", "", "", "", "", "", "", "" ], | |
"datasets": [ | |
{ | |
"label": "comments", | |
"borderColor": "blue", | |
"yAxisID": "A", | |
"data": [ 0, 1, 1, 1, 2, 3, 4, 4 ], | |
"fill": false, | |
"borderWidth": 1 | |
}, | |
{ | |
"label": "retweets", | |
"borderColor": "green", | |
"backgroundColor": "#ff8c00", | |
"pointBorderColor": "#ff8c00", | |
"yAxisID": "B", | |
"data": [ 80, 261, 357, 475, 501, 514, 527, 535 ], | |
"pointRadius": [ 0, 0, 5, 0, 0, 0, 0, 0 ], | |
"fill": false, | |
"borderWidth": 1 | |
} | |
] | |
}, | |
"options": { | |
"legend": { | |
"position": "right", | |
"labels": { | |
"boxWidth": 5, | |
"fontSize": 8, | |
"padding": 5 | |
} | |
}, | |
"layout": { | |
"padding": { | |
"bottom": -20 | |
} | |
}, | |
"elements": { | |
"point": { | |
"radius": 0 | |
} | |
}, | |
"scales": { | |
"xAxes": [ | |
{ | |
"gridLines": { | |
"color": "transparent" | |
} | |
} | |
], | |
"yAxes": [ | |
{ | |
"id": "A", | |
"position": "left", | |
"gridLines": { | |
"color": "transparent", | |
"tickMarkLength": 5 | |
}, | |
"ticks": { | |
"min": 0, | |
"max": 6, | |
"maxTicksLimit": 1, | |
"precision": 0, | |
"fontSize": 8, | |
"fontColor": "blue", | |
} | |
}, | |
{ | |
"id": "B", | |
"position": "right", | |
"gridLines": { | |
"color": "transparent", | |
"tickMarkLength": 5 | |
}, | |
"ticks": { | |
"min": 0, | |
"max": 535, | |
"maxTicksLimit": 1, | |
"fontSize": 8, | |
"fontColor": "green", | |
} | |
} | |
] | |
}, | |
"annotation": { | |
"annotations": [ | |
{ | |
"type": "box", | |
"yScaleID": "A", | |
"yMin": 0, | |
"yMax": 3, | |
"backgroundColor": "#E0E0FF66", | |
"borderColor": "transparent" | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment