# 径向轴

径向轴专门用于雷达图和极坐标面积图。这些轴覆盖图表区域,而不是位于边缘之一。Chart.js 默认包含一个径向轴。

# 可视组件

径向轴由可以单独配置的可视组件组成。这些组件是

# 角度线

轴的网格线绘制在图表区域上。它们从中心延伸到画布的边缘。在下面的示例中,它们是红色的。

const config = {
  type: 'radar',
  data,
  options: {
    scales: {
      r: {
        angleLines: {
          color: 'red'
        }
      }
    }
  }
};

# 网格线

轴的网格线绘制在图表区域上。在下面的示例中,它们是红色的。

const config = {
  type: 'radar',
  data,
  options: {
    scales: {
      r: {
        grid: {
          color: 'red'
        }
      }
    }
  }
};

# 点标签

点标签指示每条角度线的数值。在下面的示例中,它们是红色的。

const config = {
  type: 'radar',
  data,
  options: {
    scales: {
      r: {
        pointLabels: {
          color: 'red'
        }
      }
    }
  }
};

# 刻度

刻度用于根据它们离轴中心多远来标记数值。在下面的示例中,它们是红色的。

const config = {
  type: 'radar',
  data,
  options: {
    scales: {
      r: {
        ticks: {
          color: 'red'
        }
      }
    }
  }
};
最后更新时间: 2024 年 5 月 17 日 下午 12:33:38