diff --git a/.gitignore b/.gitignore
index 66fc316..d6d147f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ node_modules/
!node_modules/canvas.js
bundle.js
+/.vs
diff --git a/README.md b/README.md
index 07289f3..633b61d 100644
--- a/README.md
+++ b/README.md
@@ -75,6 +75,10 @@ __Arguments__
- `legend` - A boolean used to determine whether a legend should be generated. Defaults to `true`.
+ - `wrapHtml` - A boolean used to determine whether a `
` wrapping the SVG should be generated. Defaults to `true`.
+
+ - A pure SVG will be generated if set both `legend` and `wrapHtml` to `false`.
+
- `data` - An object containing data used to generate the chart. The structure of this object depends on chart `type`. Please refer to the [Chartist Api Documentation](http://gionkunz.github.io/chartist-js/api-documentation.html) for complete details.
diff --git a/lib/index.js b/lib/index.js
index 51fe143..151ea3d 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -25,11 +25,12 @@ const generate = R.curryN(3, co.wrap(function * (type, options, data) {
// process options
options = is.function(options) ? options(Chartist) : options;
if (is.not.json(options)) throw new TypeError('options must be an object or a function that returns an object.');
- options = Ru.defaults({ legend: true }, options);
+ options = Ru.defaults({ legend: true, wrapHtml: true }, options);
// create chart
const chart = yield generateChart(Chartist, window, type, options, data);
- const legend = options.legend ? generateLegend(data) : '';
- return `
${chart}${legend}
`;
+ const legend = options.legend ? generateLegend(data) : '';
+
+ return options.wrapHtml ? `
${chart}${legend}
` : `${chart}${legend}`;
}));
module.exports = generate;