Skip to content

Commit

Permalink
IBX-1488:[Redesign commerce cockpit]: Added bar chart (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti authored Nov 26, 2021
1 parent e92c519 commit d7d032a
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/bundle/Resources/encore/ez.js.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const layout = [
path.resolve(__dirname, '../public/js/scripts/core/base.chart.js'),
path.resolve(__dirname, '../public/js/scripts/core/line.chart.js'),
path.resolve(__dirname, '../public/js/scripts/core/pie.chart.js'),
path.resolve(__dirname, '../public/js/scripts/core/bar.chart.js'),
path.resolve(__dirname, '../public/js/scripts/core/adaptive.items.js'),
path.resolve(__dirname, '../public/js/scripts/core/popup.menu.js'),
path.resolve(__dirname, '../public/js/scripts/core/tag.view.select.js'),
Expand Down
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/img/ibexa-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/img/icons/database.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions src/bundle/Resources/public/js/scripts/core/bar.chart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
(function(global, doc, eZ) {
const barDefaultOptions = {
scales: {
xAxes: [
{
display: true,
gridLines: {
display: false,
},
},
],
},
};

class BarChart extends eZ.core.BaseChart {
constructor(data, options = {}) {
super(data, {
...barDefaultOptions,
...options,
});

this.type = 'bar';
}

getType() {
return this.type;
}
}

eZ.addConfig('core.chart.BarChart', BarChart);
})(window, window.document, window.eZ);
2 changes: 1 addition & 1 deletion src/bundle/Resources/public/js/scripts/core/line.chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@
}

eZ.addConfig('core.chart.LineChart', LineChart);
})(window, window.document, window.eZ, window.Chart);
})(window, window.document, window.eZ);
2 changes: 1 addition & 1 deletion src/bundle/Resources/public/js/scripts/core/pie.chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
}

eZ.addConfig('core.chart.PieChart', PieChart);
})(window, window.document, window.eZ, window.Chart);
})(window, window.document, window.eZ);

0 comments on commit d7d032a

Please sign in to comment.