一:说明: 基础饼图组件
npm install @czty/lchartpieb一:说明:
基础饼图组件
二:使用:
npm i @czty/lchartpieb
import React from 'react';
import Lchartpieb from '@czty/lchartpieb';
const MyComponent = () => {
return (
configer={
x: 0,
y: 0,
clazz : '',
params : {},
url: '',
method: 'get',
data: [
{
"cityName": "杭州",
"num": 30
},
{
"cityName": "湖州",
"num": 10
}
],
width: '400px',
height: '200px',
graphicW: 220,
graphicH: 220,
color: ['rgb(234, 225, 72)', 'rgb(56, 196, 255)'],
title: '减分登记项目占比',
radius: ['85%', '100%'],
center: ['50%', '50%'],
tooltipShow: '是',
legendIcon: 'circle',
xField: 'cityName',
yField: 'num',
graphicImgUrl: './images/sft/hz.png',
options: {},
seriesLabel: '',
isliquidFill: '是',
liquidFillColor: ['yellow', 'rgba(255,0,0,0.5)'],
}
/>
)
}
三:字段说明
x:
y:
clazz: 可添加的组件的className
params: 请求的传参参数
url: 请求的url地址
method: 请求方式
width: 组件的整体宽度
height: 组件的整体高度
graphicW: 饼图背景图表宽度
graphicH: 饼图背景图表高度
graphicImgUrl:饼图背景图表url
data:数据
color:饼图颜色
title:饼图标题
radius:饼图半径大小
center: 饼图位置
tooltipShow:饼图tooltip是否显示
legendIcon:饼图图例Icon类型 //'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none'
xField:饼图数据x轴字段
yField:饼图数据y轴字段
options:饼图option选项
seriesLabel: 鼠标移上显示文字
isliquidFill: 图表中间是否具有水球流柱状图
liquidFillColor:水球流柱状图填充颜色