Commit 223f739a authored by incardon's avatar incardon

Adding missing testing files

parent 6ad67146
......@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE( google_chart_bar_string )
//! [Producing an Histogram graph]
bool test = compare("gc_out_sc.html","gc_out_sc_test.html");
bool test = compare("gc_out_sc.html","test_data/gc_out_sc_test.html");
BOOST_REQUIRE_EQUAL(true,test);
}
......
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawVisualization);
function exportToSVG(i)
{
var e = document.getElementById('chart_div'+i);
var svg = e.getElementsByTagName('svg')[0].parentNode.innerHTML;
var pos = svg.lastIndexOf("</svg>");
pos += 6;
svg = svg.substring(0,4) + " xmlns='http://www.w3.org/2000/svg' xmlns:xlink= 'http://www.w3.org/1999/xlink' " + svg.substring(4,pos);
svgData = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg);
$(this).attr({'href': svgData,'target': '_blank'});
}
function drawVisualization() {
var data0 = new google.visualization.DataTable();
data0.addColumn('string','X Axis');
data0.addColumn('number','dataset1');
data0.addColumn('number','dataset2');
data0.addColumn('number','dataset3');
data0.addColumn('number','dataset4');
data0.addRows([
['colum1',2,3,5,6],
['colum2',5,6,1,6],
['colum3',2,1,6,9],
['colum4',1,6,3,2],
['colum5',3,3,0,6],
['colum6',2,1,4,6],
]);
var options0= {
title : 'Example',
vAxis: {title: 'Y Axis'},
hAxis: {title: 'X Axis'},
seriesType: 'bars',
series: {3: {type: 'line'}}};
var view0 = new google.visualization.DataView(data0);
view0.setColumns([0
,1,{ calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation" }
,2,{ calc: "stringify",
sourceColumn: 2,
type: "string",
role: "annotation" }
,3,{ calc: "stringify",
sourceColumn: 3,
type: "string",
role: "annotation" }
]
);
$("#export_svg0").on("click", function (event) {exportToSVG.apply(this,[0]);});
var chart = new google.visualization.ComboChart(document.getElementById('chart_div0'));
chart.draw(view0, options0);
}</script>
</head>
<body>
<a href="#" download="graph1.svg" id="export_svg0"><button>Export data into svg</button></a><div id="chart_div0" style="width: 900px; height: 500px;"></div>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment