Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Commit

Permalink
Update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
strawbrary committed Jul 11, 2016
1 parent 0c34a41 commit 23c3d45
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion dist/react-chartjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ return /******/ (function(modules) { // webpackBootstrap

module.exports = {
createClass: function(chartType, methodNames, dataKey) {
var excludedProps = ['data', 'options', 'redraw'];
var classData = {
displayName: chartType + 'Chart',
getInitialState: function() { return {}; },
Expand All @@ -92,7 +93,7 @@ return /******/ (function(modules) { // webpackBootstrap
};
for (var name in this.props) {
if (this.props.hasOwnProperty(name)) {
if (name !== 'data' && name !== 'options') {
if (excludedProps.indexOf(name) === -1) {
_props[name] = this.props[name];
}
}
Expand Down Expand Up @@ -127,7 +128,10 @@ return /******/ (function(modules) { // webpackBootstrap
updatePoints(nextProps, chart, dataKey);
if (chart.scale) {
chart.scale.xLabels = nextProps.data.labels;

if (chart.scale.calculateXLabelRotation){
chart.scale.calculateXLabelRotation();
}
}
chart.update();
}
Expand Down Expand Up @@ -188,6 +192,17 @@ return /******/ (function(modules) { // webpackBootstrap
while(nextProps.data.length < chart.segments.length) {
chart.removeData();
}
} else if (name === "Radar") {
chart.removeData();
nextProps.data.datasets.forEach(function(set, setIndex) {
set.data.forEach(function(val, pointIndex) {
if (typeof(chart.datasets[setIndex][dataKey][pointIndex]) == "undefined") {
addData(nextProps, chart, setIndex, pointIndex);
} else {
chart.datasets[setIndex][dataKey][pointIndex].value = val;
}
});
});
} else {
while (chart.scale.xLabels.length > nextProps.data.labels.length) {
chart.removeData();
Expand Down
2 changes: 1 addition & 1 deletion dist/react-chartjs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 23c3d45

Please sign in to comment.