I am doing a site in PHP and have a graph module. I have done the graph module in that x-axis values and y-axis values are passed as array like:
<script type="text/javascript">
var chart;
var chartData = [{
year: 2005,
income: 23.5
}, {
year: 2006,
income: 26.2
}, {
year: 2007,
income: 30.1
}, {
year: 2008,
income: 29.5
}, {
year: 2009,
income: 24.6
}];
</script>
How can I make this array dynamic in JavaScript?
I have added the code here: http://jsfiddle.net/soumyamohanan/YDmnR/7/ but it is not working, so i have uploaded the graph to a server: http://rapidsurfing.net/mivotv/graph/bar3D.html
Any help will be appeciated.
EDITED:
Updated fiddle can be found here.
According to your comment, this should be what you wanted: