使用角度在高图中显示自定义 xaxis

问题描述

我需要使用 angular

enter image description here

在 highcharts 中创建此图像中显示自定义 xaxis。

jsfiddle 中的普通 JS 中我能够实现它,我尝试了相同的 angular 图表选项,但我得到了这样的结果,有人可以帮助我解决我做错了什么吗?

enter image description here

,

stackblitz link for angular

解决方法

您需要导入并初始化highcharts-grouped-categories模块:https://www.npmjs.com/package/highcharts-grouped-categories

import * as Highcharts from 'highcharts';
import HighchartsGroupedCategories from 'highcharts-grouped-categories';
import { Injectable } from '@angular/core';

HighchartsGroupedCategories(Highcharts);

现场演示: https://stackblitz.com/edit/highcharts-angular-demo-4y3css?file=src%2Fapp%2Fhighcharts.service.ts

文档: https://github.com/highcharts/highcharts-angular#to-load-a-module