2022-04-16 06:59:52 +00:00
|
|
|
accessing
|
|
|
|
exportTweetsHistogramWithBars: aNumberOfBars
|
|
|
|
|
2022-04-16 17:08:30 +00:00
|
|
|
| tweetsByTimeSpan subtotals tweetsColor x tweetsHistogram diagram |
|
|
|
|
|
|
|
|
tweetsByTimeSpan := self collectMessages: [ self tweets] byTimeSpanSplits: aNumberOfBars.
|
|
|
|
subtotals := tweetsByTimeSpan values collect: [ :collection | collection size ].
|
2022-04-16 06:59:52 +00:00
|
|
|
tweetsColor := (Color r:(91/255) g:(131/255) b:(222/255)).
|
|
|
|
x := 1 to: subtotals size.
|
|
|
|
tweetsHistogram := RSChart new.
|
|
|
|
tweetsHistogram extent: 800@200.
|
|
|
|
diagram := RSBarPlot new x: x y:subtotals.
|
|
|
|
diagram color: tweetsColor.
|
|
|
|
tweetsHistogram addPlot: diagram.
|
|
|
|
tweetsHistogram addDecoration: (RSHorizontalTick new
|
2022-04-16 17:08:30 +00:00
|
|
|
fromNames: tweetsByTimeSpan keys;
|
2022-04-16 06:59:52 +00:00
|
|
|
labelRotation: 0;
|
|
|
|
fontSize: 80 /aNumberOfBars;
|
|
|
|
yourself).
|
|
|
|
tweetsHistogram addDecoration: (RSVerticalTick new
|
|
|
|
integer;
|
|
|
|
fontSize: 80 /aNumberOfBars).
|
|
|
|
tweetsHistogram build.
|
2022-04-18 22:29:09 +00:00
|
|
|
tweetsHistogram canvas pngExporter
|
2022-04-16 06:59:52 +00:00
|
|
|
zoomToShapes;
|
|
|
|
noFixedShapes;
|
2022-04-18 22:29:09 +00:00
|
|
|
fileName: (self folder / 'tweets-histogram.png')fullName;
|
2022-04-16 06:59:52 +00:00
|
|
|
export.
|
2022-04-18 22:29:09 +00:00
|
|
|
^ self folder / 'tweets-histogram.png'
|