The typescript is throwing an error with columnrange: Highcharts error #17 is occurring, and it seems to be related to a missing module for columnrange. For more information, visit www.highcharts.com

Hello there: I am currently working on implementing a column chart in TypeScript and keep encountering this error message: Highcharts error #17: www.highcharts.com/errors/17/?missingModuleFor=columnrange - missingModuleFor: columnrange

I understand that I need to import a certain module, but I'm unsure of which one specifically and how to utilize it properly. Here is the code snippet:

import Highcharts, { Options } from "highcharts";
import HighchartsReact from "highcharts-react-official";
import * as React from "react";

export const Example: React.FC = () => {
  const chartOptions: Options = {
    chart: {
      type: 'columnrange',
      width: 25,
      height: 30,
      backgroundColor: 'transparent',
      ignoreHiddenSeries: true
  },

  title: {
      text: ''
  },

  xAxis: [
      {
          visible: false,
          minPadding: 0,
          maxPadding: 0,
          minorTickLength: 0,
          tickLength: 0,
          labels: {
              enabled: false // disable labels
          }
      }
  ],
  yAxis: [
      {
          visible: false,
          minPadding: 0,
          maxPadding: 0,
          title: { text: null },
          gridLineWidth: 0,
          labels: {
              enabled: false // disable labels
          }
      }
  ],
  plotOptions: {
      series: {
          states: {
              hover: {
                  enabled: false
              }
          }
      }
  },

  tooltip: {
      enabled: false
  },

  legend: {
      enabled: false
  },

  series: [
      {
          type: 'columnrange',
          data: [
              [10, 90],
              [20, 50],
              [5, 90],
              [40, 120],
              [20, 50],
              [5, 90],
              { low: 40, high: 150, color: '#3f8eeb' }
          ],
          dataLabels: { enabled: false },
          /* states: {
              hover: {
                  enabled: false
              }},*/
          groupPadding: 0.2,
          color: '#79b1f1'
      },
      {
          type: 'scatter',
          data: [
              // x, y positions where 0 is the first category
              [0, 15],
              [1, 43],
              [2, 37],
              [3, 45],
              [4, 43],
              [5, 37],
              [6, 100]
          ],
          marker: {
              fillColor: 'white',
              duration: false
              //lineWidth: 0.2,
              //lineColor: Highcharts.getOptions().colors[0]
              // size: 0.3
          }
      }
  ],

  navigation: {
      buttonOptions: {
          enabled: false
      }
  },
  credits: {
      enabled: false
  }
  };

  return (
    <>
      <HighchartsReact highcharts={Highcharts} options={chartOptions} />
    </>
  );
};

This particular project is written in TypeScript. Appreciate your support!

Answer №1

To incorporate the columnrange series type, you'll find it within the highcharts-more module. Make sure to import and initialize the module accordingly:

import Highcharts from "highcharts";
import HCMore from "highcharts/highcharts-more";

HCMore(Highcharts);

Take a look at this live demonstration: https://codesandbox.io/s/highcharts-react-demo-fork-50ti69?file= /demo.jsx

For more details on the API Reference: https://api.highcharts.com/highcharts/series.columnrange

Explore the Documentation here: https://www.npmjs.com/package/highcharts-react-official#how-to-add-a-module

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountering errors while attempting to install TypeScript through NPM

I am encountering an issue while trying to install Typescript using npm. Following the documentation, I executed the command: npm install -g typescript or sudo npm install -g typescript - Everything seems to be going smoothly until it reaches about 2 ...

Any class that utilizes the interface `IGeneratable` must include an `IGeneratorConstructor<T>` where `T` represents the class implementing the `IGeneratable` interface

My goal is to enforce the requirement that any class implementing the IGeneratable interface must also provide a IGeneratorConstructor<T>, where T represents the class implementing IGeneratable. Is this achievable in TypeScript (specifically version ...

The MUI Theming feature with primary color set to light seems to be causing confusion with the light color property

Trying to grasp the concept of MUI theming. There is a section dedicated to theming where it mentions the ability to change the theme. My query is: Within the primary color, there are three colors that can be defined: main, dark, and light. I'm unsur ...

Variety of returns from shared functions

class Parent { protected info: any; getInfo(): dataTypeA | dataTypeB { return this.info; } } class A extends Parent { protected info: dataTypeA = getDataTypeA(); } class B extends Parent { protected info: dataTypeB = getDataTypeB ...

Can you specify the nature of the clear dispatch action?

Below is the code snippet in question: useEffect(() => { dispatch(fetchMovieDetails(movieId!)); return () => dispatch(fetchMovieDetails(movieId!, "clear")); }, [dispatch, movieId]); The issue at hand is that this code snippet i ...

Encountered error message: "Cannot assign argument of type '() => () => boolean' to parameter of type 'EffectCallback'"

I recently started working with TypeScript. I encountered an issue when attempting to utilize useEffect in TypeScript within a React context, Error: Argument of type '() => () => boolean' is not assignable to parameter of type 'Effec ...

How can the radio button's checked property be bound to a boolean attribute of a component in Angular 2?

Is there a way to connect the checked property of a radio button to a boolean variable in a Component class? I would like the radio button in the template to be pre-selected if the boolean flag is true. I attempted to use <input type="radio" [(ngModel) ...

Flatten an object in TypeScript

Can the structure of this type be flattened? type MySchema = { fields: { hello: { type: 'Group' fields: { world: { type: 'Group' fields: { yay: { type: 'Boolean' } } } ...

Monitoring for adjustments in variable with RXJS

One of my classes has a boolean variable called isLoading with a default value of false. It gets set to true when a certain action (HTTP request) occurs and then back to false once the action is completed. I am interested in using RXjs to monitor this vari ...

What is the process for adding annotations to a React functional component that includes both props and states?

I'm currently in the process of developing a React Native app that consists of a parent component and a child component. The child component contains a button with an event handler that is located in the parent component. Upon triggering the event han ...

Debug a Typescript-enabled Koa application remotely from a Docker container using Webstorm

Issue: Currently facing challenges while setting up a new NodeJS Project using KoaJS, Typescript, and Docker. The initial setup went as planned, but encountering some difficulties with remote debugging - or at least it seems so from my perspective. When s ...

Cypress: Importing line in commands.ts is triggering errors

After adding imports to the commands.ts file, running tests results in errors. However, in commands.ts: import 'cypress-localstorage-commands'; /* eslint-disable */ declare namespace Cypress { interface Chainable<Subject = any> { c ...

What is the method to update reference models in mongodb by generating documents within a different model?

In my API, I have three models: Patient, Doctor, and Reviews. The Reviews model is referenced in the Doctor model, with the intention that a patient can post a review for a specific doctor using Review.create(). However, even after the review document is c ...

PageObjectModel Playwright, execute the locator().all() function - 'The execution context has been terminated, possibly due to navigating to another...'

Hey there, I'm currently working on a basic test using POM. Here is a snippet from one of my PageObjects Class: import { Expect, Page, Locator } from "@playwright/test"; export class InventoryPage { readonly page: Page; readonly addToC ...

Is a package I overlooked? The 'findOne' property is not found within the 'Schema<Document<any, {}>, Model<any, any>, undefined>'

I have taken over the responsibility of maintaining the websites at my company, and I am encountering the error message (Property 'findOne' does not exist on type 'Schema<Document<any, {}>, Model<any, any>, undefined>' ...

The error message "Property 'getPickerData' is not found on type 'RefObject>'" indicates that the function getPickerData is not available on

Struggling to incorporate this custom picker from React Native Phone Input repository into a TypeScript project. Being new to react native, I'm not sure if I set up my ref correctly, but here's what I have so far. import * as React from 're ...

What is the best way to mock imports in NestJS testing?

I am interested in writing a unit test for my nestjs 'Course' repository service, which has dependencies on Mongoose Model and Redis. courses.repository.ts: import { Injectable, HttpException, NotFoundException } from "@nestjs/common"; ...

The issue of Angular2 routing not working with an empty route has been

My routing setup is structured as follows: In the app module, I have defined the initial level of routing using the following configuration: const routes: Routes = [ { path: 'login', component: LoginComponent, }, { path: 'dash', red ...

Having trouble changing the title of a highchart using @input?

In my StreamsComponent, I set up my Highcharts like this: export class StreamsComponent implements OnInit { @Input() platform: string = ""; @Input() title: string = ""; series: any[] = []; Highcharts: typeof Highcharts = Highc ...

Ways to restrict users from inputting alphabets in TextField using material ui

I've set up a TextField where users can only input positive digits. Currently, I'm using the following onKeyDown event: <TextField label={distanceError} error={!!distanceError} defaultValue={kpoints.distance} on ...