Skip to content

Instantly share code, notes, and snippets.

@zeroflag
Created December 31, 2021 14:26
Show Gist options
  • Save zeroflag/be9a0cfc3f8c8c94d57f35b740217267 to your computer and use it in GitHub Desktop.
Save zeroflag/be9a0cfc3f8c8c94d57f35b740217267 to your computer and use it in GitHub Desktop.
ExpensePlot new
x: #key ;
y: #value;
data: ((self firstMonth to: self lastMonth) collect: [:i | i -> (self month: i) sum ]);
plot.
((self firstMonth to: self lastMonth) collect: [:i | (self month: i) totalFood ]) average.
((self firstMonth to: self lastMonth) collect: [:i | (self month: i) totalHousingExpense ]) average.
((self firstMonth to: self lastMonth) collect: [:i | (self month: i) totalMedical ]) average.
((self firstMonth to: self lastMonth) collect: [:i | (self month: i) totalEntertainment ]) average.
((self firstMonth to: self lastMonth) collect: [:i | ((self month: i) ) sum ]) average.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment