Draw Function:

function drawChart() {
    var jsonData = $.ajax({
        url: "getData_json.php",
        dataType:"json",
        async: false
    }).responseText;
    // Create our data table out of JSON data loaded from server.
    var data = new google.visualization.DataTable(jsonData);
    var options = {
        width:         800,
        height:     480,
        hAxis:         {title: 'Time Remaining (year, month)', 
titleTextStyle: {italic: false}},
        vAxis:      {title: 'Amount outstanding', titleTextStyle: {italic: 
false}, ticks: [0,50,100,150,200,250], gridlines: {color: 'transparent'}}
    };
    var chart = new 
google.visualization.LineChart(document.getElementById('chart_div'));
    chart.draw(data, options);
}

JSON:

{
    "cols": [        
        {"label":"year","type":"string"},
        {"label":"Current Mortgage","type":"number"},
        {"label":"year","type":"string", "role":"tooltip"},
        {"label":"With Overpayments","type":"number"},
        {"label":"year","type":"string", "role":"tooltip"}
    ],
    "rows": [        
        {"c":[{"v":"5"},{"v":250},{"v":"$800K in our first 
year!"},{"v":250},{"v":"$600K in our first year!"}]},
        {"c":[{"v":"10"},{"v":200},{"v":"$800K in our first 
year!"},{"v":230},{"v":"$600K in our first year!"}]},
        {"c":[{"v":"15"},{"v":150},{"v":"$800K in our first 
year!"},{"v":180},{"v":"$600K in our first year!"}]},
        {"c":[{"v":"20"},{"v":100},{"v":"$800K in our first 
year!"},{"v":130},{"v":"$600K in our first year!"}]},
        {"c":[{"v":"25"},{"v":0},{"v":"$800K in our first 
year!"},{"v":100},{"v":"$600K in our first year!"}]},
        {"c":[{"v":"30"},{"v":"undefined"},{"v":"$800K in our first 
year!"},{"v":0},{"v":"$600K in our first year!"}]}
    ]
}


On Monday, February 3, 2014 11:53:41 AM UTC+5:30, Shailendra S. Sengar 
wrote:
>
>
> <https://lh6.googleusercontent.com/-4VWET7fIAOw/Uu813SWxItI/AAAAAAAAAWI/nOIpzGnyeck/s1600/Google-Line-Graph.gif>
> Hi,
>
> I want to add vertical line as shown in the attached image.
> I googled a lot but could not get the solution, please help.
>
> Thanks,
> Shailendra
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to