Getting chart data to work within a function
<p>Hey all i am in need of some help trying to figure out how to pass a string into an array field for a chart. The chart i am using is this [http://www.highcharts.com/]</p>

<p>Here is the chart code:</p>

<pre><code> function drawChart(theDATA)
    {
        var chart = new Highcharts.Chart({
            chart: {renderTo: 'container',defaultSeriesType: 'column'},
            title: {text: 'March 2010 Confirmed User Visit\'s'},
            xAxis: {categories: ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31']},
            yAxis: {min: 0,title: {text: 'User Visit\'s'}},
            legend: {layout: 'vertical',backgroundColor: '#FFFFFF',style: {left: '100px',top: '70px',bottom: 'auto'}},
            tooltip: {formatter: function() {return this.y;}},
            plotOptions: {column: {pointPadding: 0.2,borderWidth: 0}},
                series: [{name: 'Confirmed Users Visit\'s',
                data: [theDATA]
            }]
        }); 
    }
</code></pre>

<p>With the code above, you would think that theDATA would work but it does not display the data within it.</p>

<p>Say that theDATA is '2,5,4,7,8,9'. If i had this:</p>

<pre><code> data: [2,5,4,7,8,9]
</code></pre>

<p>Then it would work just fine. But if i use those same numbers...</p>

<pre><code>theData = "2,5,4,7,8,9"
data: [theData]
</code></pre>

<p>It does nothing on the chart...</p>

<p>So what am i doing wrong????</p>

<p>David</p>

<p><b>EDIT</p>

<p>Added</p>

<pre><code> var theDATA = theDATA.split(",");
 for ( var t = 0; t &lt; theDATA.length; ++t ) theDATA[t] = parseInt(theDATA[t]);
</code></pre>

<p>so...</p>

<pre><code>function drawChart(theDATA)
{
 var theDATA = theDATA.split(",");
 for ( var t = 0; t &lt; theDATA.length; ++t ) theDATA[t] = parseInt(theDATA[t]);

    var chart = new Highcharts.Chart({
        chart: {renderTo: 'container',defaultSeriesType: 'column'},
        title: {text: 'March 2010 Confirmed User Visit\'s'},
        xAxis: {categories: ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31']},
        yAxis: {min: 0,title: {text: 'User Visit\'s'}},
        legend: {layout: 'vertical',backgroundColor: '#FFFFFF',style: {left: '100px',top: '70px',bottom: 'auto'}},
        tooltip: {formatter: function() {return this.y;}},
        plotOptions: {column: {pointPadding: 0.2,borderWidth: 0}},
            series: [{name: 'Confirmed Users Visit\'s',
            data: [theDATA]
        }]
    }); 
}
</code></pre>

<p></b></p>
