Created
March 31, 2020 02:18
-
-
Save seandenigris/d7b25f34613a50210d52f595371db4d0 to your computer and use it in GitHub Desktop.
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
onsets := { | |
'14 March 2020'. | |
'17 March 2020'. | |
'18 March 2020'. | |
'19 March 2020'. | |
'16 March 2020'. | |
'20 March 2020'. | |
'21 March 2020'. | |
'18 March 2020'. | |
'21 March 2020'. | |
'24 March 2020'. | |
'21 March 2020'. | |
'24 March 2020'. | |
'24 March 2020'. | |
'24 March 2020' } collect: #asDate. | |
dso := DataSeries withValues: onsets. | |
perDate := dso valueCounts sortAssociations: [ :a :b | a key < b key ]. | |
sum := 0. | |
forFrame := perDate collect: [ :e | sum := sum + e ]. | |
f := DataFrame withColumns: { forFrame values } columnNames: { 'newCases' }. | |
f rowNames: forFrame keys. | |
chart := RSChart new. | |
chart extent: 400@250. | |
chart addPlot:(RSLinePlot new x: (1 to: f size) y: (f column: #newCases) values). | |
chart addDecoration: (RSHorizontalTick new fromNames: ((f column: #newCases) keys collect: #asString)). | |
chart show. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment