2022-04-16 06:59:52 +00:00
|
|
|
accessing
|
|
|
|
exportTweetsHistogramWithBars: aNumberOfBars
|
|
|
|
|
2022-04-20 21:59:57 +00:00
|
|
|
| tweetsByTimeSpan subtotals tweetsHistogram diagram |
|
2022-04-16 17:08:30 +00:00
|
|
|
|
2022-06-08 22:26:29 +00:00
|
|
|
self tweets ifEmpty: [
|
|
|
|
tweetsHistogram := RSChart new.
|
|
|
|
tweetsHistogram extent: 800@200.
|
|
|
|
tweetsHistogram build.
|
|
|
|
tweetsHistogram canvas pdfExporter
|
|
|
|
zoomToShapes;
|
|
|
|
noFixedShapes;
|
|
|
|
fileName: (self folder / 'tweets-histogram.pdf')fullName;
|
|
|
|
export.
|
|
|
|
^ {self. 'self tweets is empty'}
|
|
|
|
].
|
|
|
|
|
2022-04-16 17:08:30 +00:00
|
|
|
tweetsByTimeSpan := self collectMessages: [ self tweets] byTimeSpanSplits: aNumberOfBars.
|
|
|
|
subtotals := tweetsByTimeSpan values collect: [ :collection | collection size ].
|
2022-04-16 06:59:52 +00:00
|
|
|
tweetsHistogram := RSChart new.
|
|
|
|
tweetsHistogram extent: 800@200.
|
2022-04-20 21:59:57 +00:00
|
|
|
diagram := RSBarPlot new
|
|
|
|
y:subtotals.
|
|
|
|
diagram color: (Color r:(91/255) g:(131/255) b:(222/255)).
|
2022-04-16 06:59:52 +00:00
|
|
|
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;
|
2022-04-28 04:51:53 +00:00
|
|
|
fontSize: 72 /aNumberOfBars;
|
2022-04-16 06:59:52 +00:00
|
|
|
yourself).
|
|
|
|
tweetsHistogram addDecoration: (RSVerticalTick new
|
|
|
|
integer;
|
2022-04-28 04:51:53 +00:00
|
|
|
fontSize: 72 /aNumberOfBars).
|
2022-04-16 06:59:52 +00:00
|
|
|
tweetsHistogram build.
|
2022-06-17 22:27:00 +00:00
|
|
|
^ tweetsHistogram canvas exportAsFileNamed: 'tweets-histogram' into: self folder
|