Skip to content

Commit 7e35095

Browse files
author
Jelte Lagendijk
committed
Fix HTML set in _createChart
1 parent c1a55e5 commit 7e35095

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/ChartJS/widgets/DoughnutChart/widget/DoughnutChart.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ define([
138138
this._resize();
139139
}));
140140

141+
var content = this._data.object.get(this.numberInside);
142+
141143
// Set the con
142-
html.set(this._numberNode, this._data.object.get(this.numberInside).toString());
144+
html.set(this._numberNode, content !== null ? content.toString() : "");
143145

144146
// Add class to determain chart type
145147
this._addChartClass("chartjs-doughnut-chart");

src/ChartJS/widgets/PieChart/widget/PieChart.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ define([
139139
};
140140
this._chart = new this._chartJS(this._ctx, chartProperties);
141141

142+
var content = this._data.object.get(this.numberInside);
143+
142144
// Set the con
143-
html.set(this._numberNode, this._data.object.get(this.numberInside).toString());
145+
html.set(this._numberNode, content !== null ? content.toString() : "");
144146

145147
// Add class to determain chart type
146148
this._addChartClass("chartjs-pie-chart");

0 commit comments

Comments
 (0)