Giter Site home page Giter Site logo

massimiliano76 / highcharts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from highcharts/highcharts

0.0 3.0 0.0 188.41 MB

Highcharts JS, the JavaScript charting framework

Home Page: www.highcharts.com

License: Other

HTML 48.55% JavaScript 46.50% CSS 0.45% Java 0.56% PHP 0.42% TypeScript 0.10% Shell 0.14% Batchfile 0.28% Perl 0.13% Python 0.04% XSLT 2.84%

highcharts's Introduction

Highcharts JS is a JavaScript charting library based on SVG, with fallbacks to VML and canvas for old browsers.

Download and install Highcharts

This is the working repo for Highcharts. If you simply want to include Highcharts into a project, use the distribution package instead, or read the download page. Please note that there are several ways to use Highcharts. For general installation instructions, see the docs.

Use our CDN

Instead of downloading, you can use our CDN to access files directly. See code.highcharts.com for details.

<script src="https://code.highcharts.com/highcharts.js"></script>

Install from npm

See npm documentation on how to get started with npm.

npm install --save highcharts

Install from Bower

Bower is deprecated, but to install, run:

bower install highcharts

Load Highcharts from the CDN as ECMAScript modules

Starting with v6.1.0, Highcharts is available on our CDN as ECMAScript modules. You can import ES modules directly in modern browsers without any bundling tools, by using <script type="module"> (demo):

<script type="module">
  import Highcharts from 'https://code.highcharts.com/es-modules/masters/highcharts.src.js';

  Highcharts.chart('container', {
    ...
  });
</script>

Load Highcharts as an AMD module

Highcharts is compatible with AMD module loaders (such as RequireJS). Module files require an initialization step in order to reference Highcharts. To accomplish this, pass Highcharts to the function returned by loading the module. The following example demonstrates loading Highcharts along with two modules using RequireJS. No special RequireJS config is necessary for this example to work.

requirejs([
    'path/to/highcharts.js',
    'path/to/modules/exporting.js',
    'path/to/modules/accessibility.src.js'
], function (Highcharts, exporting, accessibility) {
    // This function runs when the above files have been loaded

    // We need to initialize module files and pass in Highcharts
    exporting(Highcharts); // Load exporting before accessibility
    accessibility(Highcharts);

    // Create a test chart
    Highcharts.chart('container', {
        series: [{
            data: [1,2,3,4,5]
        }]
    });
});

Load Highcharts as a CommonJS module

Highcharts is using an UMD module pattern, as a result it has support for CommonJS. The following examples presumes you are using npm to install Highcharts, see Download and install Highcharts for more details.

// Load Highcharts
var Highcharts = require('highcharts');
// Alternatively, this is how to load Highstock. Highmaps is similar.
// var Highcharts = require('highcharts/highstock');

// Load the exporting module, and initialize it.
require('highcharts/modules/exporting')(Highcharts);

// Generate the chart
Highcharts.chart('container', {
  // options - see https://api.highcharts.com/highcharts
});

Load Highcharts as an ES6 module

Since Highcharts supports CommonJS, it can be loaded as an ES6 module with the use of transpilers. Two common transpilers are Babel and TypeScript. These have different interpretations of a CommonJS module, which affects your syntax. The following examples presumes you are using npm to install Highcharts, see Download and install Highcharts for more details.

Babel

import Highcharts from 'highcharts';
// Alternatively, this is how to load Highstock. Highmaps is similar.
// import Highcharts from 'highcharts/highstock';

// Load the exporting module.
import Exporting from 'highcharts/modules/exporting';
// Initialize exporting module.
Exporting(Highcharts);

// Generate the chart
Highcharts.chart('container', {
  // options - see https://api.highcharts.com/highcharts
});

TypeScript

import * as Highcharts from 'highcharts';
// Alternatively, this is how to load Highstock. Highmaps is similar.
// import Highcharts from 'highcharts/highstock';

// Load the exporting module.
import * as Exporting from 'highcharts/modules/exporting';
// Initialize exporting module.
Exporting(Highcharts);

// Generate the chart
Highcharts.chart('container', {
  // options - see https://api.highcharts.com/highcharts
});

Build and debug

If you want to do modifications to Highcharts or fix issues, you may build your own files. Highcharts uses Gulp as the build system. After npm install in the root folder, run gulp, which will set up a watch task for the JavaScript and SCSS files. Now any changes in the files of the /js or /css folders will result in new files being built and saved in the code folder. Other tasks are also available, like gulp lint.

npm install
gulp

Generate API docs

Clone the repositories api-docs and highcharts-docstrap in the same parent folder as this highcharts repository. Do not forgett to install depending modules in this repositories by npm i. Finally you can run in this highcharts repository the doc generator with gulp jsdoc --watch, which also starts a new server with the generated API documentation.

highcharts's People

Contributors

bre1470 avatar cvasseng avatar dandv avatar davidpadbury avatar denyllon avatar evermind-micw avatar gardengen avatar havardge avatar jon-a-nygaard avatar kamilkulig avatar laff avatar larsac07 avatar martin-liu avatar mekhatria avatar morganfree avatar nicoder avatar nikolas avatar oysteinmoseng avatar pauldalek avatar paulo-raca avatar pawelfus avatar ppotaczek avatar sebastianbochan avatar sfishel18 avatar slawekkolodziej avatar slozier avatar smartvikisogn avatar tahajahangir avatar tomwestmacott avatar torsteinhonsi avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.