diff --git a/bar.js b/bar.js index 008cb455..83bed21f 100644 --- a/bar.js +++ b/bar.js @@ -72,6 +72,7 @@ H5P.Chart.BarChart = (function () { if (d.fontColor !== undefined) { return '#' + d.fontColor; } + // Set default color as black return '#000000'; }); @@ -82,7 +83,7 @@ H5P.Chart.BarChart = (function () { // Always scale to available space var style = window.getComputedStyle($wrapper[0]); var width = parseFloat(style.width); - var h = parseFloat(style.height); + var h = parseFloat(style.height)-20; var fontSize = parseFloat(style.fontSize); var lineHeight = (1.25 * fontSize); var tickSize = (fontSize * 0.125); @@ -120,7 +121,7 @@ H5P.Chart.BarChart = (function () { return xScale(i) + xScale.rangeBand() / 2; }) .attr("y", function(d) { - return height - yScale(d.value) + lineHeight; + return height - yScale(d.value) + lineHeight - 20; }); }; } diff --git a/chart.css b/chart.css index ec6fafc1..f0c04d12 100644 --- a/chart.css +++ b/chart.css @@ -1,6 +1,7 @@ .h5p-chart svg { display: block; margin: 0 auto; + padding-top: 20px; } .h5p-chart-chart { font-size: 0.75em; diff --git a/library.json b/library.json index 4829d03f..713b0c60 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "description": "Create different charts", "majorVersion": 1, "minorVersion": 0, - "patchVersion": 1, + "patchVersion": 2, "runnable": 1, "author": "Joubel AS", "license": "MIT", @@ -34,4 +34,4 @@ "minorVersion": 0 } ] -} \ No newline at end of file +} diff --git a/semantics.json b/semantics.json index fdcac218..a1ccf056 100644 --- a/semantics.json +++ b/semantics.json @@ -44,7 +44,7 @@ "type": "text", "widget": "colorSelector", "label": "Color", - "default": "000", + "default": "red", "optional": true }, { @@ -52,7 +52,7 @@ "type": "text", "widget": "colorSelector", "label": "Font Color", - "default": "fff", + "default": "000", "optional": true } ]