diff --git a/src/templates/c3/CategoryChart.html.php b/src/templates/c3/CategoryChart.html.php
index 7d544f3..c3d279c 100644
--- a/src/templates/c3/CategoryChart.html.php
+++ b/src/templates/c3/CategoryChart.html.php
@@ -80,7 +80,7 @@
data.groups.push(group);
- c3.generate({
+ var chart = c3.generate({
bindto: '#',
grid: {
x: {
@@ -93,5 +93,6 @@
axis: axis,
data: data
});
+ $('#').data('c3-chart', chart);
})();
diff --git a/src/templates/c3/Chart.html.php b/src/templates/c3/Chart.html.php
index 3197e4c..4461e45 100644
--- a/src/templates/c3/Chart.html.php
+++ b/src/templates/c3/Chart.html.php
@@ -83,7 +83,7 @@
data.groups.push(group);
- c3.generate({
+ var chart = c3.generate({
bindto: '#',
grid: {
x: {
@@ -96,5 +96,6 @@
axis: axis,
data: data
});
+ $('#').data('c3-chart', chart);
})();
diff --git a/src/templates/c3/DateChart.html.php b/src/templates/c3/DateChart.html.php
index 654fef9..1720ff0 100644
--- a/src/templates/c3/DateChart.html.php
+++ b/src/templates/c3/DateChart.html.php
@@ -99,7 +99,7 @@
data.groups.push(group);
- c3.generate({
+ var chart = c3.generate({
bindto: '#',
grid: {
x: {
@@ -112,5 +112,6 @@
axis: axis,
data: data
});
+ $('#').data('c3-chart', chart);
})();
diff --git a/src/templates/c3/DonutChart.html.php b/src/templates/c3/DonutChart.html.php
index 911bd15..0ccbd2c 100644
--- a/src/templates/c3/DonutChart.html.php
+++ b/src/templates/c3/DonutChart.html.php
@@ -50,11 +50,12 @@
data.columns.push(column);
- c3.generate({
+ var chart = c3.generate({
bindto: '#',
data: data,
donut: donut
});
+ $('#').data('c3-chart', chart);
})();
diff --git a/src/templates/c3/PieChart.html.php b/src/templates/c3/PieChart.html.php
index a33823c..925da0c 100644
--- a/src/templates/c3/PieChart.html.php
+++ b/src/templates/c3/PieChart.html.php
@@ -48,11 +48,12 @@
data.columns.push(column);
- c3.generate({
+ var chart = c3.generate({
bindto: '#',
data: data,
pie: pie
});
+ $('#').data('c3-chart', chart);
})();