Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openfpm_io
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openfpm
openfpm_io
Commits
f02a479f
Commit
f02a479f
authored
Mar 01, 2017
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New colums with numbers
parent
b03ba0d2
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
67 additions
and
24 deletions
+67
-24
gc_out2_test.html
gc_out2_test.html
+2
-1
gc_out3_test.html
gc_out3_test.html
+2
-1
gc_out4_test.html
gc_out4_test.html
+2
-1
gc_out5_test.html
gc_out5_test.html
+2
-1
gc_out6_test.html
gc_out6_test.html
+2
-1
gc_out7_test.html
gc_out7_test.html
+6
-3
gc_out_test.html
gc_out_test.html
+2
-1
gc_plot2_out_test.html
gc_plot2_out_test.html
+2
-1
gc_plot_out_test.html
gc_plot_out_test.html
+2
-1
src/Plot/GoogleChart.hpp
src/Plot/GoogleChart.hpp
+42
-10
src/Plot/Plot_unit_tests.hpp
src/Plot/Plot_unit_tests.hpp
+3
-3
No files found.
gc_out2_test.html
View file @
f02a479f
...
@@ -38,7 +38,8 @@ vAxis: {title: 'Y Axis'},
...
@@ -38,7 +38,8 @@ vAxis: {title: 'Y Axis'},
hAxis
:
{
title
:
'
X Axis
'
},
hAxis
:
{
title
:
'
X Axis
'
},
seriesType
:
'
bars
'
};
seriesType
:
'
bars
'
};
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
}
</script>
}
</script>
</head>
</head>
<body>
<body>
...
...
gc_out3_test.html
View file @
f02a479f
...
@@ -38,7 +38,8 @@ vAxis: {title: 'Y Axis'},
...
@@ -38,7 +38,8 @@ vAxis: {title: 'Y Axis'},
hAxis
:
{
title
:
'
X Axis
'
},
hAxis
:
{
title
:
'
X Axis
'
},
seriesType
:
''
};
seriesType
:
''
};
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
}
</script>
}
</script>
</head>
</head>
<body>
<body>
...
...
gc_out4_test.html
View file @
f02a479f
...
@@ -38,7 +38,8 @@ vAxis: {title: ''},
...
@@ -38,7 +38,8 @@ vAxis: {title: ''},
hAxis
:
{
title
:
''
},
hAxis
:
{
title
:
''
},
seriesType
:
''
};
seriesType
:
''
};
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
}
</script>
}
</script>
</head>
</head>
<body>
<body>
...
...
gc_out5_test.html
View file @
f02a479f
...
@@ -38,7 +38,8 @@ vAxis: {title: ''},
...
@@ -38,7 +38,8 @@ vAxis: {title: ''},
hAxis
:
{
title
:
''
},
hAxis
:
{
title
:
''
},
seriesType
:
''
};
seriesType
:
''
};
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
}
</script>
}
</script>
</head>
</head>
<body>
<body>
...
...
gc_out6_test.html
View file @
f02a479f
...
@@ -38,7 +38,8 @@ vAxis: {title: ''},
...
@@ -38,7 +38,8 @@ vAxis: {title: ''},
hAxis
:
{
title
:
''
},
hAxis
:
{
title
:
''
},
seriesType
:
''
};
seriesType
:
''
};
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
}
</script>
}
</script>
</head>
</head>
<body>
<body>
...
...
gc_out7_test.html
View file @
f02a479f
...
@@ -79,11 +79,14 @@ hAxis: {title: 'X Axis'},
...
@@ -79,11 +79,14 @@ hAxis: {title: 'X Axis'},
seriesType
:
'
bars
'
,
seriesType
:
'
bars
'
,
series
:
{
3
:
{
type
:
'
line
'
}}};
series
:
{
3
:
{
type
:
'
line
'
}}};
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
$
(
"
#export_svg1
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
1
]);});
$
(
"
#export_svg1
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
1
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div1
'
));
chart
.
draw
(
data1
,
options1
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div1
'
));
chart
.
draw
(
data1
,
options1
);
$
(
"
#export_svg2
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
2
]);});
$
(
"
#export_svg2
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
2
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div2
'
));
chart
.
draw
(
data2
,
options2
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div2
'
));
chart
.
draw
(
data2
,
options2
);
}
</script>
}
</script>
</head>
</head>
<body>
<body>
...
...
gc_out_test.html
View file @
f02a479f
...
@@ -39,7 +39,8 @@ hAxis: {title: 'X Axis'},
...
@@ -39,7 +39,8 @@ hAxis: {title: 'X Axis'},
seriesType
:
'
bars
'
,
seriesType
:
'
bars
'
,
series
:
{
3
:
{
type
:
'
line
'
}}};
series
:
{
3
:
{
type
:
'
line
'
}}};
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
}
</script>
}
</script>
</head>
</head>
<body>
<body>
...
...
gc_plot2_out_test.html
View file @
f02a479f
...
@@ -45,7 +45,8 @@ curveType: 'function',
...
@@ -45,7 +45,8 @@ curveType: 'function',
lineWidth
:
1
,
lineWidth
:
1
,
intervals
:
{
'
style
'
:
'
area
'
}};
intervals
:
{
'
style
'
:
'
area
'
}};
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
}
</script>
}
</script>
</head>
</head>
<body>
<body>
...
...
gc_plot_out_test.html
View file @
f02a479f
...
@@ -47,7 +47,8 @@ intervals: { 'style':'area' },
...
@@ -47,7 +47,8 @@ intervals: { 'style':'area' },
interval
:
{
'
i2
'
:
{
'
color
'
:
'
#4374E0
'
,
'
style
'
:
'
bars
'
,
'
lineWidth
'
:
4
,
'
fillOpacity
'
:
1
}
}
interval
:
{
'
i2
'
:
{
'
color
'
:
'
#4374E0
'
,
'
style
'
:
'
bars
'
,
'
lineWidth
'
:
4
,
'
fillOpacity
'
:
1
}
}
};
};
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
$
(
"
#export_svg0
"
).
on
(
"
click
"
,
function
(
event
)
{
exportToSVG
.
apply
(
this
,[
0
]);});
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
var
chart
=
new
google
.
visualization
.
ComboChart
(
document
.
getElementById
(
'
chart_div0
'
));
chart
.
draw
(
data0
,
options0
);
}
</script>
}
</script>
</head>
</head>
<body>
<body>
...
...
src/Plot/GoogleChart.hpp
View file @
f02a479f
...
@@ -258,20 +258,22 @@ class GoogleChart
...
@@ -258,20 +258,22 @@ class GoogleChart
*/
*/
std
::
string
get_view_bar_option
(
const
GCoptions
&
opt
,
size_t
n_col
)
std
::
string
get_view_bar_option
(
const
GCoptions
&
opt
,
size_t
n_col
)
{
{
if
(
opt
.
barWD
==
false
)
return
std
::
string
();
std
::
stringstream
str
;
std
::
stringstream
str
;
str
<<
"
view.setColumns([0,
"
<<
std
::
endl
;
str
<<
"
[0
"
<<
std
::
endl
;
for
(
size_t
i
=
0
;
i
<
n_col
;
i
++
)
for
(
size_t
i
=
1
;
i
<
n_col
;
i
++
)
{
{
str
<<
","
<<
i
<<
",{ calc:
\"
stringify
\"
,"
<<
std
::
endl
;
str
<<
i
<<
",{ calc:
\"
stringify
\"
,"
<<
std
::
endl
;
str
<<
"sourceColumn: "
<<
i
<<
","
<<
std
::
endl
;
str
<<
"sourceColumn: "
<<
i
<<
","
<<
std
::
endl
;
str
<<
"type:
\"
string
\"
,"
<<
std
::
endl
;
str
<<
"type:
\"
string
\"
,"
<<
std
::
endl
;
str
<<
"role:
\"
annotation
\"
}"
<<
std
::
endl
;
str
<<
"role:
\"
annotation
\"
}"
<<
std
::
endl
;
}
}
str
<<
"]
);
"
<<
std
::
endl
;
str
<<
"]"
<<
std
::
endl
;
return
str
.
str
();
return
str
.
str
();
}
}
...
@@ -344,19 +346,46 @@ class GoogleChart
...
@@ -344,19 +346,46 @@ class GoogleChart
of
<<
"};
\n
"
;
of
<<
"};
\n
"
;
}
}
/*! \brief Add a view data variable
*
* \param of file out
* \param i id
* \param view string
*
*/
void
addView
(
std
::
ofstream
&
of
,
size_t
i
,
std
::
string
view
)
{
if
(
view
.
size
()
==
0
)
return
;
of
<<
"var view"
<<
i
<<
" = new google.visualization.DataView(data"
<<
i
<<
");"
<<
std
::
endl
;
of
<<
"view"
<<
i
<<
".setColumns("
;
of
<<
view
<<
");"
<<
std
::
endl
;
}
/*! \brief Add a draw div section
/*! \brief Add a draw div section
*
*
* \param of file out
* \param of file out
* \param i id
* \param i id
* \param draw_view draw a chart(true) or view(false)
*
*
*/
*/
void
addDrawDiv
(
std
::
ofstream
&
of
,
size_t
i
)
void
addDrawDiv
(
std
::
ofstream
&
of
,
size_t
i
,
bool
draw_view
)
{
{
of
<<
"$(
\"
#export_svg"
<<
i
<<
"
\"
).on(
\"
click
\"
, function (event) {exportToSVG.apply(this,["
<<
i
<<
"]);});
\n
"
;
of
<<
"$(
\"
#export_svg"
<<
i
<<
"
\"
).on(
\"
click
\"
, function (event) {exportToSVG.apply(this,["
<<
i
<<
"]);});
\n
"
;
of
<<
"var chart = new google.visualization.ComboChart(document.getElementById('chart_div"
;
of
<<
"var chart = new google.visualization.ComboChart(document.getElementById('chart_div"
;
of
<<
i
;
of
<<
i
;
of
<<
"'));chart.draw(data"
;
of
<<
"'));"
<<
std
::
endl
;
of
<<
i
;
if
(
draw_view
==
true
)
{
of
<<
"chart.draw(data"
;
of
<<
i
;
}
else
{
of
<<
"chart.draw(view"
;
of
<<
i
;
}
of
<<
", options"
;
of
<<
", options"
;
of
<<
i
;
of
<<
i
;
of
<<
");
\n
"
;
of
<<
");
\n
"
;
...
@@ -471,7 +500,7 @@ public:
...
@@ -471,7 +500,7 @@ public:
set_of_graphs
.
last
().
type
=
GGRAPH_COLUMS
;
set_of_graphs
.
last
().
type
=
GGRAPH_COLUMS
;
set_of_graphs
.
last
().
data
=
get_points_plot_data
(
x
,
y
,
yn
,
opt
,
set_of_graphs
.
size
()
-
1
);
set_of_graphs
.
last
().
data
=
get_points_plot_data
(
x
,
y
,
yn
,
opt
,
set_of_graphs
.
size
()
-
1
);
set_of_graphs
.
last
().
option
=
get_colums_bar_option
(
opt
);
set_of_graphs
.
last
().
option
=
get_colums_bar_option
(
opt
);
set_of_graphs
.
last
().
view
=
get_view_bar_option
(
opt
);
set_of_graphs
.
last
().
view
=
get_view_bar_option
(
opt
,
y
.
get
(
0
).
size
()
);
set_of_graphs
.
last
().
opt
=
opt
;
set_of_graphs
.
last
().
opt
=
opt
;
}
}
...
@@ -633,7 +662,10 @@ public:
...
@@ -633,7 +662,10 @@ public:
addOption
(
of
,
i
,
set_of_graphs
.
get
(
i
).
option
);
addOption
(
of
,
i
,
set_of_graphs
.
get
(
i
).
option
);
for
(
size_t
i
=
0
;
i
<
set_of_graphs
.
size
()
;
i
++
)
for
(
size_t
i
=
0
;
i
<
set_of_graphs
.
size
()
;
i
++
)
addDrawDiv
(
of
,
i
);
addView
(
of
,
i
,
set_of_graphs
.
get
(
i
).
view
);
for
(
size_t
i
=
0
;
i
<
set_of_graphs
.
size
()
;
i
++
)
addDrawDiv
(
of
,
i
,
set_of_graphs
.
get
(
i
).
view
.
size
()
==
0
);
of
<<
begin_div
;
of
<<
begin_div
;
...
...
src/Plot/Plot_unit_tests.hpp
View file @
f02a479f
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
BOOST_AUTO_TEST_SUITE
(
plot_unit_test
)
BOOST_AUTO_TEST_SUITE
(
plot_unit_test
)
BOOST_AUTO_TEST_CASE
(
google_chart
)
BOOST_AUTO_TEST_CASE
(
google_chart
_bar_string
)
{
{
//! [Producing an Histogram graph]
//! [Producing an Histogram graph]
...
@@ -58,11 +58,11 @@ BOOST_AUTO_TEST_CASE( google_chart )
...
@@ -58,11 +58,11 @@ BOOST_AUTO_TEST_CASE( google_chart )
GoogleChart
cg
;
GoogleChart
cg
;
cg
.
AddHistGraph
(
x
,
y
,
yn
,
options
);
cg
.
AddHistGraph
(
x
,
y
,
yn
,
options
);
cg
.
write
(
"gc_out_
wd
.html"
);
cg
.
write
(
"gc_out_
sc
.html"
);
//! [Producing an Histogram graph]
//! [Producing an Histogram graph]
bool
test
=
compare
(
"gc_out_
wd.html"
,
"gc_out_wd
_test.html"
);
bool
test
=
compare
(
"gc_out_
sc.html"
,
"gc_out_sc
_test.html"
);
BOOST_REQUIRE_EQUAL
(
true
,
test
);
BOOST_REQUIRE_EQUAL
(
true
,
test
);
}
}
...
...
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