Created
January 10, 2014 03:58
-
-
Save mikeminutillo/8346775 to your computer and use it in GitHub Desktop.
Embed Google Chart API graph into LINQPad Results window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Util.RawHtml(@"<script type=""text/javascript"" src=""https://www.google.com/jsapi""></script>").Dump(); | |
Util.RawHtml(@"<div id=""chart_div"" style=""width: 1024px; height: 1024px;""></div>").Dump(); | |
var script = new StringBuilder(); | |
script.AppendLine(@" | |
<script type=""text/javascript""> | |
google.load(""visualization"", ""1"", {packages:[""corechart""]}); | |
google.setOnLoadCallback(drawChart); | |
function drawChart() { | |
var data = google.visualization.arrayToDataTable([ | |
['ID', 'X', 'Y', 'Series', 'Size'], | |
['', 80, 167, '', 120], | |
['', 79, 136, '', 130], | |
['', 78, 184, '', 50], | |
['', 72, 278, '', 230], | |
['', 81, 200, '', 210], | |
['', 72, 170, '', 100], | |
['', 68, 477, '', 80] | |
]); | |
var options = { | |
}; | |
var chart = new google.visualization.BubbleChart(document.getElementById('chart_div')); | |
chart.draw(data, options); | |
} | |
</script>"); | |
Util.RawHtml(script.ToString()).Dump(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment