How to use the @antv/g2plot.Progress function in @antv/g2plot

To help you get started, we’ve selected a few @antv/g2plot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antvis / G2Plot / examples / sparkline / multiple / demo / mini-multiple2.js View on Github external
type: 'mean',
        text: {
          position: 'start',
          content: '平均值',
          style: {
            stroke: 'white',
            lineWidth: 2,
          },
        },
      },
    ],
  });
  tinyArea.render();
  //ring-progress
  const progressContainer = $(`#progress-${d.id}`);
  const progress = new Progress(progressContainer, {
    width: 200,
    height: 50,
    percent: d.load,
    color: (v) => {
      if (v < 0.3) {
        return ['#30BF78', '#E8EDF3'];
      } else if (v >= 0.3 && v < 0.7) {
        return ['#FAAD14', '#E8EDF3'];
      }
      return ['#F4664A', '#E8EDF3'];
    },
  });
  progress.render();
});