bizchart3.x气泡图
bizcharts气泡图参考 https://bizcharts.alibaba-inc.com/product/bizcharts/demo/174
import React from 'react';
import PropTypes from 'prop-types';
import { Chart, Geom, Axis, Tooltip, Legend } from 'bizcharts';
const scale = {
name: {
alias: '技术分布',
type: 'cat',
values: ['UI','PD', 'PR', 'SQL', 'API'],
tickCount: 5,
},
label: {
alias: '技术分布',
},
value: {
alias: '技能等级',
},
};
BubbleChart.propTypes = {
dataSource: PropTypes.array.isRequired,
height: PropTypes.number
};
function BubbleChart(props) {
const {dataSource, height = 360} = props
return (
<Chart
forceFit
height={height}
data={dataSource}
scale={scale}
>
<Tooltip showTitle={false} />
<Axis title name="name" />
<Axis title name="label" />
<Legend />
<Geom
type="point"
position="label*name"
color='label'
tooltip="name*value*label"
opacity={0.5}
shape="circle"
size={['value', [2, 16]]}
style={[
'name',
{
lineWidth: 1,
strokeOpacity: 1,
fillOpacity: 0.3,
opacity: 0.65,
},
]}
/>
</Chart>
);
}
export default React.memo(BubbleChart);