Commit 378d9ae1 authored by afc163's avatar afc163

Fix pie

parent 1a1aa957
...@@ -60,6 +60,7 @@ class Pie extends Component { ...@@ -60,6 +60,7 @@ class Pie extends Component {
inner = 0.75, inner = 0.75,
animate = true, animate = true,
colors, colors,
lineWidth = 0,
} = this.props; } = this.props;
const defaultColors = colors || ['#8543E0', '#F04864', '#FACC14', '#1890FF', '#13C2C2', '#2FC25B']; const defaultColors = colors || ['#8543E0', '#F04864', '#FACC14', '#1890FF', '#13C2C2', '#2FC25B'];
...@@ -73,9 +74,9 @@ class Pie extends Component { ...@@ -73,9 +74,9 @@ class Pie extends Component {
tooltip = false; tooltip = false;
formatColor = (value) => { formatColor = (value) => {
if (value === 'ๅ ๆฏ”') { if (value === 'ๅ ๆฏ”') {
return color || '#0096fa'; return color || 'rgba(24, 144, 255, 0.85)';
} else { } else {
return '#e9e9e9'; return '#F0F2F5';
} }
}; };
...@@ -149,11 +150,13 @@ class Pie extends Component { ...@@ -149,11 +150,13 @@ class Pie extends Component {
inner, inner,
}); });
if (percent) { chart
chart.intervalStack().position(Stat.summary.percent('y')).color('x', formatColor).selected(selected); .intervalStack()
} else { .position(Stat.summary.percent('y'))
chart.intervalStack().position(Stat.summary.percent('y')).color('x', defaultColors).selected(selected); .style({ lineWidth, stroke: '#fff' })
} .color('x', percent ? formatColor : defaultColors)
.selected(selected);
chart.render(); chart.render();
this.chart = chart; this.chart = chart;
......
...@@ -56,7 +56,7 @@ Ant Design Pro ๆไพ›็š„ไธšๅŠกไธญๅธธ็”จ็š„ๅ›พ่กจ็ฑปๅž‹๏ผŒ้ƒฝๆ˜ฏๅŸบไบŽ [G2](https ...@@ -56,7 +56,7 @@ Ant Design Pro ๆไพ›็š„ไธšๅŠกไธญๅธธ็”จ็š„ๅ›พ่กจ็ฑปๅž‹๏ผŒ้ƒฝๆ˜ฏๅŸบไบŽ [G2](https
| ๅ‚ๆ•ฐ | ่ฏดๆ˜Ž | ็ฑปๅž‹ | ้ป˜่ฎคๅ€ผ | | ๅ‚ๆ•ฐ | ่ฏดๆ˜Ž | ็ฑปๅž‹ | ้ป˜่ฎคๅ€ผ |
|----------|------------------------------------------|-------------|-------| |----------|------------------------------------------|-------------|-------|
| title | ๅ›พ่กจๆ ‡้ข˜ | ReactNode\|string | - | | title | ๅ›พ่กจๆ ‡้ข˜ | ReactNode\|string | - |
| color | ๅ›พ่กจ้ขœ่‰ฒ | string | `#rgba(24, 144, 255, 0.85)` | | color | ๅ›พ่กจ้ขœ่‰ฒ | string | `rgba(24, 144, 255, 0.85)` |
| margin | ๅ›พ่กจๅ†…้ƒจ้—ด่ท | array | \[32, 0, 32, 40\] | | margin | ๅ›พ่กจๅ†…้ƒจ้—ด่ท | array | \[32, 0, 32, 40\] |
| height | ๅ›พ่กจ้ซ˜ๅบฆ | number | - | | height | ๅ›พ่กจ้ซ˜ๅบฆ | number | - |
| data | ๆ•ฐๆฎ | array<{x, y}> | - | | data | ๆ•ฐๆฎ | array<{x, y}> | - |
...@@ -66,7 +66,7 @@ Ant Design Pro ๆไพ›็š„ไธšๅŠกไธญๅธธ็”จ็š„ๅ›พ่กจ็ฑปๅž‹๏ผŒ้ƒฝๆ˜ฏๅŸบไบŽ [G2](https ...@@ -66,7 +66,7 @@ Ant Design Pro ๆไพ›็š„ไธšๅŠกไธญๅธธ็”จ็š„ๅ›พ่กจ็ฑปๅž‹๏ผŒ้ƒฝๆ˜ฏๅŸบไบŽ [G2](https
| ๅ‚ๆ•ฐ | ่ฏดๆ˜Ž | ็ฑปๅž‹ | ้ป˜่ฎคๅ€ผ | | ๅ‚ๆ•ฐ | ่ฏดๆ˜Ž | ็ฑปๅž‹ | ้ป˜่ฎคๅ€ผ |
|----------|------------------------------------------|-------------|-------| |----------|------------------------------------------|-------------|-------|
| animate | ๆ˜ฏๅฆๆ˜พ็คบๅŠจ็”ป | boolean | true | | animate | ๆ˜ฏๅฆๆ˜พ็คบๅŠจ็”ป | boolean | true |
| color | ๅ›พ่กจ้ขœ่‰ฒ | string | `#0096fa` | | color | ๅ›พ่กจ้ขœ่‰ฒ | string | `rgba(24, 144, 255, 0.85)` |
| height | ๅ›พ่กจ้ซ˜ๅบฆ | number | - | | height | ๅ›พ่กจ้ซ˜ๅบฆ | number | - |
| hasLegend | ๆ˜ฏๅฆๆ˜พ็คบ legend | boolean | `false` | | hasLegend | ๆ˜ฏๅฆๆ˜พ็คบ legend | boolean | `false` |
| margin | ๅ›พ่กจๅ†…้ƒจ้—ด่ท | array | \[32, 0, 32, 40\] | | margin | ๅ›พ่กจๅ†…้ƒจ้—ด่ท | array | \[32, 0, 32, 40\] |
......
...@@ -161,7 +161,7 @@ export default class Analysis extends Component { ...@@ -161,7 +161,7 @@ export default class Analysis extends Component {
<Col span={12} style={{ paddingTop: 36 }}> <Col span={12} style={{ paddingTop: 36 }}>
<Pie <Pie
animate={false} animate={false}
color={(currentKey !== data.name) && '#99d5fd'} color={(currentKey !== data.name) && '#BDE4FF'}
inner={0.55} inner={0.55}
tooltip={false} tooltip={false}
margin={[0, 0, 0, 0]} margin={[0, 0, 0, 0]}
...@@ -386,7 +386,7 @@ export default class Analysis extends Component { ...@@ -386,7 +386,7 @@ export default class Analysis extends Component {
)} )}
style={{ marginTop: 24 }} style={{ marginTop: 24 }}
> >
<div style={{ marginTop: 32, marginBottom: 108 }}> <div style={{ marginTop: 32, marginBottom: 100 }}>
<Pie <Pie
hasLegend hasLegend
title="้”€ๅ”ฎ้ข" title="้”€ๅ”ฎ้ข"
...@@ -394,7 +394,8 @@ export default class Analysis extends Component { ...@@ -394,7 +394,8 @@ export default class Analysis extends Component {
total={yuan(salesPieData.reduce((pre, now) => now.y + pre, 0))} total={yuan(salesPieData.reduce((pre, now) => now.y + pre, 0))}
data={salesPieData} data={salesPieData}
valueFormat={val => yuan(val)} valueFormat={val => yuan(val)}
height={260} height={268}
lineWidth={4}
/> />
</div> </div>
</Card> </Card>
......
...@@ -150,6 +150,9 @@ ...@@ -150,6 +150,9 @@
.salesCard { .salesCard {
:global { :global {
.abt-tabs-ink-bar {
bottom: auto;
}
.ant-tabs-content { .ant-tabs-content {
padding-top: 30px; padding-top: 30px;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment