2022-04-18 22:29:09 +00:00
|
|
|
accessing
|
|
|
|
exportRepliesHistogramWithBars: aNumberOfBars
|
|
|
|
|
2022-04-20 21:59:57 +00:00
|
|
|
| tweetsByTimeSpan subtotals tweetsHistogram diagram |
|
2022-04-18 22:29:09 +00:00
|
|
|
|
|
|
|
tweetsByTimeSpan := self collectMessages: [ self replies ] byTimeSpanSplits: aNumberOfBars.
|
|
|
|
subtotals := tweetsByTimeSpan values collect: [ :collection | collection size ].
|
|
|
|
tweetsHistogram := RSChart new.
|
|
|
|
tweetsHistogram extent: 800@200.
|
2022-04-20 21:59:57 +00:00
|
|
|
diagram := RSBarPlot new
|
|
|
|
x: (1 to: subtotals size)
|
|
|
|
y:subtotals.
|
|
|
|
diagram color: (Color r:(246/255) g:(185/255) b:(46/255)).
|
2022-04-18 22:29:09 +00:00
|
|
|
tweetsHistogram addPlot: diagram.
|
|
|
|
tweetsHistogram addDecoration: (RSHorizontalTick new
|
|
|
|
fromNames: tweetsByTimeSpan keys;
|
|
|
|
labelRotation: 0;
|
2022-04-28 04:51:53 +00:00
|
|
|
fontSize: 72 /aNumberOfBars;
|
2022-04-18 22:29:09 +00:00
|
|
|
yourself).
|
|
|
|
tweetsHistogram addDecoration: (RSVerticalTick new
|
|
|
|
integer;
|
2022-04-28 04:51:53 +00:00
|
|
|
fontSize: 72 /aNumberOfBars).
|
2022-04-18 22:29:09 +00:00
|
|
|
tweetsHistogram build.
|
|
|
|
tweetsHistogram canvas pngExporter
|
|
|
|
zoomToShapes;
|
|
|
|
noFixedShapes;
|
|
|
|
fileName: (self folder / 'replies-histogram.png')fullName;
|
|
|
|
export.
|
2022-04-19 00:19:49 +00:00
|
|
|
tweetsHistogram canvas pdfExporter
|
|
|
|
zoomToShapes;
|
|
|
|
noFixedShapes;
|
|
|
|
fileName: (self folder / 'replies-histogram.pdf')fullName;
|
|
|
|
export.
|
2022-04-18 22:29:09 +00:00
|
|
|
^ self folder / 'replies-histogram.png'
|