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

way2web-highcharts

v3.0.0

Published

Add highcharts to the page with ajax.

Downloads

10

Readme

Chart

NPM version Downloads

Add highcharts to the page with ajax.

This package use highcharts 6.0.x.

To connect the highchart, you have to set the class js-chart and an id. To connect the chart settings, you can bind on the id of the div. (e.g. js-charts-line) In the Charts.config you can set all the settings for the chart. You can set the chart title in data-chart-title. You can also set the ajax url in the data-chart-url The JSON contain the data and the name. The labels for the x, y and z axis can also be set the data attributes (e.g. data-chart-xaxis-title) Other information must be set in the config.

See also the example files in the test folder.

Load the complete series from the ajax request.

If you want to load the complete series from the ajax request, add the data-chart-dynamic attribute. Now all the information in the serie will be set, like data, name and type. You don't have to preset the series in the config, it will add all series from the ajax request.

Events.

Example of a custom event.

Charts.loaded = 0;

...

chart: {
    events: {
        load: function() {
            Charts.loaded++

            if(Charts.loaded == Object.keys(Charts.items).length) {
                ...
            }
        }
    }
}

You can use all these event types:

  • addSeries
  • afterPrint
  • beforePrint
  • click
  • drilldown
  • drillup
  • drillupall
  • load
  • redraw
  • render
  • selection

http://api.highcharts.com/highcharts/chart.events

Test the package.

To test the package, clone the package to your system. Than run this command.

npm run build

This will copy the test files to the dist, and also build the package files include the dependencies.

When this script is complete without errors, you can open dist/index.html in your browser. Open the dev tools, tab console, and you see all the results of the tests.

If you only want to check the eslint rules, just run.

npm run lint

Sass

Highcharts 6.x.x contains a css and scss file in the css folder. In your scss file from the project, you have to disable the linter for the highcharts file.

/**
 * Disable the linting because the package contain a sass and css file.
 */
// stylelint-disable-next-line
@import 'highcharts/css/highcharts.scss';