ant-design / ant-design-charts

A React Chart Library
https://ant-design-charts.antgroup.com/
MIT License
1.94k stars 363 forks source link

🐛[BUG] Tiny.ring config类型未引入 #2486

Open Dawn1Ocean opened 7 months ago

Dawn1Ocean commented 7 months ago

🐛 bug 描述 [详细地描述 bug,让大家都能理解]

image

📷 复现步骤 [清晰描述复现步骤,让别人也能看到问题]

image image

🏞 期望结果 [描述你原本期望看到的结果]

image

💻 复现代码 [提供可复现的代码,仓库,或线上示例]

import { Tiny } from '@ant-design/charts';
import { PageContainer, ProCard, StatisticCard } from '@ant-design/pro-components';
import { Card, Statistic } from 'antd';
import RcResizeObserver from 'rc-resize-observer';
import { useState } from 'react';

const percentRing = (percent: number, frontColor: string): React.JSX.Element => {
  const config = {
    percent: percent / 100,
    width: 120,
    height: 120,
    color: ['#E8EFF5', frontColor],
    annotations: [
      {
        type: 'text',
        style: {
          text: `${percent}%`,
          x: '50%',
          y: '50%',
          textAlign: 'center',
          fontSize: 16,
          fontStyle: 'bold',
        },
      },
    ],
  };

  return <Tiny.Ring {...config} />;
};

© 版本信息

🚑 其他信息 [如截图等其他信息可以贴在这里]

lxfu1 commented 6 months ago

感觉是TS解析的问题,可以 // @ts-ignore 先忽略一下