zhu-jiang-yi-yuan-bigscreen
Version:
南方医科大学珠江医院大屏端
87 lines (85 loc) • 2.2 kB
JavaScript
import { Const, PxUtil } from '../../utils';
import { Axis, Chart, Coordinate, Interval, Legend, Tooltip } from "bizcharts";
import React from "react";
import { getFontSize, getLineDash, getPadding } from './_util';
var RoseChart = function RoseChart(props) {
var color = props.color,
data = props.data,
axis = props.axis,
height = props.height,
calcRefresh = props.calcRefresh,
padding = props.padding;
var field = axis.field,
dimension = axis.dimension;
var docWidth = calcRefresh === null || calcRefresh === void 0 ? void 0 : calcRefresh[0];
return /*#__PURE__*/React.createElement(Chart, Object.assign({}, {
data: data,
height: height
}, {
padding: padding || getPadding(20),
autoFit: true,
renderer: "svg"
}), /*#__PURE__*/React.createElement(Coordinate, {
type: "polar",
startAngle: Math.PI,
endAngle: Math.PI * (3 / 2)
}), /*#__PURE__*/React.createElement(Axis, {
name: dimension,
line: false,
label: {
style: {
fontSize: getFontSize(docWidth),
fill: 'white'
}
},
grid: {
line: {
style: {
lineDash: getLineDash(docWidth),
stroke: Const.AXIS_COLOR
},
type: 'circle'
},
closed: false
}
}), /*#__PURE__*/React.createElement(Axis, {
name: field,
label: {
offset: PxUtil.getCalcNumW(-15),
style: {
fill: 'white'
}
},
grid: {
line: {
style: {
lineDash: getLineDash(docWidth),
stroke: Const.AXIS_COLOR
},
type: 'circle'
},
closed: false
}
}), /*#__PURE__*/React.createElement(Legend, {
visible: false
}), /*#__PURE__*/React.createElement(Tooltip, {
showTitle: false
}), /*#__PURE__*/React.createElement(Interval, Object.assign({}, {
color: color
}, {
position: "".concat(dimension, "*").concat(field),
adjust: "stack",
"element-highlight": true,
style: {
stroke: 'white'
},
label: [field, {
offset: PxUtil.getCalcNumW(-15),
style: {
textAlign: 'center',
fill: 'white'
}
}]
})));
};
export { RoseChart };