Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sbalzarini Lab
S
Software
P
Parallel Computing
OpenFPM
openfpm_io
Commits
223f739a
Commit
223f739a
authored
Jun 08, 2017
by
incardon
Browse files
Adding missing testing files
parent
6ad67146
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Plot/Plot_unit_tests.hpp
View file @
223f739a
...
...
@@ -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
);
}
...
...
test_data/gc_out_sc_test.html
0 → 100644
View file @
223f739a
<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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment