Visualization linechart is going into infinite loop

72 views
Skip to first unread message

Abhishek Agarwal

unread,
Sep 9, 2012, 10:16:10 AM9/9/12
to Google Visualization API
I am drawing a line chart using google visualization line chart. It
draws the graph but somehow it is going into infinite loop.

I am working on the page http://optionstrategy.co.in/optionstrategy.html

I am using a js named options.js which contains all the functions. The
function I am using is drawgooglechart. It is called from function
get_result.

function drawGoogleChart (numColumns,dataArray )
{
var data = new google.visualization.DataTable();
data.addColumn('string', 'Stock Price');
for (chart_cols_cntr=0;chart_cols_cntr<numColumns; chart_cols_cntr++)
{
data.addColumn('number', 'Portfolio Value');
}

data.addRows(dataArray);
var chart = new
google.visualization.LineChart(document.getElementById('chartcontainer'));
chart.draw(data, {curveType: "function",
width: 700, height: 400, title: 'Portfolio Value with Stock
prices', vAxes:[{title:'Portfolio Value',textStyle:{color: 'black'}}],
hAxes:[{title:'Stock Price',textStyle:{color: 'black'}}] });
}

Please find the attached images which show the criteria for selecting
the combobox and clicking on My strategy button.

The image for dataArray is also attached.

Please let me know whether it is some DOM related issue or what else
which is taking it to infinite loop.

Thanks in Advance
Abhishek

Abhishek Agarwal

unread,
Sep 9, 2012, 10:42:54 AM9/9/12
to google-visua...@googlegroups.com
Forgot to attach the images.  Please find them attached. 

Thanks
infinite loop data array.JPG
steps for os.JPG

asgallant

unread,
Sep 9, 2012, 10:14:14 PM9/9/12
to google-visua...@googlegroups.com
I'm not seeing any infinite loop.  All I see is that you have a layout issue: the chart div is being drawn on top of the other page elements, so you lose the interactivity with the form because it is covered.

Abhishek Agarwal

unread,
Sep 10, 2012, 11:13:11 AM9/10/12
to google-visua...@googlegroups.com
Thanks. I have changed the layout and it is working fine now. Once again you were at my rescue.

Thanks a lot.
Abhishek
Reply all
Reply to author
Forward
0 new messages