Commits

John Louis del Rosario committed d5d3905

add color

  • Participants
  • Parent commits f7f4b05

Comments (0)

Files changed (2)

File ExpenseRenderer.pde

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

File expenses.pde

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