Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛[BUG] Annotations in Tiny.Ring not displayed when percentage > 0 #2846

Open
SquirrelDeveloper opened this issue Jan 27, 2025 · 0 comments

Comments

@SquirrelDeveloper
Copy link

Given this as the TinRingConfig

 const config: TinyRingConfig = {
      percent: 0,
      width: 50,
      height: 50,
      color: ['rgb(255,255,255)', value.percent < 0.8 ? '#1668dc' : '#dc4446'],
      innerRadius: 0.85,
      radius: 0.98,
      loading: false,
      annotations: [
        {
          type: 'text',
          style: {
            text: `${value.percent?.toFixed(0)}%`,
            x: '50%',
            y: '45%',
            textAlign: 'center',
            fontSize: 12,
            fill: `${value.percent < 0.8 ? 'rgba(232,237,243,0.9)' : '#dc4446'}`,
            fontStyle: 'bold',
          },
        },
        {
          type: 'text',
          style: {
            text: `${type === DeviceStatType.CPU ? 'cpu' : 'mem'}`,
            x: '48%',
            y: '68%',
            textAlign: 'center',
            fontSize: 8,
            fill: 'rgba(232,237,243,0.9)',
            fillOpacity: 0.95,
            fontStyle: 'normal',
          },
        },
      ],
    };

Will display the inside annotations, but change the percentage to something > 0, and the annotations seems to be hidden behind.

Latest version fo ant charts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant