Skip to content

Commit f432d9b

Browse files
committed
Merge branch 'master' of github.com:gor181/react-chartjs-2
2 parents c752741 + e6e3f3f commit f432d9b

File tree

5 files changed

+112
-6
lines changed

5 files changed

+112
-6
lines changed

dist/react-chartjs-2.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Object.defineProperty(exports, "__esModule", {
66
value: true
77
});
8-
exports.Polar = exports.Radar = exports.HorizontalBar = exports.Bar = exports.Line = exports.Pie = exports.Doughnut = undefined;
8+
exports.Polar = exports.Radar = exports.HorizontalBar = exports.Bar = exports.Line = exports.Pie = exports.Doughnut = exports.Bubble = undefined;
99

1010
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1111

@@ -46,7 +46,7 @@ var ChartComponent = _react2.default.createClass({
4646
onElementsClick: _react.PropTypes.func,
4747
options: _react.PropTypes.object,
4848
redraw: _react.PropTypes.bool,
49-
type: _react.PropTypes.oneOf(['doughnut', 'pie', 'line', 'bar', 'horizontalBar', 'radar', 'polarArea']),
49+
type: _react.PropTypes.oneOf(['doughnut', 'pie', 'line', 'bar', 'horizontalBar', 'radar', 'polarArea', 'bubble']),
5050
width: _react.PropTypes.number
5151
},
5252

@@ -332,6 +332,32 @@ var Polar = exports.Polar = function (_React$Component7) {
332332
return Polar;
333333
}(_react2.default.Component);
334334

335+
var Bubble = exports.Bubble = function (_React$Component8) {
336+
_inherits(Bubble, _React$Component8);
337+
338+
function Bubble() {
339+
_classCallCheck(this, Bubble);
340+
341+
return _possibleConstructorReturn(this, (Bubble.__proto__ || Object.getPrototypeOf(Bubble)).apply(this, arguments));
342+
}
343+
344+
_createClass(Bubble, [{
345+
key: 'render',
346+
value: function render() {
347+
var _this16 = this;
348+
349+
return _react2.default.createElement(ChartComponent, _extends({}, this.props, {
350+
ref: function ref(_ref8) {
351+
return _this16.chart_instance = _ref8 && _ref8.chart_instance;
352+
},
353+
type: 'bubble'
354+
}));
355+
}
356+
}]);
357+
358+
return Bubble;
359+
}(_react2.default.Component);
360+
335361
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
336362
},{"./utils/deepEqual":2,"chart.js":undefined,"react-dom":undefined}],2:[function(require,module,exports){
337363
'use strict';

dist/react-chartjs-2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/src/components/bubble.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import React from 'react';
2+
import {Bubble} from 'react-chartjs-2';
3+
4+
const data = {
5+
labels: ['January'],
6+
datasets: [
7+
{
8+
label: 'My First dataset',
9+
fill: false,
10+
lineTension: 0.1,
11+
backgroundColor: 'rgba(75,192,192,0.4)',
12+
borderColor: 'rgba(75,192,192,1)',
13+
borderCapStyle: 'butt',
14+
borderDash: [],
15+
borderDashOffset: 0.0,
16+
borderJoinStyle: 'miter',
17+
pointBorderColor: 'rgba(75,192,192,1)',
18+
pointBackgroundColor: '#fff',
19+
pointBorderWidth: 1,
20+
pointHoverRadius: 5,
21+
pointHoverBackgroundColor: 'rgba(75,192,192,1)',
22+
pointHoverBorderColor: 'rgba(220,220,220,1)',
23+
pointHoverBorderWidth: 2,
24+
pointRadius: 1,
25+
pointHitRadius: 10,
26+
data: [{x:10,y:20,r:5}]
27+
}
28+
]
29+
};
30+
31+
export default React.createClass({
32+
displayName: 'BubbleExample',
33+
34+
render() {
35+
return (
36+
<div>
37+
<h2>Bubble Example</h2>
38+
<Bubble data={data} />
39+
</div>
40+
);
41+
}
42+
});

0 commit comments

Comments
 (0)