/*
Assuming userInfo object's previousVisitData will be replaced by:
previousVisitLevels
previousVisitEvalResults
*/

//Examples to work from:
//visitLevels: [2, 4, 7, 8];
//visitEvalResults: [6, 5, 5, 4];

function generateChartData(visitInfo) {     //where parameter visitInfo is either visitLevels or visitEvalResults
    var chartData = {};
    chartData.visits = [];
    for (var aa=1; aa<=userInfo[visitInfo].length; aa++) {
        charttData.visits.push('Visit ' + aa);
    }
    if (visitInfo = visitLevels) {
        chartData.axisTitle = 'Max Level Reached';
    } else {
        chartData.axisTitle = 'Phobic Index';
    }
}

@@ -508,24 +508,88 @@
 itLevels) %7B%0A
+        chartData.chartTitle = 'Highest Level Reached By Visit'%0A
         char
@@ -611,11 +611,15 @@
  = '
-Max
+Highest
  Lev
@@ -634,72 +634,336 @@
 ed';
-%0A    %7D else %7B%0A        chartData.axisTitle = 'Phobic Index';%0A    %7D
+ //Not sure if this will be x-axis or y-axis, but it is the non-%22Visit%22 axis%0A        chartData.dataPoints = userInfo.visitLevels;%0A    %7D else %7B%0A        chartData.chartTitle = 'Phobic Index By Visit'%0A        chartData.axisTitle = 'Phobic Index';%0A        chartData.dataPoints = userInfo.visitEvalResults;%0A    %7D%0A    return chartData;
 %0A%7D%0A

Complete function generateChartData, which is to be used for both charts