1. John Louis del Rosario
  2. expenses

Commits

John Louis del Rosario  committed f7f4b05

added render() method

  • Participants
  • Parent commits 230c015
  • Branches default

Comments (0)

Files changed (2)

File ExpenseRenderer.pde

View file
     init();
   }
 
+  public void render(Expense[] expenses){
+    plotPoints(expenses);
+  }
+
   private void init(){
     ep = new ExpenseParser("Expenses.csv");
     drawGraph();
   /*
    * Plot the expenses on the graph
    */
-  private void plotPoints(){
+  private void plotPoints(Expense[] expenses){
     fill(255);
-    Expense[] expenses = ep.getAllExpenses();
     println(expenses.length);
     for (int i = 0; i < expenses.length; i++){
       int year = expenses[i].getDate().getYear();

File expenses.pde

View file
 void setup(){
+  ExpenseParser ep = new ExpenseParser("Expenses.csv");
   ExpenseRenderer er = new ExpenseRenderer(400, 400);
   //ep.getExpensesForDate("1/1/2011");
-  //ep.getExpensesForDateRange("1/1/2011", "3/31/2011");
+  Expense[] expenses = ep.getExpensesForDateRange("1/1/2011", "1/31/2011");
+  er.render(expenses);
 }