How to use the bizcharts.Util.each function in bizcharts

To help you get started, we’ve selected a few bizcharts 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 alibaba / ice / react-materials / blocks / CustomBarChart / src / CustomBarChart.jsx View on Github external
drawShape(cfg, container) {
        // 将归一化后的数据转换为画布上的坐标
        const points = cfg.points;

        let data = [];
        let prePoint = null;
        const first = points[0];
        const constaint = [
          // 范围
          [0, 0],
          [1, 1],
        ];

        Util.each(points, (point) => {
          if (
            !prePoint ||
            !(prePoint.x === point.x && prePoint.y === point.y)
          ) {
            data.push(point.x);
            data.push(point.y);
            prePoint = point;
          }
        });

        const spline = PathUtil.catmullRomToBezier(data, false, constaint);
        let path =
          'M' + first.x + ' ' + first.y + PathUtil.parsePathArray(spline);
        path = PathUtil.pathToAbsolute(path);
        path = this.parsePath(path, false);