Tuesday, February 21, 2017

Highcharts - Environment Setup

In this chapter we will discuss about how to set up Highcharts library to be used in web application development.
Highcharts requires jQuery as a dependency. So first we'll install jQuery library and then HighChart library.

Install jQuery

There are two ways to use jQuery.
  • Download: Download it locally from jQuery.com and use it.
  • CDN access: You also have access to a CDN. The CDN will give you access around the world to regional data centers that in this case, Google host. This means using CDN moves the responsibility of hosting files from your own servers to a series of external ones. This also offers an advantage that if the visitor to your webpage has already downloaded a copy of jQuery from the same CDN, it won't have to be re-downloaded.

Using Downloaded jQuery

Include the jQuery JavaScript file in the HTML page using following script:
<head>
   <script src="/jquery/jquery.min.js"></script>
</head>

Using CDN

We are using the CDN versions of the jQuery library throughout this tutorial.
Include the jQuery JavaScript file in the HTML page using following script:
<head>
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>

Install Highcharts

There are two ways to use Highcharts.
  • Download: Download it locally from highcharts.com and use it.
  • CDN access: You also have access to a CDN. The CDN will give you access around the world to regional data centers that in this case, Highcharts host Code.Highcharts.Com.

Using Downloaded Highcharts

Include the Highcharts JavaScript file in the HTML page using following script:
<head>
   <script src="/highcharts/highcharts.js"></script>
</head>

Using CDN

We are using the CDN versions of the Highcharts library throughout this tutorial.
Include the Highcharts JavaScript file in the HTML page using following script:
<head>
   <script src="https://code.highcharts.com/highcharts.js"></script>
</head>

No comments:

Post a Comment