Skip to content

Commit

Permalink
Fix display graphs in home page of plugin FusionInventory. closes fus…
Browse files Browse the repository at this point in the history
  • Loading branch information
David Durieux committed Nov 24, 2016
1 parent 04fbc4f commit 68d48d6
Show file tree
Hide file tree
Showing 9 changed files with 4,043 additions and 2,590 deletions.
2 changes: 1 addition & 1 deletion inc/menu.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ static function showChartBar($name, $data, $title='', $width=370) {
echo '<svg style="background-color: #f3f3f3;" id="'.$name.'"></svg>';

echo "<script>
statBar('".$name."', '".json_encode($data)."', '".$title."', '".$width."');
statBar('".$name."', '".json_encode($data)."', '".addslashes($title)."');
</script>";
}
}
Expand Down
6 changes: 3 additions & 3 deletions js/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ function statHalfDonut(svgname, jsondata) {
}


function statBar(svgname, jsondata, title, width) {
function statBar(svgname, jsondata, title) {

nv.addGraph(function() {

var height = 380;
var width = 400,
height = 380;

var chart = nv.models.discreteBarChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.width(width)
.height(height)
.staggerLabels(true)
.tooltips(false)
.showValues(false);

d3.select('#' + svgname)
Expand Down
2 changes: 1 addition & 1 deletion js/stats.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 37 additions & 4 deletions lib/nvd3/nv.d3.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* nvd3 version 1.8.1 (https://github.com/novus/nvd3) 2015-06-15 */
/* nvd3 version 1.8.4 (https://github.com/novus/nvd3) 2016-07-03 */
.nvd3 .nv-axis {
pointer-events:none;
opacity: 1;
Expand Down Expand Up @@ -118,6 +118,7 @@
.nvd3.nv-bullet .nv-measure:hover { fill-opacity: 1; }
.nvd3.nv-bullet .nv-marker { stroke: #000; stroke-width: 2px; }
.nvd3.nv-bullet .nv-markerTriangle { stroke: #000; fill: #fff; stroke-width: 1.5px; }
.nvd3.nv-bullet .nv-markerLine { stroke: #000; stroke-width: 1.5px; }
.nvd3.nv-bullet .nv-tick line { stroke: #666; stroke-width: .5px; }
.nvd3.nv-bullet .nv-range.nv-s0 { fill: #eee; }
.nvd3.nv-bullet .nv-range.nv-s1 { fill: #ddd; }
Expand Down Expand Up @@ -164,6 +165,18 @@
}


.nv-force-node {
stroke: #fff;
stroke-width: 1.5px;
}
.nv-force-link {
stroke: #999;
stroke-opacity: .6;
}
.nv-force-node text {
stroke-width: 0px
}

.nvd3 .nv-legend .nv-disabled rect {
/*fill-opacity: 0;*/
}
Expand Down Expand Up @@ -333,6 +346,16 @@ svg.nvd3-svg {
fill-opacity: .7;
}

/**********
* Print
*/

@media print {
.nvd3 text {
stroke-width: 0;
fill-opacity: 1;
}
}

.nvd3.nv-ohlcBar .nv-ticks .nv-tick {
stroke-width: 1px;
Expand Down Expand Up @@ -408,9 +431,12 @@ svg.nvd3-svg {
stroke-opacity: 1;
}

.nvd3.nv-pie .hover path {
.nvd3.nv-pie path {
fill-opacity: .7;
}
.nvd3.nv-pie .hover path {
fill-opacity: 1;
}
.nvd3.nv-pie .nv-label {
pointer-events: none;
}
Expand Down Expand Up @@ -592,13 +618,20 @@ svg.nvd3-svg {
}

.nvtooltip table td.key {
font-weight:normal;
font-weight: normal;
}
.nvtooltip table td.key.total {
font-weight: bold;
}
.nvtooltip table td.value {
text-align: right;
font-weight: bold;
}

.nvtooltip table td.percent {
color: darkgray;
}

.nvtooltip table tr.highlight td {
padding: 1px 9px 1px 0;
border-bottom-style: solid;
Expand Down Expand Up @@ -638,4 +671,4 @@ Interactive Layer
}
.nvd3 line.nv-guideline {
stroke: #ccc;
}
}
Loading

0 comments on commit 68d48d6

Please sign in to comment.