简体   繁体   中英

Why does Google Chart API only show legend for pie chart?

I am trying to load a pie chart in an ASP.NET webpage using the following URL: http://chart.apis.google.com/chart?cht=p3&chs=340x140&chdl=field1%7Cfield2%7Cfield3%7Cfield4&chl=100%%25%7C0%%25%7C0%%25%7C0%%25&chco=B32222|CC5C5C|BFBFBF|696969&chtt=&chts=000000,24&chd=t:100%,0%,0%,0% . However, it only shows the legend for the chart, and not the chart itself. As you can see from the URL, there are valid values being passed. Could anyone explain why this is happening?

This is the context in which the URL is being used:

 google.maps.event.addListener(marker, "click", function () {
 '<div id="chartDiv">' + //Pie chart image

                 '<img src="http://chart.apis.google.com/chart?cht=p3&chs=340x140&chdl=field1%7Cfield2%7Cfield3%7Cfield4&chl='
                 + field1+
                 '%25%7C'
                 + field2+
                 '%25%7C'
                 + field3+
                 '%25%7C'
                 + field4+
                 '%25&chco=B32222|CC5C5C|BFBFBF|696969&chtt=&chts=000000,24&chd=t:'
                 + field1+ ',' + field2+ ',' + field3 + ',' + field4 +
                 '" />' +



                '</div>' +   // End of chartdiv
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM