npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

highcharts-multicolor-series

v3.0.0

Published

Highcharts plugin that adds new series: multicolor-series, where you can define color for each part of a path, between two points.

Downloads

9,663

Readme

Multicolor series - Highcharts module

Plugin developed by Black Label.

Go to project page to see this module in action: https://blacklabel.github.io/multicolor_series/.

General prerequisites

  • For version 3.0.0: Highcharts v11.3.0+
  • For version 2.4.0 - 3.0.0: Highcharts v10.0.0 - v11.2.0
  • For version 2.3.0: Highcharts v9.2.0 - v9.3.3
  • For version 2.x.x: Highcharts v4.2.2 - v9.2.0
  • For version 1.x.x: Highcharts v4.0.0 - v4.2.2

Installation

NPM

Get the package from NPM in your app:

npm install highcharts-multicolor-series

If Highcharts is not already installed, get the package with Highcharts:

npm install highcharts highcharts-multicolor-series

CDN

Add a script tag below the Highcharts script tag:

<script src="https://cdn.jsdelivr.net/npm/highcharts-multicolor-series"></script>

Usage and demos

Basic usage example:

The Live example is available here.

Highcharts.chart('container', {
  series: [{
    type: 'coloredline',
    data: [{
      y: 70,
      segmentColor: 'blue'
    }, {
      y: 20,
      segmentColor: 'green'
    }, {
      y: 40,
      segmentColor: 'yellow'
    }, {
      y: 50,
      segmentColor: 'red'
    }, {
      y: 10,
      segmentColor: 'pink'
    }]
  }]
});

Basic usage example with Typescript (React):

The Live example is available here.

import * as Highcharts from "highcharts";
import HighchartsReact from "highcharts-react-official";

// Implement the package module.
import MulticolorSeries from "highcharts-multicolor-series";
MulticolorSeries(Highcharts);

// The package allows you to import both `Highcharts.SeriesMulticolorLineOptions` and
// `Highcharts.SeriesMulticolorAreaOptions` interfaces, accordingly to the series.
// Interfaces extend the default series options.

const App = () => {
  // Type the chart options.
  const options: Highcharts.Options = {
    series: [
      {
        type: "coloredarea",
        data: [
          {
            y: 40,
            segmentColor: "red"
          },
          {
            y: 60,
            segmentColor: "blue"
          },
          {
            y: 30,
            segmentColor: "yellow"
          },
          {
            y: 10,
            segmentColor: "green"
          },
          {
            y: 50,
            segmentColor: "brown"
          },
          {
            y: 20,
            segmentColor: "pink"
          },
          {
            y: 70,
            segmentColor: "orange"
          }
        ]
      }
    ]
  };

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

export default App;

Parameters

| Parameter | Type | Required | Defaults | Description | | --------- | :----: | :--------: | :--------: | ----------- | | series.type | String | yes | - | Set it to "coloredline" or "coloredarea" to use multicolor series. | | point.segmentColor | String | no | - | Controls line color between n and n+1 point, independent from point.color, which changes marker color. |

Changelog

The changelog is available here.

Development

To ensure best compatibility, it is recommended to use pnpm as a package manager.

Tests

This package contains tests for the proper elements rendering. To run tests, type:

npm run test

License

This package is licensed under MIT.

The package is built on top of the Highcharts library which requires a commercial license. Non-commercial use may qualify for a free educational or personal license. Read more about licenses here.