<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HighChart &#8211; Sibeesh Passion</title>
	<atom:link href="https://mail.sibeeshpassion.com/tag/highchart/feed/" rel="self" type="application/rss+xml" />
	<link>https://mail.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 02 Jun 2021 15:14:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>HighChart &#8211; Sibeesh Passion</title>
	<link>https://mail.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Client Side Exporting In HighChart</title>
		<link>https://mail.sibeeshpassion.com/client-side-exporting-in-highchart/</link>
					<comments>https://mail.sibeeshpassion.com/client-side-exporting-in-highchart/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 27 May 2016 10:59:54 +0000</pubDate>
				<category><![CDATA[HighChart]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Client Side Exporting]]></category>
		<category><![CDATA[HighChart Exporting]]></category>
		<category><![CDATA[How To]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11664</guid>

					<description><![CDATA[In this post we will discuss how we can enable client side exporting in HighChart . In normal case the data of your chart is being send to the external server which is http://export.highcharts.com/. But if your product is already in production environment, none of your clients will not agree with the idea of sending their data to any third party server. Am I right? To overcome this, HighChart has given an option called offline-exporting. Here we will discuss that. I hope you will like this. Demo Please see the demo here. Background For the past few months, I am [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will discuss how we can enable client side exporting in <a href="http://sibeeshpassion.com/category/highchart/" target="_blank">HighChart </a>. In normal case the data of your chart is being send to the external server which is http://export.highcharts.com/. But if your product is already in production environment, none of your clients will not agree with the idea of sending their data to any third party server. Am I right? To overcome this, HighChart has given an option called <em>offline-exporting</em>. Here we will discuss that. I hope you will like this.</p>
<p><strong>Demo</strong></p>
<p>Please see the demo <a href="https://jsfiddle.net/sibeeshvenu/pwLo7112/" target="_blank">here</a>.</p>
<p><strong>Background</strong></p>
<p>For the past few months, I am working with a project where I use HighChart to manipulate the data and shows as Charts. Now the problem is, while exporting the data, the entire data was going to the HighChart server that is http://export.highcharts.com/. I wanted to get rid of this. So I used the option client side exporting by adding one extra JavaScript file https://code.highcharts.com/modules/offline-exporting.js.</p>
<p><strong>Using the code</strong></p>
<p>First we will populate the chart. For that you must add the needed references as follows. </p>
<p>[html]<br />
&lt;script src=&quot;https://code.jquery.com/jquery-2.2.4.min.js&quot;&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;https://code.highcharts.com/highcharts.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;https://code.highcharts.com/modules/exporting.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>Now add the chart configuration as follows</p>
<p>[js]<br />
$(function () {<br />
    $(&#8216;#myChart&#8217;).highcharts({<br />
        credits: {<br />
            enabled: false<br />
        },<br />
        exporting: {<br />
            chartOptions: {<br />
                plotOptions: {<br />
                    series: {<br />
                        dataLabels: {<br />
                            enabled: true<br />
                        }<br />
                    }<br />
                }<br />
            },<br />
            scale: 3<br />
        },<br />
        title: {<br />
            text: &#8216;My blog vistor count for a week&#8217;<br />
        },<br />
        subtitle: {<br />
            text: &#8216;Monday to Sunday&#8217;<br />
        },<br />
        chart: {<br />
            type: &#8216;area&#8217;<br />
        },<br />
        xAxis: {<br />
            categories: [&#8216;Mon&#8217;, &#8216;Tue&#8217;, &#8216;Wed&#8217;, &#8216;Thu&#8217;, &#8216;Fri&#8217;, &#8216;Sat&#8217;,<br />
                &#8216;Sun&#8217;]<br />
        },<br />
        series: [{<br />
        name:&#8217;Visitor Count&#8217;,<br />
            data: [1005, 558, 1467, 707, 1289, 867, 543]<br />
        }]<br />
    });<br />
});<br />
[/js]</p>
<p>Now if you run your application, you can see a chart as follows.</p>
<div id="attachment_11665" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/High-Chart-e1464345878246.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-11665" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/High-Chart-e1464345878246.png" alt="High Chart" width="650" height="312" class="size-full wp-image-11665" srcset="/wp-content/uploads/2016/05/High-Chart-e1464345878246.png 650w, /wp-content/uploads/2016/05/High-Chart-e1464345878246-300x144.png 300w, /wp-content/uploads/2016/05/High-Chart-e1464345878246-400x192.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11665" class="wp-caption-text">High Chart</p></div>
<p>Now it is time to check the exporting. If you click on export icon on the right top corner, you will given options to choose like on which format you need to export the data. Just click on anything you wish. You can see that the data is being send to the server http://export.highcharts.com/ in the top left side. To overcome this, you need to add a reference of the file called offline-exporting.js.</p>
<p>[html]<br />
&lt;script src=&quot;https://code.highcharts.com/modules/offline-exporting.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>That&#8217;s all. You are done.</p>
<p>Please be noted this feature is not supported in browser IE 8, So if you load this chart in any unsupported browser, the module will fall back to the export server. This can be handled with the option <em>fallbackToExportServer: false</em>. You need to set this option in your exporting settings as follows.</p>
<p>[js]<br />
  exporting: {<br />
            chartOptions: {<br />
                plotOptions: {<br />
                    series: {<br />
                        dataLabels: {<br />
                            enabled: true<br />
                        }<br />
                    }<br />
                }<br />
            },<br />
            scale: 3,<br />
            fallbackToExportServer: false<br />
        }<br />
[/js]</p>
<p>In Internet Explorer, it requires <a href="https://github.com/gabelerner/canvg" target="_blank">canvg</a> library to export the chart to PNG format. But you don&#8217;t need to worry about this file. This will be automatically downloaded on demand by the system. </p>
<p><strong>Reference</strong></p>
<li><a href="http://www.highcharts.com/docs/export-module/client-side-export" target="_blank">client-side-export</a></li>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn&#8217;t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/client-side-exporting-in-highchart/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Chart Widgets With Server Side Data In MVC Using Angular JS And Web API</title>
		<link>https://mail.sibeeshpassion.com/chart-widgets-with-server-side-data-in-mvc-using-angular-js-and-web-api/</link>
					<comments>https://mail.sibeeshpassion.com/chart-widgets-with-server-side-data-in-mvc-using-angular-js-and-web-api/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 17 Mar 2016 05:33:35 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Angular]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web API]]></category>
		<category><![CDATA[Angular JS]]></category>
		<category><![CDATA[Asp.Net]]></category>
		<category><![CDATA[Bar Chart]]></category>
		<category><![CDATA[Column Charts]]></category>
		<category><![CDATA[HighChart]]></category>
		<category><![CDATA[HighChart With Angular JS]]></category>
		<category><![CDATA[Line Chart]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Pie Chart]]></category>
		<category><![CDATA[Scatter Chart]]></category>
		<category><![CDATA[Server Error in Application]]></category>
		<category><![CDATA[Spline Chart]]></category>
		<category><![CDATA[The resource cannot be found]]></category>
		<category><![CDATA[Widgets With Server Side Data]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11359</guid>

					<description><![CDATA[In this article we will learn how we can create some client side chart widgets with the data from SQL Server database. We use MVC architecture with Web API and Angular JS to fetch the data and do all the manipulations. I am creating this application in Visual Studio 2015. In this project we covers topic of how to use HighChart with Angular JS. You can always get the tips/tricks/blogs about these mentioned technologies from the links given below. AngularJS Tips, Tricks, Blogs MVC Tips, Tricks, Blogs Web API Tips, Tricks, Blogs Now we will go and create our application. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this article we will learn how we can create some client side chart widgets with the data from <a href="http://sibeeshpassion.com/category/SQL/" target="_blank" rel="noopener">SQL </a>Server database. We use MVC architecture with Web API and Angular JS to fetch the data and do all the manipulations. I am creating this application in Visual Studio 2015. In this project we covers topic of how to use <a href="http://sibeeshpassion.com/category/products/HighChart/" target="_blank" rel="noopener">HighChart </a>with Angular JS. You can always get the tips/tricks/blogs about these mentioned technologies from the links given below. </p>
<li><a href="http://sibeeshpassion.com/category/angularjs/" target="_blank" rel="noopener">AngularJS Tips, Tricks, Blogs</a></li>
<li><a href="http://sibeeshpassion.com/category/mvc/" target="_blank" rel="noopener">MVC Tips, Tricks, Blogs</a></li>
<li><a href="http://sibeeshpassion.com/category/web-api/" target="_blank" rel="noopener">Web API Tips, Tricks, Blogs</a></li>
<p>Now we will go and create our application. I hope you will like this. </p>
<p><strong>Download the source code</strong></p>
<p>You can always download the source code here.</p>
<li><a href="https://code.msdn.microsoft.com/Chart-Widgets-With-Server-70f5cdac" target="_blank" rel="noopener">Widgets With Server Side Data</a></li>
<li><a href="http://sibeeshpassion.com/Download/MyDashboardSQLScript.rar" target="_blank" rel="noopener">SQL Scripts With Insert Queries</a></li>
<p><strong>Background</strong></p>
<p>I am working now in a personal dashboard application in which I uses HighChart products for the chart integration. We can always load the chart widgets with server side data and Angular JS right? Here we will discuss that. We are going to create the preceding charts for our dashboard. </p>
<li>Pie Chart</li>
<li>Spline Chart</li>
<li>Bar Chart</li>
<li>Line Chart</li>
<li>Scatter Chart</li>
<li>Column Chart</li>
<p>Once we are done, this is how our applications output will be. </p>
<div id="attachment_11360" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chart-Widgets-With-Server-Side-Data-In-MVC-Using-Angular-JS-And-Web-API-Output-e1458121833696.png"><img decoding="async" aria-describedby="caption-attachment-11360" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chart-Widgets-With-Server-Side-Data-In-MVC-Using-Angular-JS-And-Web-API-Output-1024x875.png" alt="Chart Widgets With Server Side Data In MVC Using Angular JS And Web API Output" width="634" height="542" class="size-large wp-image-11360" /></a><p id="caption-attachment-11360" class="wp-caption-text">Chart Widgets With Server Side Data In MVC Using Angular JS And Web API Output</p></div>
<p><strong>Create a MVC application</strong></p>
<p>Click File-> New-> Project then select MVC application. From the following pop up we will select the template as empty and select the core references and folders for MVC. </p>
<div id="attachment_11361" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/MVC-Project-With-Empty-Template-e1458122053871.png"><img decoding="async" aria-describedby="caption-attachment-11361" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/MVC-Project-With-Empty-Template-e1458122053871.png" alt="MVC Project With Empty Template" width="650" height="508" class="size-full wp-image-11361" srcset="/wp-content/uploads/2016/03/MVC-Project-With-Empty-Template-e1458122053871.png 650w, /wp-content/uploads/2016/03/MVC-Project-With-Empty-Template-e1458122053871-300x234.png 300w, /wp-content/uploads/2016/03/MVC-Project-With-Empty-Template-e1458122053871-400x313.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11361" class="wp-caption-text">MVC Project With Empty Template</p></div>
<p>Once you click OK, a project with MVC like folder structure with core references will be created for you.</p>
<div id="attachment_11362" style="width: 277px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Folder-Structure-And-References-For-Empty-MVC-Project.png"><img decoding="async" aria-describedby="caption-attachment-11362" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Folder-Structure-And-References-For-Empty-MVC-Project.png" alt="Folder Structure And References For Empty MVC Project" width="267" height="367" class="size-full wp-image-11362" srcset="/wp-content/uploads/2016/03/Folder-Structure-And-References-For-Empty-MVC-Project.png 267w, /wp-content/uploads/2016/03/Folder-Structure-And-References-For-Empty-MVC-Project-218x300.png 218w" sizes="(max-width: 267px) 100vw, 267px" /></a><p id="caption-attachment-11362" class="wp-caption-text">Folder Structure And References For Empty MVC Project</p></div>
<p>Before going to start the coding part, make sure that all the required extensions/references are installed. Below are the required things to start with. </p>
<li>Angular JS</li>
<li>jQuery</li>
<p>You can all the items mentioned above from NuGet. Right click on your project name and select Manage NuGet packages.</p>
<div id="attachment_11235" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/02/Manage-NuGet-Package-Window-e1455700665396.png"><img decoding="async" aria-describedby="caption-attachment-11235" src="http://sibeeshpassion.com/wp-content/uploads/2016/02/Manage-NuGet-Package-Window-e1455700665396.png" alt="Manage NuGet Package Window" width="650" height="432" class="size-full wp-image-11235" srcset="/wp-content/uploads/2016/02/Manage-NuGet-Package-Window-e1455700665396.png 650w, /wp-content/uploads/2016/02/Manage-NuGet-Package-Window-e1455700665396-300x199.png 300w, /wp-content/uploads/2016/02/Manage-NuGet-Package-Window-e1455700665396-400x266.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11235" class="wp-caption-text">Manage NuGet Package Window</p></div>
<p>Once you have installed those items, please make sure that all the items(jQuery, Angular JS files) are loaded in your scripts folder. </p>
<p><strong>Using the code</strong></p>
<p>As I have said before, we are going to use Angular JS for our client side operations, so it is better to create the Angular JS script files first right? Just to make sure that we have got all the required things :). For that, create a folder named <em>Widget</em> in script folder and right click -> Add -> New Item -> Select AngularJS Module and enter the module name -> Click Add.</p>
<div id="attachment_11363" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Creating-Angular-JS-Modue-In-MVC-Application-e1458122639235.png"><img decoding="async" aria-describedby="caption-attachment-11363" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Creating-Angular-JS-Modue-In-MVC-Application-e1458122639235.png" alt="Creating Angular JS Modue In MVC Application" width="650" height="449" class="size-full wp-image-11363" srcset="/wp-content/uploads/2016/03/Creating-Angular-JS-Modue-In-MVC-Application-e1458122639235.png 650w, /wp-content/uploads/2016/03/Creating-Angular-JS-Modue-In-MVC-Application-e1458122639235-300x207.png 300w, /wp-content/uploads/2016/03/Creating-Angular-JS-Modue-In-MVC-Application-e1458122639235-160x110.png 160w, /wp-content/uploads/2016/03/Creating-Angular-JS-Modue-In-MVC-Application-e1458122639235-400x276.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11363" class="wp-caption-text">Creating Angular JS Modue In MVC Application</p></div>
<p>Follow the same procedure to create Angular JS factory and Angular JS controller. Yes, we have set everything to get started our coding. Now we will create a Web API controller and get the data from database in JSON format. Let&#8217;s start then.</p>
<p><strong>Create Web API Controller</strong></p>
<p>To create a Web API controller, just right click on your controller folder and click Add -> Controller -> Select Web API controller &#8211; Empty ( We will create our own actions later) -> Name the controller (Here I am giving the controller name as Widget).</p>
<p>So our controller is ready, now we need to set up our database so that we can create Entity Model for our application later. </p>
<p><strong>Create a database</strong></p>
<p>The following query can be used to create a database in your SQL Server.</p>
<p>[sql]<br />
USE [master]<br />
GO</p>
<p>/****** Object:  Database [TrialsDB]    Script Date: 16-Mar-16 4:08:15 PM ******/<br />
CREATE DATABASE [TrialsDB]<br />
 CONTAINMENT = NONE<br />
 ON  PRIMARY<br />
( NAME = N&#8217;TrialsDB&#8217;, FILENAME = N&#8217;C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TrialsDB.mdf&#8217; , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )<br />
 LOG ON<br />
( NAME = N&#8217;TrialsDB_log&#8217;, FILENAME = N&#8217;C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TrialsDB_log.ldf&#8217; , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET COMPATIBILITY_LEVEL = 110<br />
GO</p>
<p>IF (1 = FULLTEXTSERVICEPROPERTY(&#8216;IsFullTextInstalled&#8217;))<br />
begin<br />
EXEC [TrialsDB].[dbo].[sp_fulltext_database] @action = &#8216;enable&#8217;<br />
end<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_NULL_DEFAULT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_NULLS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_PADDING OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_WARNINGS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ARITHABORT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_CLOSE OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_CREATE_STATISTICS ON<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_SHRINK OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_UPDATE_STATISTICS ON<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CURSOR_CLOSE_ON_COMMIT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CURSOR_DEFAULT  GLOBAL<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CONCAT_NULL_YIELDS_NULL OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET NUMERIC_ROUNDABORT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET QUOTED_IDENTIFIER OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET RECURSIVE_TRIGGERS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  DISABLE_BROKER<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_UPDATE_STATISTICS_ASYNC OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET DATE_CORRELATION_OPTIMIZATION OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET TRUSTWORTHY OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ALLOW_SNAPSHOT_ISOLATION OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET PARAMETERIZATION SIMPLE<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET READ_COMMITTED_SNAPSHOT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET HONOR_BROKER_PRIORITY OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET RECOVERY FULL<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  MULTI_USER<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET PAGE_VERIFY CHECKSUM<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET DB_CHAINING OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET TARGET_RECOVERY_TIME = 0 SECONDS<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  READ_WRITE<br />
GO<br />
[/sql]</p>
<p>Now we will create the tables we needed. As of now I am going to create two tables. </p>
<li>SalesOrderDetail</li>
<li>Product</li>
<p>These tables are having relationship by the key <em>ProductID</em>.</p>
<p><strong>Create tables in database</strong></p>
<p>Below is the query to create SalesOrderDetail table in database.</p>
<p>[sql]<br />
USE [TrialsDB]<br />
GO</p>
<p>/****** Object:  Table [dbo].[SalesOrderDetail]    Script Date: 16-Mar-16 4:10:22 PM ******/<br />
SET ANSI_NULLS ON<br />
GO</p>
<p>SET QUOTED_IDENTIFIER ON<br />
GO</p>
<p>CREATE TABLE [dbo].[SalesOrderDetail](<br />
	[SalesOrderID] [int] NOT NULL,<br />
	[SalesOrderDetailID] [int] IDENTITY(1,1) NOT NULL,<br />
	[CarrierTrackingNumber] [nvarchar](25) NULL,<br />
	[OrderQty] [smallint] NOT NULL,<br />
	[ProductID] [int] NOT NULL,<br />
	[SpecialOfferID] [int] NOT NULL,<br />
	[UnitPrice] [money] NOT NULL,<br />
	[UnitPriceDiscount] [money] NOT NULL,<br />
	[LineTotal]  AS (isnull(([UnitPrice]*((1.0)-[UnitPriceDiscount]))*[OrderQty],(0.0))),<br />
	[rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,<br />
	[ModifiedDate] [datetime] NOT NULL,<br />
 CONSTRAINT [PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID] PRIMARY KEY CLUSTERED<br />
(<br />
	[SalesOrderID] ASC,<br />
	[SalesOrderDetailID] ASC<br />
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />
) ON [PRIMARY]</p>
<p>GO<br />
[/sql]</p>
<p>Now we will create the table Product.</p>
<p>[sql]<br />
USE [TrialsDB]<br />
GO</p>
<p>/****** Object:  Table [dbo].[Product]    Script Date: 16-Mar-16 4:11:29 PM ******/<br />
SET ANSI_NULLS ON<br />
GO</p>
<p>SET QUOTED_IDENTIFIER ON<br />
GO</p>
<p>CREATE TABLE [dbo].[Product](<br />
	[ProductID] [int] NOT NULL,<br />
	[Name] [nvarchar](max) NOT NULL,<br />
	[ProductNumber] [nvarchar](25) NOT NULL,<br />
	[MakeFlag] [bit] NOT NULL,<br />
	[FinishedGoodsFlag] [bit] NOT NULL,<br />
	[Color] [nvarchar](15) NULL,<br />
	[SafetyStockLevel] [smallint] NOT NULL,<br />
	[ReorderPoint] [smallint] NOT NULL,<br />
	[StandardCost] [money] NOT NULL,<br />
	[ListPrice] [money] NOT NULL,<br />
	[Size] [nvarchar](5) NULL,<br />
	[SizeUnitMeasureCode] [nchar](3) NULL,<br />
	[WeightUnitMeasureCode] [nchar](3) NULL,<br />
	[Weight] [decimal](8, 2) NULL,<br />
	[DaysToManufacture] [int] NOT NULL,<br />
	[ProductLine] [nchar](2) NULL,<br />
	[Class] [nchar](2) NULL,<br />
	[Style] [nchar](2) NULL,<br />
	[ProductSubcategoryID] [int] NULL,<br />
	[ProductModelID] [int] NULL,<br />
	[SellStartDate] [datetime] NOT NULL,<br />
	[SellEndDate] [datetime] NULL,<br />
	[DiscontinuedDate] [datetime] NULL,<br />
	[rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,<br />
	[ModifiedDate] [datetime] NOT NULL<br />
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]</p>
<p>GO<br />
[/sql]</p>
<p>Can we insert some data to the tables now?</p>
<p><strong>Insert data to table</strong></p>
<p>You can use the below query to insert the data to SalesOrderDetail.</p>
<p>[sql]<br />
USE [TrialsDB]<br />
GO</p>
<p>INSERT INTO [dbo].[SalesOrderDetail]<br />
           ([SalesOrderID]<br />
           ,[CarrierTrackingNumber]<br />
           ,[OrderQty]<br />
           ,[ProductID]<br />
           ,[SpecialOfferID]<br />
           ,[UnitPrice]<br />
           ,[UnitPriceDiscount]<br />
           ,[rowguid]<br />
           ,[ModifiedDate])<br />
     VALUES<br />
           (&lt;SalesOrderID, int,&gt;<br />
           ,&lt;CarrierTrackingNumber, nvarchar(25),&gt;<br />
           ,&lt;OrderQty, smallint,&gt;<br />
           ,&lt;ProductID, int,&gt;<br />
           ,&lt;SpecialOfferID, int,&gt;<br />
           ,&lt;UnitPrice, money,&gt;<br />
           ,&lt;UnitPriceDiscount, money,&gt;<br />
           ,&lt;rowguid, uniqueidentifier,&gt;<br />
           ,&lt;ModifiedDate, datetime,&gt;)<br />
GO<br />
[/sql]</p>
<p>and the following query can be used for the table <em>Product</em></p>
<p>[sql]<br />
USE [TrialsDB]<br />
GO</p>
<p>INSERT INTO [dbo].[Product]<br />
           ([ProductID]<br />
           ,[Name]<br />
           ,[ProductNumber]<br />
           ,[MakeFlag]<br />
           ,[FinishedGoodsFlag]<br />
           ,[Color]<br />
           ,[SafetyStockLevel]<br />
           ,[ReorderPoint]<br />
           ,[StandardCost]<br />
           ,[ListPrice]<br />
           ,[Size]<br />
           ,[SizeUnitMeasureCode]<br />
           ,[WeightUnitMeasureCode]<br />
           ,[Weight]<br />
           ,[DaysToManufacture]<br />
           ,[ProductLine]<br />
           ,[Class]<br />
           ,[Style]<br />
           ,[ProductSubcategoryID]<br />
           ,[ProductModelID]<br />
           ,[SellStartDate]<br />
           ,[SellEndDate]<br />
           ,[DiscontinuedDate]<br />
           ,[rowguid]<br />
           ,[ModifiedDate])<br />
     VALUES<br />
           (&lt;ProductID, int,&gt;<br />
           ,&lt;Name, nvarchar(max),&gt;<br />
           ,&lt;ProductNumber, nvarchar(25),&gt;<br />
           ,&lt;MakeFlag, bit,&gt;<br />
           ,&lt;FinishedGoodsFlag, bit,&gt;<br />
           ,&lt;Color, nvarchar(15),&gt;<br />
           ,&lt;SafetyStockLevel, smallint,&gt;<br />
           ,&lt;ReorderPoint, smallint,&gt;<br />
           ,&lt;StandardCost, money,&gt;<br />
           ,&lt;ListPrice, money,&gt;<br />
           ,&lt;Size, nvarchar(5),&gt;<br />
           ,&lt;SizeUnitMeasureCode, nchar(3),&gt;<br />
           ,&lt;WeightUnitMeasureCode, nchar(3),&gt;<br />
           ,&lt;Weight, decimal(8,2),&gt;<br />
           ,&lt;DaysToManufacture, int,&gt;<br />
           ,&lt;ProductLine, nchar(2),&gt;<br />
           ,&lt;Class, nchar(2),&gt;<br />
           ,&lt;Style, nchar(2),&gt;<br />
           ,&lt;ProductSubcategoryID, int,&gt;<br />
           ,&lt;ProductModelID, int,&gt;<br />
           ,&lt;SellStartDate, datetime,&gt;<br />
           ,&lt;SellEndDate, datetime,&gt;<br />
           ,&lt;DiscontinuedDate, datetime,&gt;<br />
           ,&lt;rowguid, uniqueidentifier,&gt;<br />
           ,&lt;ModifiedDate, datetime,&gt;)<br />
GO<br />
[/sql] </p>
<p>So let us say, we have inserted the data as follows. If you feel bored of inserting data manually, you can always tun the SQL script file attached which has the insertion queries. Just run that, you will be all OK. If you don&#8217;t know how to generate SQL scripts with data, I strongly recommend you to have a read <a href="http://sibeeshpassion.com/generate-database-scripts-with-data-in-sql-server/" target="_blank" rel="noopener">here</a></p>
<p>Next thing we are going to do is creating a ADO.NET Entity Data Model. </p>
<p><strong>Create Entity Data Model</strong></p>
<p>Right click on your model folder and click new, select ADO.NET Entity Data Model. Follow the steps given. Once you have done the processes, you can see the edmx file and other files in your model folder. Here I gave <em>Dashboard</em> for our Entity data model name. Now you can see a file with edmx extension have been created. If you open that file, you can see as below. </p>
<div id="attachment_11364" style="width: 513px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Entity-Data-Model.png"><img decoding="async" aria-describedby="caption-attachment-11364" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Entity-Data-Model.png" alt="Entity Data Model" width="503" height="669" class="size-full wp-image-11364" srcset="/wp-content/uploads/2016/03/Entity-Data-Model.png 503w, /wp-content/uploads/2016/03/Entity-Data-Model-226x300.png 226w, /wp-content/uploads/2016/03/Entity-Data-Model-400x532.png 400w, /wp-content/uploads/2016/03/Entity-Data-Model-451x600.png 451w" sizes="(max-width: 503px) 100vw, 503px" /></a><p id="caption-attachment-11364" class="wp-caption-text">Entity Data Model</p></div>
<p>Now go back our Web API controller. Please change the code as below.</p>
<p>[csharp]<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Net;<br />
using System.Net.Http;<br />
using System.Web.Http;<br />
using MyDashboard.Models;<br />
using Newtonsoft.Json;<br />
namespace MyDashboard.Controllers<br />
{<br />
    public class WidgetController : ApiController<br />
    {<br />
        public DashboardEntities de = new DashboardEntities();<br />
        Retriever ret = new Retriever();<br />
        public string getWidgetData()<br />
        {<br />
            var dataList = ret.GetWidgetData(de);<br />
            return dataList;<br />
        }<br />
    }<br />
}<br />
[/csharp]</p>
<p>Here we have created a new model class <em>Retriever </em> and we have added a method <em>GetWidgetData</em> in that class. Now let us see what I have coded in that.</p>
<p>[csharp]<br />
using Newtonsoft.Json;<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;</p>
<p>namespace MyDashboard.Models<br />
{<br />
    public class Retriever<br />
    {<br />
        public string GetWidgetData(DashboardEntities de)<br />
        {<br />
            try<br />
            {<br />
                using (de)<br />
                {<br />
                    var resList = (from sales in de.SalesOrderDetails<br />
                                  join prod in de.Products<br />
                                  on sales.ProductID equals prod.ProductID<br />
                                  select new<br />
                                  {<br />
                                      ProductName = prod.Name,<br />
                                      QuantityOrdered = sales.OrderQty<br />
                                  });<br />
                    var res = resList.GroupBy(d =&gt; d.ProductName).Select(g =&gt; new<br />
                    {<br />
                        name = g.FirstOrDefault().ProductName,<br />
                        y = g.Sum(s =&gt; s.QuantityOrdered)<br />
                    });<br />
                    return JsonConvert.SerializeObject(res, Formatting.None, new JsonSerializerSettings()<br />
                    {<br />
                        ReferenceLoopHandling = ReferenceLoopHandling.Ignore<br />
                    });<br />
                }<br />
            }<br />
            catch (Exception)<br />
            {<br />
                throw new NotImplementedException();<br />
            }</p>
<p>        }<br />
    }<br />
}<br />
[/csharp]</p>
<p>Here we are using LINQ to fetch the data, We uses JOIN in the query to find the <em>Name </em> from the table Products. Once the data is ready, we are just do group by the column <em>ProductName</em> and sum of <em>QuantityOrdered</em>. </p>
<p>[csharp]<br />
var res = resList.GroupBy(d =&gt; d.ProductName).Select(g =&gt; new<br />
                    {<br />
                        name = g.FirstOrDefault().ProductName,<br />
                        y = g.Sum(s =&gt; s.QuantityOrdered)<br />
                    });<br />
[/csharp]</p>
<p>So the coding part to fetch the data from database is read, now we need to check whether our Web API is ready for action!. To check that, you just need to run the URL <em>http://localhost:1646/Api/Widget</em>. Here <em>Widget</em> is our Web API controller name. I hope you get the data as a result. If you are getting the error <em>Server Error in &#8216;/&#8217; Application The resource cannot be found</em>, you need to configure your Web API in <em>Global.asax.cs</em>. You got this error just because you created an Empty project with only needed references. So here we need to do his step by our own. No worries, we will do it now. Just change the <em>Global.asax.cs </em>as follows. </p>
<p>[csharp]<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Http;<br />
using System.Web.Mvc;<br />
using System.Web.Routing;</p>
<p>namespace MyDashboard<br />
{<br />
    public class MvcApplication : System.Web.HttpApplication<br />
    {<br />
        protected void Application_Start()<br />
        {<br />
            AreaRegistration.RegisterAllAreas();<br />
            GlobalConfiguration.Configure(WebApiConfig.Register);//This is for setting the configuration<br />
            RouteConfig.RegisterRoutes(RouteTable.Routes);<br />
        }<br />
    }<br />
}<br />
[/csharp]</p>
<p>Now build your application and run the same URL again, you will get the output as follows. </p>
<div id="attachment_11365" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Web-API-Output.png"><img decoding="async" aria-describedby="caption-attachment-11365" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Web-API-Output-1024x258.png" alt="Web API Output" width="634" height="160" class="size-large wp-image-11365" srcset="/wp-content/uploads/2016/03/Web-API-Output-1024x258.png 1024w, /wp-content/uploads/2016/03/Web-API-Output-300x75.png 300w, /wp-content/uploads/2016/03/Web-API-Output-768x193.png 768w, /wp-content/uploads/2016/03/Web-API-Output-400x101.png 400w, /wp-content/uploads/2016/03/Web-API-Output.png 1367w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11365" class="wp-caption-text">Web API Output</p></div>
<p>Now we will go back to our angular JS files and consume this Web API. You need to change the scripts in the <em>app.js, controller.js, factory.js</em> as follows.</p>
<p><strong>app.js</strong></p>
<p>[js]<br />
(function () {<br />
    &#8216;use strict&#8217;;<br />
    angular.module(&#8216;WidgetsApp&#8217;, []);<br />
})();<br />
[/js]</p>
<p><strong>controller.js</strong></p>
<p>[js]<br />
(function () {<br />
    &#8216;use strict&#8217;;<br />
    angular<br />
        .module(&#8216;WidgetsApp&#8217;)<br />
        .controller(&#8216;WidgetsController&#8217;, function ($scope, factory) {<br />
            var res = factory.getData();<br />
            var options;<br />
            if (res != undefined) {<br />
                res.then(function (d) {<br />
                    var data = JSON.parse(d.data);</p>
<p>                }, function (error) {<br />
                    console.log(&#8216;Oops! Something went wrong while fetching the data.&#8217;);<br />
                });<br />
            }<br />
        });<br />
})();</p>
<p>[/js]</p>
<p>Once our service is called, we will get the data in return. We will parse the same and store it in a variable for future use.</p>
<p>[js]<br />
var data = JSON.parse(d.data);<br />
[/js]</p>
<p><strong>factory.js</strong></p>
<p>[js]<br />
(function () {<br />
    &#8216;use strict&#8217;;<br />
    angular<br />
        .module(&#8216;WidgetsApp&#8217;)<br />
        .service(&#8216;factory&#8217;, function ($http) {<br />
            this.getData = function () {<br />
                var url = &#8216;Api/Widget&#8217;;<br />
                return $http({<br />
                    type: &#8216;get&#8217;,<br />
                    url: url<br />
                });<br />
            }<br />
        });<br />
})();<br />
[/js]</p>
<p>AS you can see we are just calling our Web API <em>Api/Widget</em> with the help of <a href="http://sibeeshpassion.com/learning-angularjs-http/" target="_blank" rel="noopener">Angular $http.</a></p>
<p>Now we a view to show our data right? Yes, we need a controller too!.</p>
<p><strong>Create a MVC controller</strong></p>
<p>To create a controller, we need to right click on the controller folder, Add &#8211; Controller. I hope you will be given a controller as follows. </p>
<p>[csharp]<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Mvc;</p>
<p>namespace MyDashboard.Controllers<br />
{<br />
    public class HomeController : Controller<br />
    {<br />
        // GET: Home<br />
        public ActionResult Index()<br />
        {<br />
            return View();<br />
        }<br />
    }<br />
}<br />
[/csharp]</p>
<p>Here <em>Home</em> is our controller name. </p>
<p>Now we need a view right?</p>
<p><strong>Creating a view</strong></p>
<p>To create a view, just right click on your controller name -> Add View -> Add.</p>
<div id="attachment_11366" style="width: 635px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Creating-a-view.png"><img decoding="async" aria-describedby="caption-attachment-11366" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Creating-a-view.png" alt="Creating a view" width="625" height="398" class="size-full wp-image-11366" srcset="/wp-content/uploads/2016/03/Creating-a-view.png 625w, /wp-content/uploads/2016/03/Creating-a-view-300x191.png 300w, /wp-content/uploads/2016/03/Creating-a-view-400x255.png 400w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-11366" class="wp-caption-text">Creating a view</p></div>
<p>Now in your view add the needed references.</p>
<p>[html]<br />
&lt;script src=&quot;~/scripts/jquery-1.10.2.min.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;~/scripts/jquery-ui-1.11.4.min.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;~/scripts/angular.min.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;~/scripts/angular-aria.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;~/scripts/angular-route.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;~/scripts/Widgets/app.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;~/scripts/Widgets/controller.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;~/scripts/Widgets/factory.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>Once we add the references, we can call our Angular JS controller as follows.</p>
<p>[html]<br />
&lt;div ng-app=&quot;WidgetsApp&quot;&gt;<br />
    &lt;div ng-controller=&quot;WidgetsController&quot;&gt;<br />
    &lt;/div&gt;<br />
&lt;/div&gt;<br />
[/html]</p>
<p>Now if you run your application, you can see our Web API call works fine and successfully get the data. Next thing we need to do is creating charts with the data we get.</p>
<p><strong>Create chart widgets with the data</strong></p>
<p>As I said, we are going to to create HighChart chart widgets, we need to add a reference to use that plug in.</p>
<p>[html]<br />
&lt;script src=&quot;https://code.highcharts.com/highcharts.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>Now create elements where we can load our chart.</p>
<p>[html]<br />
&lt;div ng-app=&quot;WidgetsApp&quot;&gt;<br />
    &lt;div ng-controller=&quot;WidgetsController&quot;&gt;<br />
        &lt;div id=&quot;widgetPie&quot; class=&quot;widget&quot;&gt;Placeholder for chart&lt;/div&gt;<br />
        &lt;div id=&quot;widgetspline&quot; class=&quot;widget&quot;&gt;Placeholder for chart&lt;/div&gt;<br />
        &lt;div id=&quot;widgetBar&quot; class=&quot;widget&quot;&gt;Placeholder for chart&lt;/div&gt;<br />
        &lt;div id=&quot;widgetLine&quot; class=&quot;widget&quot;&gt;Placeholder for chart&lt;/div&gt;<br />
        &lt;div id=&quot;widgetScatter&quot; class=&quot;widget&quot;&gt;Placeholder for chart&lt;/div&gt;<br />
        &lt;div id=&quot;widgetColumn&quot; class=&quot;widget&quot;&gt;Placeholder for chart&lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/div&gt;<br />
[/html]</p>
<p>You can style your elements as follows if you want, but this is optional.</p>
<p>[css]<br />
&lt;style&gt;<br />
    .widget {<br />
        width: 30%;<br />
        border: 1px solid #ccc;<br />
        padding: 10px;<br />
        margin: 5px;<br />
        border-radius: 3px;<br />
        transition: none;<br />
        -webkit-transition: none;<br />
        -moz-transition: none;<br />
        -o-transition: none;<br />
        cursor: move;<br />
        display: inline-block;<br />
        float:left;<br />
    }<br />
&lt;/style&gt;<br />
[/css]</p>
<p>Go back to our Angular JS controller and add the below codes right after we get the data from server. </p>
<p><strong>Pie Chart</strong></p>
<p>[js]<br />
var data = JSON.parse(d.data);<br />
                    var categories = [];<br />
                    for (var i = 0; i &lt; data.length; i++) {<br />
                        categories.push(data[i].name)<br />
                    }<br />
                    options = new Highcharts.chart(&#8216;widgetPie&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;pie&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Pie Chart&#8217;<br />
                        },<br />
                        plotOptions: {<br />
                            pie: {<br />
                                allowPointSelect: true,<br />
                                cursor: &#8216;pointer&#8217;,<br />
                                dataLabels: {<br />
                                    enabled: false,<br />
                                    format: &#8216;&lt;b&gt;{point.name}&lt;/b&gt;: {point.y:,.0f}&#8217;<br />
                                }<br />
                            }<br />
                        },<br />
                        series: [{<br />
                            name:&#8217;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
[/js]</p>
<p>Now run your application, you can see a pie chart with the data given. </p>
<div id="attachment_11368" style="width: 358px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Pie-Chart-In-MVC-With-Angular-JS-And-Web-API.png"><img decoding="async" aria-describedby="caption-attachment-11368" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Pie-Chart-In-MVC-With-Angular-JS-And-Web-API.png" alt="Pie Chart In MVC With Angular JS And Web API" width="348" height="427" class="size-full wp-image-11368" srcset="/wp-content/uploads/2016/03/Pie-Chart-In-MVC-With-Angular-JS-And-Web-API.png 348w, /wp-content/uploads/2016/03/Pie-Chart-In-MVC-With-Angular-JS-And-Web-API-244x300.png 244w" sizes="(max-width: 348px) 100vw, 348px" /></a><p id="caption-attachment-11368" class="wp-caption-text">Pie Chart In MVC With Angular JS And Web API</p></div>
<p><strong>Column Chart</strong></p>
<p>[js]<br />
options = new Highcharts.chart(&#8216;widgetColumn&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;column&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Column Chart&#8217;<br />
                        },<br />
                        series: [{<br />
                            name: &#8216;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
[/js]</p>
<p>Now run your application, you can see a column chart with the data given. </p>
<div id="attachment_11369" style="width: 364px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Column-Chart-In-MVC-With-Angular-JS-And-Web-API.png"><img decoding="async" aria-describedby="caption-attachment-11369" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Column-Chart-In-MVC-With-Angular-JS-And-Web-API.png" alt="Column Chart In MVC With Angular JS And Web API" width="354" height="433" class="size-full wp-image-11369" srcset="/wp-content/uploads/2016/03/Column-Chart-In-MVC-With-Angular-JS-And-Web-API.png 354w, /wp-content/uploads/2016/03/Column-Chart-In-MVC-With-Angular-JS-And-Web-API-245x300.png 245w" sizes="(max-width: 354px) 100vw, 354px" /></a><p id="caption-attachment-11369" class="wp-caption-text">Column Chart In MVC With Angular JS And Web API</p></div>
<p><strong>Bar Chart</strong></p>
<p>[js]<br />
options = new Highcharts.chart(&#8216;widgetBar&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;bar&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Bar Chart&#8217;<br />
                        },<br />
                        series: [{<br />
                            name: &#8216;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
[/js]</p>
<p>Now run your application, you can see a Bar chart with the data given. </p>
<div id="attachment_11370" style="width: 362px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Bar-Chart-In-MVC-With-Angular-JS-And-Web-API.png"><img decoding="async" aria-describedby="caption-attachment-11370" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Bar-Chart-In-MVC-With-Angular-JS-And-Web-API.png" alt="Bar Chart In MVC With Angular JS And Web API" width="352" height="431" class="size-full wp-image-11370" srcset="/wp-content/uploads/2016/03/Bar-Chart-In-MVC-With-Angular-JS-And-Web-API.png 352w, /wp-content/uploads/2016/03/Bar-Chart-In-MVC-With-Angular-JS-And-Web-API-245x300.png 245w" sizes="(max-width: 352px) 100vw, 352px" /></a><p id="caption-attachment-11370" class="wp-caption-text">Bar Chart In MVC With Angular JS And Web API</p></div>
<p><strong>Line Chart</strong></p>
<p>[js]<br />
options = new Highcharts.chart(&#8216;widgetLine&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;line&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Line Chart&#8217;<br />
                        },<br />
                        series: [{<br />
                            name: &#8216;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
[/js]</p>
<p>Now run your application, you can see a Line chart with the data given. </p>
<div id="attachment_11371" style="width: 364px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Line-Chart-In-MVC-With-Angular-JS-And-Web-API.png"><img decoding="async" aria-describedby="caption-attachment-11371" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Line-Chart-In-MVC-With-Angular-JS-And-Web-API.png" alt="Line Chart In MVC With Angular JS And Web API" width="354" height="436" class="size-full wp-image-11371" srcset="/wp-content/uploads/2016/03/Line-Chart-In-MVC-With-Angular-JS-And-Web-API.png 354w, /wp-content/uploads/2016/03/Line-Chart-In-MVC-With-Angular-JS-And-Web-API-244x300.png 244w" sizes="(max-width: 354px) 100vw, 354px" /></a><p id="caption-attachment-11371" class="wp-caption-text">Line Chart In MVC With Angular JS And Web API</p></div>
<p><strong>Spline Chart</strong></p>
<p>[js]<br />
options = new Highcharts.chart(&#8216;widgetspline&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;spline&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Spline Chart&#8217;<br />
                        },<br />
                        series: [{<br />
                            name: &#8216;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
[/js]</p>
<p>Now run your application, you can see a Spline chart with the data given. </p>
<div id="attachment_11372" style="width: 363px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Spline-Chart-In-MVC-With-Angular-JS-And-Web-API.png"><img decoding="async" aria-describedby="caption-attachment-11372" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Spline-Chart-In-MVC-With-Angular-JS-And-Web-API.png" alt="Spline Chart In MVC With Angular JS And Web API" width="353" height="432" class="size-full wp-image-11372" srcset="/wp-content/uploads/2016/03/Spline-Chart-In-MVC-With-Angular-JS-And-Web-API.png 353w, /wp-content/uploads/2016/03/Spline-Chart-In-MVC-With-Angular-JS-And-Web-API-245x300.png 245w" sizes="(max-width: 353px) 100vw, 353px" /></a><p id="caption-attachment-11372" class="wp-caption-text">Spline Chart In MVC With Angular JS And Web API</p></div>
<p><strong>Scatter Chart</strong></p>
<p>[js]<br />
 options = new Highcharts.chart(&#8216;widgetScatter&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;scatter&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Scatter Chart&#8217;<br />
                        },<br />
                        series: [{<br />
                            name: &#8216;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
[/js]</p>
<p>Now run your application, you can see a Scatter chart with the data given. </p>
<div id="attachment_11374" style="width: 361px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Scatter-Chart-In-MVC-With-Angular-JS-And-Web-API.png"><img decoding="async" aria-describedby="caption-attachment-11374" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Scatter-Chart-In-MVC-With-Angular-JS-And-Web-API.png" alt="Scatter Chart In MVC With Angular JS And Web API" width="351" height="432" class="size-full wp-image-11374" srcset="/wp-content/uploads/2016/03/Scatter-Chart-In-MVC-With-Angular-JS-And-Web-API.png 351w, /wp-content/uploads/2016/03/Scatter-Chart-In-MVC-With-Angular-JS-And-Web-API-244x300.png 244w" sizes="(max-width: 351px) 100vw, 351px" /></a><p id="caption-attachment-11374" class="wp-caption-text">Scatter Chart In MVC With Angular JS And Web API</p></div>
<p>Now this is how complete code for our controller.js file looks like. </p>
<p>[js]<br />
(function () {<br />
    &#8216;use strict&#8217;;<br />
    angular<br />
        .module(&#8216;WidgetsApp&#8217;)<br />
        .controller(&#8216;WidgetsController&#8217;, function ($scope, factory) {<br />
            var res = factory.getData();<br />
            var options;<br />
            if (res != undefined) {<br />
                res.then(function (d) {<br />
                    var data = JSON.parse(d.data);<br />
                    var categories = [];<br />
                    for (var i = 0; i &lt; data.length; i++) {<br />
                        categories.push(data[i].name)<br />
                    }<br />
                    options = new Highcharts.chart(&#8216;widgetPie&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;pie&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Pie Chart&#8217;<br />
                        },<br />
                        plotOptions: {<br />
                            pie: {<br />
                                allowPointSelect: true,<br />
                                cursor: &#8216;pointer&#8217;,<br />
                                dataLabels: {<br />
                                    enabled: false,<br />
                                    format: &#8216;&lt;b&gt;{point.name}&lt;/b&gt;: {point.y:,.0f}&#8217;<br />
                                }<br />
                            }<br />
                        },<br />
                        series: [{<br />
                            name:&#8217;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
                    options = new Highcharts.chart(&#8216;widgetColumn&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;column&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Column Chart&#8217;<br />
                        },<br />
                        series: [{<br />
                            name: &#8216;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
                    options = new Highcharts.chart(&#8216;widgetBar&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;bar&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Bar Chart&#8217;<br />
                        },<br />
                        series: [{<br />
                            name: &#8216;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
                    options = new Highcharts.chart(&#8216;widgetLine&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;line&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Line Chart&#8217;<br />
                        },<br />
                        series: [{<br />
                            name: &#8216;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
                    options = new Highcharts.chart(&#8216;widgetspline&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;spline&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Spline Chart&#8217;<br />
                        },<br />
                        series: [{<br />
                            name: &#8216;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
                    options = new Highcharts.chart(&#8216;widgetScatter&#8217;, {<br />
                        credits: {<br />
                            enabled: false<br />
                        },<br />
                        chart: {<br />
                            type: &#8216;scatter&#8217;,<br />
                            renderTo: &#8221;<br />
                        },<br />
                        title: {<br />
                            text: &#8216;Product VS Quantity &#8211; Scatter Chart&#8217;<br />
                        },<br />
                        series: [{<br />
                            name: &#8216;Quantity&#8217;,<br />
                            data: data<br />
                        }]<br />
                    });<br />
                }, function (error) {<br />
                    console.log(&#8216;Oops! Something went wrong while fetching the data.&#8217;);<br />
                });<br />
            }<br />
        });<br />
})();<br />
[/js]</p>
<p>If you have configured all the chart types, we can see the output now 🙂</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chart-Widgets-In-MVC-With-Angular-JS-And-Web-API-e1458191984345.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chart-Widgets-In-MVC-With-Angular-JS-And-Web-API-1024x907.png" alt="Chart Widgets In MVC With Angular JS And Web API" width="634" height="562" class="alignnone size-large wp-image-11375" /></a></p>
<p>We have done everything!. That&#8217;s fantastic right? Have a happy coding.</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Did you try Web API yet? Have you ever wanted to do this requirement? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn&#8217;t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/chart-widgets-with-server-side-data-in-mvc-using-angular-js-and-web-api/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Remove Time Stamp Form Legend In HighChart</title>
		<link>https://mail.sibeeshpassion.com/remove-time-stamp-form-legend-in-highchart/</link>
					<comments>https://mail.sibeeshpassion.com/remove-time-stamp-form-legend-in-highchart/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 25 Jan 2016 06:04:08 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[HighChart]]></category>
		<category><![CDATA[labelFormatter]]></category>
		<category><![CDATA[Remove Timestamp]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11161</guid>

					<description><![CDATA[In this code snippet we will discuss how we can remove the time stamp from the legend in high chart. Some times it will not be good if we show the the default time stamps in the legend. So to remove the time stamp you can use the labelFormatter function. [js] labelFormatter: function () { return this.name.toString().replace(&#8216; 00:00:00.000&#8217;, &#8221;).replace(&#8216; 00:00:00.00&#8217;, &#8221;).replace(&#8216; 00:00:00&#8217;, &#8221;); } [/js] Just add that function in your legend settings will do the remaining. Happy Coding!. Please see my other posts code snippets here: Code Snippets Kindest Regards Sibeesh Venu]]></description>
										<content:encoded><![CDATA[<p>In this code snippet we will discuss how we can remove the time stamp from the legend in high chart. Some times it will not be good if we show the the default time stamps in the legend. So to remove the time stamp you can use the <em>labelFormatter </em>function. </p>
<p>[js]<br />
 labelFormatter: function () {<br />
                return this.name.toString().replace(&#8216; 00:00:00.000&#8217;, &#8221;).replace(&#8216; 00:00:00.00&#8217;, &#8221;).replace(&#8216; 00:00:00&#8217;, &#8221;);<br />
            }<br />
[/js]</p>
<p>Just add that function in your legend settings will do the remaining. Happy Coding!.</p>
<p>Please see my other posts code snippets here: <a href="http://sibeeshpassion.com/category/code-snippets/" target="_blank">Code Snippets</a></p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/remove-time-stamp-form-legend-in-highchart/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Custom Events In Highcharts</title>
		<link>https://mail.sibeeshpassion.com/custom-events-in-highcharts/</link>
					<comments>https://mail.sibeeshpassion.com/custom-events-in-highcharts/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 06 Oct 2015 13:38:03 +0000</pubDate>
				<category><![CDATA[HighChart]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Custom Events In HighChart]]></category>
		<category><![CDATA[Double Click Event In HighChart Points]]></category>
		<category><![CDATA[Drill Down Chart]]></category>
		<category><![CDATA[HighChart Events]]></category>
		<category><![CDATA[Show Alert When Double Click]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10762</guid>

					<description><![CDATA[In this post we will discuss how we can handle custom events in HighChart . HighChart has already given enough events but sometimes we may need to handle some additional events. For example if we need to fire an alert if user double clicks on the points. Here I am using HighChart Drill Down Chart, So As you all know drill down chart is a chart which populate another chart according to the user action, ie if user click on a particular series, a chart with the related data of the clicked series will get loaded. Now we will go [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will discuss how we can handle custom events in <a href="http://sibeeshpassion.com/category/highchart/" target="_blank">HighChart </a>. HighChart has already given enough events but sometimes we may need to handle some additional events. For example if we need to fire an alert if user double clicks on the points. Here I am using HighChart Drill Down Chart, So As you all know drill down chart is a chart which populate another chart according to the user action, ie if user click on a particular series, a chart with the related data of the clicked series will get loaded. Now we will go and see it in action. I hope you will like this. </p>
<p><strong>Background</strong></p>
<p>I am working in a BI dashboard application, thus recently I got a requirement of giving an alert if user clicks on the chart point. Here I will explain the same with an example of high chart drill down type. </p>
<p>Please see the demo here: <a href="http://sibeeshpassion.com/demo/Fire-Double-Click-Event-InHighChart.html" target="_blank">Custom Events in Drill Down Chart</a></p>
<p><strong>Using the code</strong></p>
<p>First of all we will create a page as follows.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Fire Double Click Events In Highcharts&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Fire Double Click Events In Highcharts &#8211; Sibeesh Passion (&lt;a href=&quot;http://sibeeshpassion.com&quot;&gt;Sibeesh Passion &lt;/a&gt;)<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;container&quot; style=&quot;height: 300px&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p>Next we will add the needed references. </p>
<p>[js]<br />
 &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/highcharts.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/drilldown.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://blacklabel.github.io/custom_events/customEvents.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Here you can see we have added a file <em>customEvents.js</em>, please do not forget to add this file. This is much important.</p>
<p>The next step is to load the chart, We can create a chart as follows. </p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
            // Internationalization<br />
            Highcharts.setOptions({<br />
                lang: {<br />
                    drillUpText: &#8216;? Back to {series.name}&#8217;<br />
                }<br />
            });</p>
<p>            var options = {<br />
                chart: {<br />
                    height: 300,<br />
                    events: {<br />
                    }<br />
                },</p>
<p>                title: {<br />
                    text: &#8216;Highcharts Drilldown Plugin&#8217;<br />
                },</p>
<p>                xAxis: {<br />
                    categories: true<br />
                },</p>
<p>                drilldown: {<br />
                    series: [{<br />
                        id: &#8216;fruits&#8217;,<br />
                        name: &#8216;Fruits&#8217;,<br />
                        data: [<br />
                            [&#8216;Apples&#8217;, 4],<br />
                            [&#8216;Pears&#8217;, 6],<br />
                            [&#8216;Oranges&#8217;, 2],<br />
                            [&#8216;Grapes&#8217;, 8]<br />
                        ]<br />
                    }, {<br />
                        id: &#8216;cars&#8217;,<br />
                        name: &#8216;Cars&#8217;,<br />
                        data: [{<br />
                            name: &#8216;Toyota&#8217;,<br />
                            y: 4,<br />
                            drilldown: &#8216;toyota&#8217;<br />
                        },<br />
                        [&#8216;Volkswagen&#8217;, 3],<br />
                        [&#8216;Opel&#8217;, 5]<br />
                        ]<br />
                    }, {<br />
                        id: &#8216;toyota&#8217;,<br />
                        name: &#8216;Toyota&#8217;,<br />
                        data: [<br />
                            [&#8216;RAV4&#8217;, 3],<br />
                            [&#8216;Corolla&#8217;, 1],<br />
                            [&#8216;Carina&#8217;, 4],<br />
                            [&#8216;Land Cruiser&#8217;, 5]<br />
                        ]<br />
                    }]<br />
                },</p>
<p>                legend: {<br />
                    enabled: false<br />
                },<br />
                series: [{<br />
                    name: &#8216;Overview&#8217;,<br />
                    colorByPoint: true,<br />
                    data: [{<br />
                        name: &#8216;Fruits&#8217;,<br />
                        y: 10,<br />
                        drilldown: &#8216;fruits&#8217;<br />
                    }, {<br />
                        name: &#8216;Cars&#8217;,<br />
                        y: 12,<br />
                        drilldown: &#8216;cars&#8217;<br />
                    }, {<br />
                        name: &#8216;Countries&#8217;,<br />
                        y: 8<br />
                    }]<br />
                }]<br />
            };</p>
<p>            // Drill Down Chart Implementation<br />
            options.chart.renderTo = &#8216;container&#8217;;<br />
            options.chart.type = &#8216;column&#8217;;<br />
            var chart1 = new Highcharts.Chart(options);</p>
<p>        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>Now if you run your page you can see a drill down chart as follows. </p>
<div id="attachment_10764" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts.png"><img decoding="async" aria-describedby="caption-attachment-10764" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts-1024x301.png" alt="Fire Double Click Events In Highcharts " width="634" height="186" class="size-large wp-image-10764" srcset="/wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts-1024x301.png 1024w, /wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts-300x88.png 300w, /wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts-768x225.png 768w, /wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts-400x117.png 400w, /wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts.png 1356w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-10764" class="wp-caption-text">Fire Double Click Events In Highcharts</p></div>
<p>Now here is the main part, we need to add a plot option to the chart option so that we can track the events. Please add the preceding lines of code.</p>
<p>[js]<br />
plotOptions: {<br />
                    series: {<br />
                        point: {<br />
                            events: {<br />
                                dblclick: function () {<br />
                                    setTimeout(function () {<br />
                                        alert(&#8216;Double Click Is Not Permitted&#8217;);<br />
                                    }, 1000);<br />
                                    return false;<br />
                                }<br />
                            }<br />
                        }<br />
                    }<br />
                }<br />
[/js]</p>
<p>We have created a custom double click event <em>dblclick</em> successfully. In this way you can create custom events in highchart wherever you want, like create click and double click event in axis and label and data labels so on&#8230;</p>
<p>That&#8217;s all, we did it. Now please find the complete code.</p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Fire Double Click Events In Highcharts&lt;/title&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/highcharts.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/drilldown.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://blacklabel.github.io/custom_events/customEvents.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function () {<br />
            // Internationalization<br />
            Highcharts.setOptions({<br />
                lang: {<br />
                    drillUpText: &#8216;? Back to {series.name}&#8217;<br />
                }<br />
            });</p>
<p>            var options = {<br />
                chart: {<br />
                    height: 300,<br />
                    events: {<br />
                    }<br />
                },</p>
<p>                title: {<br />
                    text: &#8216;Highcharts Drilldown Plugin&#8217;<br />
                },</p>
<p>                xAxis: {<br />
                    categories: true<br />
                },</p>
<p>                drilldown: {<br />
                    series: [{<br />
                        id: &#8216;fruits&#8217;,<br />
                        name: &#8216;Fruits&#8217;,<br />
                        data: [<br />
                            [&#8216;Apples&#8217;, 4],<br />
                            [&#8216;Pears&#8217;, 6],<br />
                            [&#8216;Oranges&#8217;, 2],<br />
                            [&#8216;Grapes&#8217;, 8]<br />
                        ]<br />
                    }, {<br />
                        id: &#8216;cars&#8217;,<br />
                        name: &#8216;Cars&#8217;,<br />
                        data: [{<br />
                            name: &#8216;Toyota&#8217;,<br />
                            y: 4,<br />
                            drilldown: &#8216;toyota&#8217;<br />
                        },<br />
                        [&#8216;Volkswagen&#8217;, 3],<br />
                        [&#8216;Opel&#8217;, 5]<br />
                        ]<br />
                    }, {<br />
                        id: &#8216;toyota&#8217;,<br />
                        name: &#8216;Toyota&#8217;,<br />
                        data: [<br />
                            [&#8216;RAV4&#8217;, 3],<br />
                            [&#8216;Corolla&#8217;, 1],<br />
                            [&#8216;Carina&#8217;, 4],<br />
                            [&#8216;Land Cruiser&#8217;, 5]<br />
                        ]<br />
                    }]<br />
                },</p>
<p>                legend: {<br />
                    enabled: false<br />
                },</p>
<p>                plotOptions: {<br />
                    series: {<br />
                        point: {<br />
                            events: {<br />
                                dblclick: function () {<br />
                                    setTimeout(function () {<br />
                                        alert(&#8216;Double Click Is Not Permitted&#8217;);<br />
                                    }, 1000);<br />
                                    return false;<br />
                                }<br />
                            }<br />
                        }<br />
                    }<br />
                },<br />
                series: [{<br />
                    name: &#8216;Overview&#8217;,<br />
                    colorByPoint: true,<br />
                    data: [{<br />
                        name: &#8216;Fruits&#8217;,<br />
                        y: 10,<br />
                        drilldown: &#8216;fruits&#8217;<br />
                    }, {<br />
                        name: &#8216;Cars&#8217;,<br />
                        y: 12,<br />
                        drilldown: &#8216;cars&#8217;<br />
                    }, {<br />
                        name: &#8216;Countries&#8217;,<br />
                        y: 8<br />
                    }]<br />
                }]<br />
            };</p>
<p>            // Drill Down Chart Implementation<br />
            options.chart.renderTo = &#8216;container&#8217;;<br />
            options.chart.type = &#8216;column&#8217;;<br />
            var chart1 = new Highcharts.Chart(options);</p>
<p>        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Fire Double Click Events In Highcharts &#8211; Sibeesh Passion (&lt;a href=&quot;http://sibeeshpassion.com&quot;&gt;Sibeesh Passion &lt;/a&gt;)<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;container&quot; style=&quot;height: 300px&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p>Now if you run and double click on any series, you will get an output as follows.</p>
<div id="attachment_10769" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts_1.png"><img decoding="async" aria-describedby="caption-attachment-10769" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts_1-1024x294.png" alt="Fire Double Click Events In Highcharts" width="634" height="182" class="size-large wp-image-10769" srcset="/wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts_1-1024x294.png 1024w, /wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts_1-300x86.png 300w, /wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts_1-768x221.png 768w, /wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts_1-400x115.png 400w, /wp-content/uploads/2015/10/Fire_Double_Click_Events_In_Highcharts_1.png 1357w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-10769" class="wp-caption-text">Fire Double Click Events In Highcharts</p></div>
<p>Please see the JSFiddle link here: <a href="http://jsfiddle.net/sibeeshvenu/h7x37dbr/" target="_blank">Fire Double Click Events In Highcharts </a></p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Have you ever wanted this requirement while you play with highchart? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I am able to.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/custom-events-in-highcharts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Generate JSON According To Drill Down Drill Up Events</title>
		<link>https://mail.sibeeshpassion.com/generate-json-according-to-drill-down-drill-up-events/</link>
					<comments>https://mail.sibeeshpassion.com/generate-json-according-to-drill-down-drill-up-events/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 02 Aug 2015 14:53:21 +0000</pubDate>
				<category><![CDATA[Drill Down Chart]]></category>
		<category><![CDATA[HighChart]]></category>
		<category><![CDATA[Drill Down Events]]></category>
		<category><![CDATA[Drill Up Events]]></category>
		<category><![CDATA[Generate JSON According To Drill Down Drill Up Events]]></category>
		<category><![CDATA[HighChart Events]]></category>
		<category><![CDATA[highchart source]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=8311</guid>

					<description><![CDATA[In this post, we will see how we can we generate or create JSON dynamically according to users drill up and drill down event actions. We will create JSON when user clicks on a drill down chart&#8217;s series. We will also learn how we will create a Drill Down Chart. With the help of created JSON we can get the information of which are all the series have been clicked by user or which are all the drill series have been seen by the user. We can do some more things with this JSON. Background For the past few weeks, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post, we will see how we can we generate or create JSON dynamically according to users drill up and drill down event actions. We will create JSON when user clicks on a drill down chart&#8217;s series. We will also learn how we will create a Drill Down Chart. With the help of created JSON we can get the information of which are all the series have been clicked by user or which are all the drill series have been seen by the user. We can do some more things with this JSON. </p>
<p><strong>Background</strong></p>
<p>For the past few weeks, I have been working with the High Chart. And I have got a chance to work with Drill Down chart in High Chart. After implement a drill down chart in my application successfully , I have got an another requirement of creating JSON dynamically according to the user&#8217;s drill down and drill up event action. </p>
<p><strong>Practical Usage</strong></p>
<p>Hereby I am going to share the practical usage of the dynamically crated JSON. We have used this approach in our application. The task was simple but tough though. We have implemented a zooming functionality for each chart we have created. So we placed a zoom button above the chart. When user clicks the zoom button, a dialogue box will be opened with the drill down chart with maximum width and height. The problem we faced is, when user drill the chart to some level and click the zoom button, we were unable to maintain the same drill level in the the chart which is loaded in the dialogue box. Since this functionality was not available in the HighChart itself, We thought to do this our own. For this, we needed the drill level information in which user clicked. So we maintained the information in the format of JSON. And we take the values from this JSON while the new dialogue opens,and apply this to the chart.</p>
<p><strong>Demo</strong></p>
<p>You can see the demo here: <a href="http://sibeeshpassion.com/demo/Generate-JSON-According-To-Drill-Down-Drill-Up-Events/" target="_blank">Generate JSON According To Drill Down Drill Up Events &#8211; Sibeesh Passion</a> </p>
<p><strong>Using the code</strong></p>
<p>The first thing we need to do is to load the required files. </p>
<p>[js]<br />
 &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/highcharts.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/drilldown.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Now we need the data for the chart right?</p>
<p>[js]<br />
data: [{<br />
                        name: &#8216;Fruits&#8217;,<br />
                        y: 10,<br />
                        drilldown: &#8216;fruits&#8217;<br />
                    }, {<br />
                        name: &#8216;Cars&#8217;,<br />
                        y: 12,<br />
                        drilldown: &#8216;cars&#8217;<br />
                    }, {<br />
                        name: &#8216;Countries&#8217;,<br />
                        y: 8<br />
                    }]<br />
[/js]</p>
<p>Since we are creating a drill down chart, we need to set the drill down data also for the chart.</p>
<p>[js]<br />
drilldown: {<br />
                    series: [{<br />
                        id: &#8216;fruits&#8217;,<br />
                        name: &#8216;Fruits&#8217;,<br />
                        data: [<br />
                            [&#8216;Apples&#8217;, 4],<br />
                            [&#8216;Pears&#8217;, 6],<br />
                            [&#8216;Oranges&#8217;, 2],<br />
                            [&#8216;Grapes&#8217;, 8]<br />
                        ]<br />
                    }, {<br />
                        id: &#8216;cars&#8217;,<br />
                        name: &#8216;Cars&#8217;,<br />
                        data: [{<br />
                            name: &#8216;Toyota&#8217;,<br />
                            y: 4,<br />
                            drilldown: &#8216;toyota&#8217;<br />
                        },<br />
                        [&#8216;Volkswagen&#8217;, 3],<br />
                        [&#8216;Opel&#8217;, 5]<br />
                        ]<br />
                    }, {<br />
                        id: &#8216;toyota&#8217;,<br />
                        name: &#8216;Toyota&#8217;,<br />
                        data: [<br />
                            [&#8216;RAV4&#8217;, 3],<br />
                            [&#8216;Corolla&#8217;, 1],<br />
                            [&#8216;Carina&#8217;, 4],<br />
                            [&#8216;Land Cruiser&#8217;, 5]<br />
                        ]<br />
                    }]<br />
                }<br />
[/js]</p>
<p>So we have set the data, now we need to set the complete options for our chart, we will set this in a variable.</p>
<p>[js]<br />
 var options = {<br />
                chart: {<br />
                    height: 300,<br />
                    events: {<br />
                        drilldown: function (e) {<br />
                        },<br />
                        drillup: function (e) {<br />
                        }<br />
                    }<br />
                },</p>
<p>                title: {<br />
                    text: &#8216;Highcharts Drilldown Plugin&#8217;<br />
                },</p>
<p>                xAxis: {<br />
                    categories: true<br />
                },</p>
<p>                drilldown: {<br />
                    series: [{<br />
                        id: &#8216;fruits&#8217;,<br />
                        name: &#8216;Fruits&#8217;,<br />
                        data: [<br />
                            [&#8216;Apples&#8217;, 4],<br />
                            [&#8216;Pears&#8217;, 6],<br />
                            [&#8216;Oranges&#8217;, 2],<br />
                            [&#8216;Grapes&#8217;, 8]<br />
                        ]<br />
                    }, {<br />
                        id: &#8216;cars&#8217;,<br />
                        name: &#8216;Cars&#8217;,<br />
                        data: [{<br />
                            name: &#8216;Toyota&#8217;,<br />
                            y: 4,<br />
                            drilldown: &#8216;toyota&#8217;<br />
                        },<br />
                        [&#8216;Volkswagen&#8217;, 3],<br />
                        [&#8216;Opel&#8217;, 5]<br />
                        ]<br />
                    }, {<br />
                        id: &#8216;toyota&#8217;,<br />
                        name: &#8216;Toyota&#8217;,<br />
                        data: [<br />
                            [&#8216;RAV4&#8217;, 3],<br />
                            [&#8216;Corolla&#8217;, 1],<br />
                            [&#8216;Carina&#8217;, 4],<br />
                            [&#8216;Land Cruiser&#8217;, 5]<br />
                        ]<br />
                    }]<br />
                },</p>
<p>                legend: {<br />
                    enabled: false<br />
                },</p>
<p>                plotOptions: {<br />
                    series: {<br />
                        dataLabels: {<br />
                            enabled: true<br />
                        },<br />
                        shadow: false<br />
                    },<br />
                    pie: {<br />
                        size: &#8216;80%&#8217;<br />
                    }<br />
                },</p>
<p>                series: [{<br />
                    name: &#8216;Overview&#8217;,<br />
                    colorByPoint: true,<br />
                    data: [{<br />
                        name: &#8216;Fruits&#8217;,<br />
                        y: 10,<br />
                        drilldown: &#8216;fruits&#8217;<br />
                    }, {<br />
                        name: &#8216;Cars&#8217;,<br />
                        y: 12,<br />
                        drilldown: &#8216;cars&#8217;<br />
                    }, {<br />
                        name: &#8216;Countries&#8217;,<br />
                        y: 8<br />
                    }]<br />
                }]<br />
            };<br />
[/js]</p>
<p>Everything is set now, what else we need then? Yes we need to assign this option to our chart!.</p>
<p>[js]<br />
// Drill Down Chart Implementation<br />
            options.chart.renderTo = &#8216;container&#8217;;<br />
            options.chart.type = &#8216;column&#8217;;<br />
            var chart1 = new Highcharts.Chart(options);<br />
[/js]</p>
<p>As you can see in the above code, we are rendering the chart to a div called <em>container</em>. So we need to create a dv right?</p>
<p>[html]<br />
&lt;body&gt;<br />
    Generate JSON According To Drill Down Drill Up Events &#8211; Sibeesh Passion (&lt;a href=&quot;http://sibeeshpassion.com&quot;&gt;Sibeesh Passion &lt;/a&gt;)<br />
    &lt;br/&gt;<br />
	&lt;br/&gt;<br />
	&lt;br/&gt;<br />
    &lt;div id=&quot;container&quot; style=&quot;height: 300px&quot;&gt;&lt;/div&gt;<br />
	&lt;div id=&quot;jsonContent&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
[/html]</p>
<p>Now we are ready to run our chart. Shall we run it? If you run, you will get the output as follows.</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events1.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events1-1024x356.png" alt="Generate-JSON_According-To-Drill-Down-Drill-Up-Events1" width="634" height="220" class="alignnone size-large wp-image-8371" srcset="/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events1-1024x356.png 1024w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events1-300x104.png 300w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events1-768x267.png 768w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events1-400x139.png 400w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events1.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
<p>Now if you drill down to <em>Cars</em> you will get the below output.</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events2.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events2-1024x264.png" alt="Generate-JSON_According-To-Drill-Down-Drill-Up-Events2" width="634" height="163" class="alignnone size-large wp-image-8381" srcset="/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events2-1024x264.png 1024w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events2-300x77.png 300w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events2-768x198.png 768w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events2-400x103.png 400w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events2.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
<p>It is time to create the JSON now. We will save the JSON value to sessionStorage. If you are new to sessionStorage and localStorage you can read it here: <a href="http://sibeeshpassion.com/tag/local-storage/" target="_blank">Storage Mechanism in HTML5</a></p>
<p>Once we assign the value to the storage, you can see that in browser console. We will also set this value to a div called <em>jsonContent</em>. </p>
<p>We will create a function for creating this JSON first.</p>
<p>[js]<br />
 function generateDrillDownJSON(e, isDrillUp) {<br />
            try {<br />
                if (isDrillUp) {<br />
                    if (myJSON != null &amp;&amp; myJSON.length &gt; 0) {<br />
                        removeArrayElementByIndex(myJSON, myJSON.length &#8211; 1);<br />
                    }<br />
                    sessionStorage.setItem(&#8216;DrillDownJSON&#8217;, JSON.stringify(myJSON));<br />
					$(&quot;#jsonContent&quot;).html(&#8216;JSON content is: &#8216;).append(JSON.stringify(myJSON));<br />
                } else {<br />
                    myJSON.push({<br />
                        name: e.point.name,<br />
                        level: myJSON.length + 1,<br />
                    });<br />
                    sessionStorage.setItem(&#8216;DrillDownJSON&#8217;, JSON.stringify(myJSON));<br />
					$(&quot;#jsonContent&quot;).html(&#8216;JSON content is: &#8216;).append(JSON.stringify(myJSON));<br />
                }</p>
<p>            } catch (e) {<br />
                console.log(&#8216;generateHierarchyJSON :&#8217; + e.message);<br />
            }<br />
        }<br />
[/js]</p>
<p>As you can see we are handling the drill events in this function. If it is drill up event, we are removing the values from the JSON created. To remove, we are creating an another function.</p>
<p>[js]<br />
 function removeArrayElementByIndex(myArray, index) {<br />
            myArray.splice(index, 1);<br />
        }<br />
[/js]</p>
<p>We will call our function <em>generateDrillDownJSON</em> in both drill down and drill up event. </p>
<p>[js]<br />
events: {<br />
                        drilldown: function (e) {<br />
                            generateDrillDownJSON(e, false);<br />
                        },<br />
                        drillup: function (e) {<br />
                            generateDrillDownJSON(e, true);<br />
                        }<br />
                    }<br />
[/js]</p>
<p>It is time to see our implementation and check whether it is working fine or not. So run your application now and click on the <em>Cars</em> series. You can see the JSON created in our div.</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events3.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events3-1024x302.png" alt="Generate-JSON_According-To-Drill-Down-Drill-Up-Events3" width="634" height="187" class="alignnone size-large wp-image-8391" srcset="/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events3-1024x302.png 1024w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events3-300x88.png 300w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events3-768x226.png 768w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events3-400x118.png 400w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events3.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
<p>If you need to see the JSON value in the session storage, please click F12 and check in session storage.</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events4.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events4-300x58.png" alt="Generate-JSON_According-To-Drill-Down-Drill-Up-Events4" width="300" height="58" class="alignnone size-medium wp-image-8401" srcset="/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events4-300x58.png 300w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events4-768x148.png 768w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events4-400x77.png 400w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events4.png 634w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events5.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events5-1024x403.png" alt="Generate-JSON_According-To-Drill-Down-Drill-Up-Events5" width="634" height="250" class="alignnone size-large wp-image-8411" srcset="/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events5-1024x403.png 1024w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events5-300x118.png 300w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events5-768x302.png 768w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events5-400x157.png 400w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events5.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
<p>Now we will try the drill up event and check the JSON value.</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events6.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events6-1024x406.png" alt="Generate-JSON_According-To-Drill-Down-Drill-Up-Events6" width="634" height="251" class="alignnone size-large wp-image-8421" srcset="/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events6-1024x406.png 1024w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events6-300x119.png 300w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events6-768x305.png 768w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events6-400x159.png 400w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events6.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events7.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events7-1024x404.png" alt="Generate-JSON_According-To-Drill-Down-Drill-Up-Events7" width="634" height="250" class="alignnone size-large wp-image-8431" srcset="/wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events7-1024x404.png 1024w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events7-300x118.png 300w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events7-768x303.png 768w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events7-400x158.png 400w, /wp-content/uploads/2015/08/Generate-JSON_According-To-Drill-Down-Drill-Up-Events7.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
<p>You can see that while drill up, we are deleting those values from JSON. </p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Generate JSON According To Drill Down Drill Up Events Demo-Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/highcharts.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/drilldown.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        var myJSON = [];<br />
        $(document).ready(function () {<br />
            // Internationalization<br />
            Highcharts.setOptions({<br />
                lang: {<br />
                    drillUpText: &#8216;◁ Back to {series.name}&#8217;<br />
                }<br />
            });</p>
<p>            var options = {<br />
                chart: {<br />
                    height: 300,<br />
                    events: {<br />
                        drilldown: function (e) {<br />
                            generateDrillDownJSON(e, false);<br />
                        },<br />
                        drillup: function (e) {<br />
                            generateDrillDownJSON(e, true);<br />
                        }<br />
                    }<br />
                },</p>
<p>                title: {<br />
                    text: &#8216;Highcharts Drilldown Plugin&#8217;<br />
                },</p>
<p>                xAxis: {<br />
                    categories: true<br />
                },</p>
<p>                drilldown: {<br />
                    series: [{<br />
                        id: &#8216;fruits&#8217;,<br />
                        name: &#8216;Fruits&#8217;,<br />
                        data: [<br />
                            [&#8216;Apples&#8217;, 4],<br />
                            [&#8216;Pears&#8217;, 6],<br />
                            [&#8216;Oranges&#8217;, 2],<br />
                            [&#8216;Grapes&#8217;, 8]<br />
                        ]<br />
                    }, {<br />
                        id: &#8216;cars&#8217;,<br />
                        name: &#8216;Cars&#8217;,<br />
                        data: [{<br />
                            name: &#8216;Toyota&#8217;,<br />
                            y: 4,<br />
                            drilldown: &#8216;toyota&#8217;<br />
                        },<br />
                        [&#8216;Volkswagen&#8217;, 3],<br />
                        [&#8216;Opel&#8217;, 5]<br />
                        ]<br />
                    }, {<br />
                        id: &#8216;toyota&#8217;,<br />
                        name: &#8216;Toyota&#8217;,<br />
                        data: [<br />
                            [&#8216;RAV4&#8217;, 3],<br />
                            [&#8216;Corolla&#8217;, 1],<br />
                            [&#8216;Carina&#8217;, 4],<br />
                            [&#8216;Land Cruiser&#8217;, 5]<br />
                        ]<br />
                    }]<br />
                },</p>
<p>                legend: {<br />
                    enabled: false<br />
                },</p>
<p>                plotOptions: {<br />
                    series: {<br />
                        dataLabels: {<br />
                            enabled: true<br />
                        },<br />
                        shadow: false<br />
                    },<br />
                    pie: {<br />
                        size: &#8216;80%&#8217;<br />
                    }<br />
                },</p>
<p>                series: [{<br />
                    name: &#8216;Overview&#8217;,<br />
                    colorByPoint: true,<br />
                    data: [{<br />
                        name: &#8216;Fruits&#8217;,<br />
                        y: 10,<br />
                        drilldown: &#8216;fruits&#8217;<br />
                    }, {<br />
                        name: &#8216;Cars&#8217;,<br />
                        y: 12,<br />
                        drilldown: &#8216;cars&#8217;<br />
                    }, {<br />
                        name: &#8216;Countries&#8217;,<br />
                        y: 8<br />
                    }]<br />
                }]<br />
            };</p>
<p>            // Drill Down Chart Implementation<br />
            options.chart.renderTo = &#8216;container&#8217;;<br />
            options.chart.type = &#8216;column&#8217;;<br />
            var chart1 = new Highcharts.Chart(options);<br />
        });<br />
        function generateDrillDownJSON(e, isDrillUp) {<br />
            try {<br />
                if (isDrillUp) {<br />
                    if (myJSON != null &amp;&amp; myJSON.length &gt; 0) {<br />
                        removeArrayElementByIndex(myJSON, myJSON.length &#8211; 1);<br />
                    }<br />
                    sessionStorage.setItem(&#8216;DrillDownJSON&#8217;, JSON.stringify(myJSON));<br />
					$(&quot;#jsonContent&quot;).html(&#8216;JSON content is: &#8216;).append(JSON.stringify(myJSON));<br />
                } else {<br />
                    myJSON.push({<br />
                        name: e.point.name,<br />
                        level: myJSON.length + 1,<br />
                    });<br />
                    sessionStorage.setItem(&#8216;DrillDownJSON&#8217;, JSON.stringify(myJSON));<br />
					$(&quot;#jsonContent&quot;).html(&#8216;JSON content is: &#8216;).append(JSON.stringify(myJSON));<br />
                }</p>
<p>            } catch (e) {<br />
                console.log(&#8216;generateHierarchyJSON :&#8217; + e.message);<br />
            }<br />
        }<br />
        function removeArrayElementByIndex(myArray, index) {<br />
            myArray.splice(index, 1);<br />
        }<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Generate JSON According To Drill Down Drill Up Events &#8211; Sibeesh Passion (&lt;a href=&quot;http://sibeeshpassion.com&quot;&gt;Sibeesh Passion &lt;/a&gt;)<br />
    &lt;br/&gt;<br />
	&lt;br/&gt;<br />
	&lt;br/&gt;<br />
    &lt;div id=&quot;container&quot; style=&quot;height: 300px&quot;&gt;&lt;/div&gt;<br />
	&lt;div id=&quot;jsonContent&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>I hope you liked my article. Please share me your valuable feedback and suggestions. Thanks in advance.</p>
<p>Kindest Regards<br />
Sibeesh Venu<br />
<a href="http://sibeeshpassion.com/" target="_blank">http://sibeeshpassion.com/</a> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/generate-json-according-to-drill-down-drill-up-events/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Drill Down And Drill Up Events In Drill Down Highchart</title>
		<link>https://mail.sibeeshpassion.com/drill-down-and-drill-up-events-in-drill-down-highchart/</link>
					<comments>https://mail.sibeeshpassion.com/drill-down-and-drill-up-events-in-drill-down-highchart/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 24 Jul 2015 12:05:21 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[HighChart]]></category>
		<category><![CDATA[Drill Down Event]]></category>
		<category><![CDATA[Drill Up Event]]></category>
		<category><![CDATA[HighChart Events]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=7901</guid>

					<description><![CDATA[In this post, we will see how we can fire drill down and drill up events in drill down highchart. I hope you will like it. Using The Code [js] chart: { type: &#8216;column&#8217;, events: { drillup: function (e) { alert(&#8216;drill Up&#8217;); }, drilldown: function (e) { alert(&#8216;drill down&#8217;); } } } [/js] Here chart is my chart property. Please see other code snippets here: Code-Snippets Kindest Regards Sibeesh Venu]]></description>
										<content:encoded><![CDATA[<p>In this post, we will see how we can fire drill down and drill up events in drill down highchart. I hope you will like it.</p>
<p><strong>Using The Code</strong></p>
<p>[js]<br />
    chart: {<br />
            type: &#8216;column&#8217;,<br />
            events: {<br />
                drillup: function (e) {<br />
                    alert(&#8216;drill Up&#8217;);<br />
                },<br />
                drilldown: function (e) {<br />
                    alert(&#8216;drill down&#8217;);<br />
                }<br />
            }<br />
        }</p>
<p>[/js]</p>
<p>Here <em>chart</em> is my chart property.</p>
<p>Please see other code snippets here: <a href="http://sibeeshpassion.com/category/code-snippets/" target="_blank">Code-Snippets</a></p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/drill-down-and-drill-up-events-in-drill-down-highchart/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Save the Zoom View of Our Map</title>
		<link>https://mail.sibeeshpassion.com/how-to-save-the-zoom-view-of-our-map/</link>
					<comments>https://mail.sibeeshpassion.com/how-to-save-the-zoom-view-of-our-map/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 29 Apr 2015 20:47:44 +0000</pubDate>
				<category><![CDATA[High Map]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[HighChart]]></category>
		<category><![CDATA[HighMap]]></category>
		<category><![CDATA[How To Save the Zoom View of Our Map]]></category>
		<category><![CDATA[Map]]></category>
		<category><![CDATA[Save Zoom View]]></category>
		<category><![CDATA[Zoomed View]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=2081</guid>

					<description><![CDATA[Today we will learn how to save the zoom level of our map in our application. By this you can retain the zoomed view that the user sets so that it would be easier for users to identify things in our application. Background A few weeks ago I got the requirement to save the zoom level of the map. If you are new to the Bubble Map, please see here: Working with Bubble Map Download Source Code Save Zoomed View Of Map Using the code I hope you have configured a Bubble Map in your application now. Now it is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Today we will learn how to save the zoom level of our map in our application. By this you can retain the zoomed view that the user sets so that it would be easier for users to identify things in our application.</p>
<p><strong>Background</strong></p>
<p>A few weeks ago I got the requirement to save the zoom level of the map. If you are new to the Bubble Map, please see here: <a href="http://sibeeshpassion.com/working-with-bubble-map/" target="_blank">Working with Bubble Map</a></p>
<p><strong>Download Source Code </strong></p>
<li><a href="http://sibeeshpassion.com/download/mycharts.rar" target="_blank">Save Zoomed View Of Map</a></li>
<p><strong>Using the code</strong></p>
<p>I hope you have configured a Bubble Map in your application now. Now it is time to complete our new requirement. Now what we will do is to introduce a new function that retains the zoom level from the session storage and applies it to the map. You must call this function at the end of the map configuration. </p>
<p>The following is the function code.<br />
[js]<br />
var curMax = &#8221;<br />
        var curMin = &#8221;<br />
        var curMaxY = &#8221;;<br />
        var curMinY = &#8221;;<br />
        function updateZoom(chart) {<br />
            if (sessionStorage.getItem(&quot;curMaxZoomMap&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;curMaxZoomMap&quot;) != &#8216;undefined&#8217; &amp;&amp; sessionStorage.getItem(&quot;curMinZoomMap&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;curMinZoomMap&quot;) != &#8216;undefined&#8217;) {<br />
                chart.xAxis[0].setExtremes(parseInt(sessionStorage.getItem(&quot;curMinZoomMap&quot;)), parseInt(sessionStorage.getItem(&quot;curMaxZoomMap&quot;)));<br />
            }<br />
            if (sessionStorage.getItem(&quot;curMaxZoomMapY&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;curMaxZoomMapY&quot;) != &#8216;undefined&#8217; &amp;&amp; sessionStorage.getItem(&quot;curMinZoomMapY&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;curMinZoomMapY&quot;) != &#8216;undefined&#8217;) {<br />
                chart.yAxis[0].setExtremes(parseInt(sessionStorage.getItem(&quot;curMinZoomMapY&quot;)), parseInt(sessionStorage.getItem(&quot;curMaxZoomMapY&quot;)));<br />
            }<br />
        }<br />
[/js]</p>
<p>Now we have seen how to apply the zoom level to the map. Next is how to set the value to the session storage. The fact is that whenever the user does zooming in the map, it fires events in xAxis and yAxis. So we need to crate that events in both axis.</p>
<p>Let&#8217;s look at that code now.</p>
<p>[js]<br />
xAxis: {<br />
         events: {<br />
            afterSetExtremes: function (e) {<br />
                 curMax = e.max;<br />
                 curMin = e.min;<br />
                 sessionStorage.setItem(&quot;curMaxZoomMap&quot;, curMax);<br />
                 sessionStorage.setItem(&quot;curMinZoomMap&quot;, curMin);<br />
             }<br />
         }<br />
},<br />
yAxis: {<br />
          events: {<br />
              afterSetExtremes: function (e) {<br />
                      curMaxY = e.max;<br />
                      curMinY = e.min;<br />
                      sessionStorage.setItem(&quot;curMaxZoomMapY&quot;, curMaxY);<br />
                      sessionStorage.setItem(&quot;curMinZoomMapY&quot;, curMinY);<br />
               }<br />
           }<br />
}<br />
[/js]</p>
<p>Once you have included this event you can see the values in session storage in your browser whenever the user zooms the map.</p>
<div id="attachment_9131" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/04/Save-Zoomed-View-Of-Bubble-Map.png"><img decoding="async" aria-describedby="caption-attachment-9131" src="http://sibeeshpassion.com/wp-content/uploads/2015/04/Save-Zoomed-View-Of-Bubble-Map-1024x584.png" alt="Save Zoomed View Of Bubble Map" width="634" height="362" class="size-large wp-image-9131" srcset="/wp-content/uploads/2015/04/Save-Zoomed-View-Of-Bubble-Map.png 1024w, /wp-content/uploads/2015/04/Save-Zoomed-View-Of-Bubble-Map-300x171.png 300w, /wp-content/uploads/2015/04/Save-Zoomed-View-Of-Bubble-Map-768x438.png 768w, /wp-content/uploads/2015/04/Save-Zoomed-View-Of-Bubble-Map-400x228.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-9131" class="wp-caption-text">Save Zoomed View Of Bubble Map</p></div>
<p>Our next step is to include the zoomTo even in the series of our map.<br />
[js]<br />
events: {<br />
            click: function (e) {<br />
               e.point.zoomTo();<br />
            }<br />
        }<br />
[/js]</p>
<p>So your series configuration will be as follows.<br />
[js]<br />
series: [{<br />
             mapData: map,<br />
             borderColor: &#8216;#E0E0E0&#8217;,<br />
             colour: &#8216;#E0E0E0&#8217;,<br />
             showInLegend: false,<br />
             enableMouseTracking: true,<br />
             cursor: &#8216;pointer&#8217;,<br />
             dataLabels: {<br />
                enabled: true,<br />
                format: &#8216;{point.properties.postal-code}&#8217;,<br />
                textDecoration: &#8216;none&#8217;,<br />
                style: { &quot;color&quot;: &quot;darkgrey&quot;, &quot;fontWeight&quot;: &quot;bold&quot;, &quot;HcTextStroke&quot;: &quot;0px rgba(0,0,0,0.5)&quot; }<br />
         },<br />
         events: {<br />
            click: function (e) {<br />
               e.point.zoomTo();<br />
            }<br />
        },<br />
}<br />
[/js]</p>
<p>That is all guys, you can retain the zoom level of your map even if you reload. Cool!</p>
<p><strong>Complete Code</strong><br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Bubble Map Demo &#8211; sibeeshpassion&lt;/title&gt;<br />
    &lt;script src=&quot;Scripts/jquery-1.11.1.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/highmaps.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/proj4.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/us-all.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/world.js&quot;&gt;&lt;/script&gt;  </p>
<p>    &lt;script&gt;<br />
        var curMax = &#8221;<br />
        var curMin = &#8221;<br />
        var curMaxY = &#8221;;<br />
        var curMinY = &#8221;;<br />
        function updateZoom(chart) {<br />
            if (sessionStorage.getItem(&quot;curMaxZoomMap&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;curMaxZoomMap&quot;) != &#8216;undefined&#8217; &amp;&amp; sessionStorage.getItem(&quot;curMinZoomMap&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;curMinZoomMap&quot;) != &#8216;undefined&#8217;) {<br />
                chart.xAxis[0].setExtremes(parseInt(sessionStorage.getItem(&quot;curMinZoomMap&quot;)), parseInt(sessionStorage.getItem(&quot;curMaxZoomMap&quot;)));<br />
            }<br />
            if (sessionStorage.getItem(&quot;curMaxZoomMapY&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;curMaxZoomMapY&quot;) != &#8216;undefined&#8217; &amp;&amp; sessionStorage.getItem(&quot;curMinZoomMapY&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;curMinZoomMapY&quot;) != &#8216;undefined&#8217;) {<br />
                chart.yAxis[0].setExtremes(parseInt(sessionStorage.getItem(&quot;curMinZoomMapY&quot;)), parseInt(sessionStorage.getItem(&quot;curMaxZoomMapY&quot;)));<br />
            }<br />
        }<br />
        $(function () {<br />
            loadMap();<br />
            $(&#8216;#apply&#8217;).click(function () {<br />
                loadMap();<br />
            });<br />
        });<br />
        function loadMap() {<br />
            var selectMap = $.trim($(&quot;#mapSelectMap&quot;).val());<br />
            var zPoint = &quot;Quantity&quot;;<br />
            var jsdata = [{ &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;32.8796&quot;, &quot;lon&quot;: &quot;-111.7282&quot;, &quot;Quantity&quot;: &quot;29,248&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.3197&quot;, &quot;lon&quot;: &quot;-111.9837&quot;, &quot;Quantity&quot;: &quot;102,928&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.3939&quot;, &quot;lon&quot;: &quot;-111.6965&quot;, &quot;Quantity&quot;: &quot;108,863&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.4495&quot;, &quot;lon&quot;: &quot;-112.3410&quot;, &quot;Quantity&quot;: &quot;67,218&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.6155&quot;, &quot;lon&quot;: &quot;-111.9263&quot;, &quot;Quantity&quot;: &quot;66,556&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.6384&quot;, &quot;lon&quot;: &quot;-112.2073&quot;, &quot;Quantity&quot;: &quot;147,552&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.6145&quot;, &quot;lon&quot;: &quot;-117.7101&quot;, &quot;Quantity&quot;: &quot;26,053&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.7008&quot;, &quot;lon&quot;: &quot;-117.9362&quot;, &quot;Quantity&quot;: &quot;26,057&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.7963&quot;, &quot;lon&quot;: &quot;-116.3845&quot;, &quot;Quantity&quot;: &quot;497,249&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8274&quot;, &quot;lon&quot;: &quot;-118.0868&quot;, &quot;Quantity&quot;: &quot;32,052&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8763&quot;, &quot;lon&quot;: &quot;-117.7418&quot;, &quot;Quantity&quot;: &quot;23,521&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8996&quot;, &quot;lon&quot;: &quot;-118.3669&quot;, &quot;Quantity&quot;: &quot;26,169&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0302&quot;, &quot;lon&quot;: &quot;-118.3865&quot;, &quot;Quantity&quot;: &quot;21,996&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0569&quot;, &quot;lon&quot;: &quot;-117.2995&quot;, &quot;Quantity&quot;: &quot;59,135&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0737&quot;, &quot;lon&quot;: &quot;-117.8859&quot;, &quot;Quantity&quot;: &quot;4,757&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.1820&quot;, &quot;lon&quot;: &quot;-118.3140&quot;, &quot;Quantity&quot;: &quot;28,909&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.2257&quot;, &quot;lon&quot;: &quot;-119.1551&quot;, &quot;Quantity&quot;: &quot;22,569&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.2300&quot;, &quot;lon&quot;: &quot;-118.5500&quot;, &quot;Quantity&quot;: &quot;22,413&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.4130&quot;, &quot;lon&quot;: &quot;-118.5036&quot;, &quot;Quantity&quot;: &quot;18,399&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.4813&quot;, &quot;lon&quot;: &quot;-117.3389&quot;, &quot;Quantity&quot;: &quot;23,268&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.6029&quot;, &quot;lon&quot;: &quot;-118.1464&quot;, &quot;Quantity&quot;: &quot;24,651&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;37.5038&quot;, &quot;lon&quot;: &quot;-121.9762&quot;, &quot;Quantity&quot;: &quot;4&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;38.3525&quot;, &quot;lon&quot;: &quot;-122.7148&quot;, &quot;Quantity&quot;: &quot;2&quot; }, { &quot;State&quot;: &quot;Colorado&quot;, &quot;lat&quot;: &quot;38.4766&quot;, &quot;lon&quot;: &quot;-107.8812&quot;, &quot;Quantity&quot;: &quot;3,294&quot; }, { &quot;State&quot;: &quot;Colorado&quot;, &quot;lat&quot;: &quot;39.0730&quot;, &quot;lon&quot;: &quot;-108.5710&quot;, &quot;Quantity&quot;: &quot;8,704&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.8400&quot;, &quot;lon&quot;: &quot;-82.6800&quot;, &quot;Quantity&quot;: &quot;75,066&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9400&quot;, &quot;lon&quot;: &quot;-82.3200&quot;, &quot;Quantity&quot;: &quot;135,365&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9600&quot;, &quot;lon&quot;: &quot;-82.3200&quot;, &quot;Quantity&quot;: &quot;-6&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9925&quot;, &quot;lon&quot;: &quot;-82.7296&quot;, &quot;Quantity&quot;: &quot;27,274&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0661&quot;, &quot;lon&quot;: &quot;-82.5688&quot;, &quot;Quantity&quot;: &quot;261&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0790&quot;, &quot;lon&quot;: &quot;-80.6984&quot;, &quot;Quantity&quot;: &quot;15,720&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0941&quot;, &quot;lon&quot;: &quot;-81.9738&quot;, &quot;Quantity&quot;: &quot;85,437&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.1918&quot;, &quot;lon&quot;: &quot;-82.3812&quot;, &quot;Quantity&quot;: &quot;97,233&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.3027&quot;, &quot;lon&quot;: &quot;-81.4216&quot;, &quot;Quantity&quot;: &quot;135,193&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.5622&quot;, &quot;lon&quot;: &quot;-81.2074&quot;, &quot;Quantity&quot;: &quot;120,424&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.6629&quot;, &quot;lon&quot;: &quot;-81.4176&quot;, &quot;Quantity&quot;: &quot;110,185&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;29.1800&quot;, &quot;lon&quot;: &quot;-81.0800&quot;, &quot;Quantity&quot;: &quot;66,725&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;32.8100&quot;, &quot;lon&quot;: &quot;-83.7100&quot;, &quot;Quantity&quot;: &quot;3&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.3671&quot;, &quot;lon&quot;: &quot;-84.7647&quot;, &quot;Quantity&quot;: &quot;87,508&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.4600&quot;, &quot;lon&quot;: &quot;-84.2100&quot;, &quot;Quantity&quot;: &quot;155,811&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.4759&quot;, &quot;lon&quot;: &quot;-82.0709&quot;, &quot;Quantity&quot;: &quot;10,875&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.5600&quot;, &quot;lon&quot;: &quot;-84.5400&quot;, &quot;Quantity&quot;: &quot;17,937&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.5610&quot;, &quot;lon&quot;: &quot;-84.3223&quot;, &quot;Quantity&quot;: &quot;203,297&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.6810&quot;, &quot;lon&quot;: &quot;-84.1604&quot;, &quot;Quantity&quot;: &quot;134,700&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.8200&quot;, &quot;lon&quot;: &quot;-84.3600&quot;, &quot;Quantity&quot;: &quot;122,120&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.9168&quot;, &quot;lon&quot;: &quot;-83.4439&quot;, &quot;Quantity&quot;: &quot;84,648&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.9522&quot;, &quot;lon&quot;: &quot;-84.1343&quot;, &quot;Quantity&quot;: &quot;105,862&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0051&quot;, &quot;lon&quot;: &quot;-84.5752&quot;, &quot;Quantity&quot;: &quot;-14&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0076&quot;, &quot;lon&quot;: &quot;-84.5769&quot;, &quot;Quantity&quot;: &quot;204,888&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0600&quot;, &quot;lon&quot;: &quot;-83.9800&quot;, &quot;Quantity&quot;: &quot;104,291&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.1900&quot;, &quot;lon&quot;: &quot;-84.1200&quot;, &quot;Quantity&quot;: &quot;186,459&quot; }, { &quot;State&quot;: &quot;Idaho&quot;, &quot;lat&quot;: &quot;42.9101&quot;, &quot;lon&quot;: &quot;-112.4605&quot;, &quot;Quantity&quot;: &quot;5,524&quot; }, { &quot;State&quot;: &quot;Idaho&quot;, &quot;lat&quot;: &quot;43.6048&quot;, &quot;lon&quot;: &quot;-116.3496&quot;, &quot;Quantity&quot;: &quot;14,476&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;41.5300&quot;, &quot;lon&quot;: &quot;-87.8500&quot;, &quot;Quantity&quot;: &quot;54,989&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;41.7200&quot;, &quot;lon&quot;: &quot;-88.0300&quot;, &quot;Quantity&quot;: &quot;72,366&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.0500&quot;, &quot;lon&quot;: &quot;-87.8300&quot;, &quot;Quantity&quot;: &quot;59,164&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.1000&quot;, &quot;lon&quot;: &quot;-87.9700&quot;, &quot;Quantity&quot;: &quot;49,074&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.1300&quot;, &quot;lon&quot;: &quot;-88.3300&quot;, &quot;Quantity&quot;: &quot;77,454&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.2300&quot;, &quot;lon&quot;: &quot;-87.9300&quot;, &quot;Quantity&quot;: &quot;51,251&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.2600&quot;, &quot;lon&quot;: &quot;-88.9700&quot;, &quot;Quantity&quot;: &quot;57,571&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.6292&quot;, &quot;lon&quot;: &quot;-86.1252&quot;, &quot;Quantity&quot;: &quot;24,227&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.6303&quot;, &quot;lon&quot;: &quot;-86.1249&quot;, &quot;Quantity&quot;: &quot;1,074&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.7613&quot;, &quot;lon&quot;: &quot;-86.3488&quot;, &quot;Quantity&quot;: &quot;12,319&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.7634&quot;, &quot;lon&quot;: &quot;-86.3489&quot;, &quot;Quantity&quot;: &quot;1,027&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;40.0028&quot;, &quot;lon&quot;: &quot;-86.1227&quot;, &quot;Quantity&quot;: &quot;901&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;41.4900&quot;, &quot;lon&quot;: &quot;-87.4700&quot;, &quot;Quantity&quot;: &quot;83,677&quot; }, { &quot;State&quot;: &quot;Kentucky&quot;, &quot;lat&quot;: &quot;38.1438&quot;, &quot;lon&quot;: &quot;-85.6751&quot;, &quot;Quantity&quot;: &quot;-85&quot; }];<br />
            var data1 = [];<br />
            var tmp = &#8221;;<br />
            var formatedVal = 0;<br />
            if (selectMap == &quot;0&quot;) {<br />
                var H = Highcharts,<br />
                             map = H.maps[&#8216;countries/us/us-all&#8217;],<br />
                                chart;<br />
            }<br />
            else {<br />
                var H = Highcharts,<br />
                                  map = H.maps[selectMap],<br />
                                     chart;<br />
            }<br />
            $.each(jsdata, function (ix, entry) {<br />
                if (Object.keys(entry).length &gt;= 4) {<br />
                    tmp = entry[zPoint].replace(/\,/g, &#8221;).replace(/\$/g, &#8221;).replace(/\%/g, &#8221;).replace(/\(/g, &#8221;).replace(/\)/g, &#8221;);<br />
                    if (isNaN(tmp)) {<br />
                        entry.z = entry[zPoint];<br />
                    }<br />
                    else {  </p>
<p>                    }<br />
                    data1.push(entry);<br />
                }<br />
            });<br />
            chart = $(&#8216;#container&#8217;).highcharts(&#8216;Map&#8217;, {<br />
                chart: {<br />
                    borderWidth: 1<br />
                },<br />
                title: {<br />
                    text: &#8216;Bubble map&#8217;<br />
                },<br />
                subtitle: {<br />
                    text: &#8216;Bubble map sub title&#8217;<br />
                },  </p>
<p>                tooltip: {<br />
                    pointFormat: &#8216;{point.State}: {point.Quantity}&#8217;<br />
                },  </p>
<p>                mapNavigation: {<br />
                    enabled: true,<br />
                    buttonOptions: {<br />
                        verticalAlign: &#8216;bottom&#8217;<br />
                    }<br />
                },<br />
                xAxis: {<br />
                    events: {<br />
                        afterSetExtremes: function (e) {<br />
                            curMax = e.max;<br />
                            curMin = e.min;<br />
                            sessionStorage.setItem(&quot;curMaxZoomMap&quot;, curMax);<br />
                            sessionStorage.setItem(&quot;curMinZoomMap&quot;, curMin);<br />
                        }<br />
                    }<br />
                },<br />
                yAxis: {<br />
                    events: {<br />
                        afterSetExtremes: function (e) {<br />
                            curMaxY = e.max;<br />
                            curMinY = e.min;<br />
                            sessionStorage.setItem(&quot;curMaxZoomMapY&quot;, curMaxY);<br />
                            sessionStorage.setItem(&quot;curMinZoomMapY&quot;, curMinY);<br />
                        }<br />
                    }<br />
                },<br />
                legend: {<br />
                    enabled: true,<br />
                    title: {<br />
                        style: {<br />
                            color: (Highcharts.theme &amp;&amp; Highcharts.theme.textColor) || &#8216;black&#8217;<br />
                        }<br />
                    },<br />
                    layout: &#8216;vertical&#8217;,<br />
                    align: &#8216;right&#8217;,<br />
                    verticalAlign: &#8216;bottom&#8217;,<br />
                    floating: true,<br />
                    valueDecimals: 0,<br />
                    valueSuffix: &#8216;$&#8217;,<br />
                    backgroundColor: (Highcharts.theme &amp;&amp; Highcharts.theme.legendBackgroundColor) || &#8216;rgba(255, 255, 255, 0.85)&#8217;,<br />
                    symbolRadius: 0,<br />
                    symbolHeight: 14<br />
                },<br />
                series: [{<br />
                    mapData: map,<br />
                    borderColor: &#8216;#E0E0E0&#8217;,<br />
                    colour: &#8216;#E0E0E0&#8217;,<br />
                    showInLegend: false,<br />
                    enableMouseTracking: true,<br />
                    cursor: &#8216;pointer&#8217;,<br />
                    dataLabels: {<br />
                        enabled: true,<br />
                        format: &#8216;{point.properties.postal-code}&#8217;,<br />
                        textDecoration: &#8216;none&#8217;,<br />
                        style: { &quot;color&quot;: &quot;darkgrey&quot;, &quot;fontWeight&quot;: &quot;bold&quot;, &quot;HcTextStroke&quot;: &quot;0px rgba(0,0,0,0.5)&quot; }<br />
                    },<br />
                    events: {<br />
                        click: function (e) {<br />
                            e.point.zoomTo();<br />
                        }<br />
                    },<br />
                },<br />
                {<br />
                    type: &#8216;mapbubble&#8217;,<br />
                    color: &#8216;#E0E0E0&#8217;,<br />
                    dataLabels: {<br />
                        enabled: true,<br />
                        formatter: function () {<br />
                        }<br />
                    },<br />
                    enableMouseTracking: true,<br />
                    joinBy: [&#8216;iso-a2&#8217;, &#8216;code&#8217;],<br />
                    name: zPoint,<br />
                    data: data1,<br />
                    minSize: $(&quot;#mapMinBubSize&quot;).val(),<br />
                    maxSize: $(&quot;#mapMaxBubSize&quot;).val(),<br />
                    color: $(&quot;#mapColor&quot;).val(),<br />
                    displayNegative: true,<br />
                    sizeBy: &#8216;width&#8217;,<br />
                    cursor: &#8216;pointer&#8217;,<br />
                    negativeColor: Highcharts.getOptions().colors[0]<br />
                }<br />
                ],<br />
                chart: {<br />
                    marginRight: 50<br />
                },<br />
                exporting: {<br />
                    enabled: false<br />
                }<br />
            }, function (chart) {<br />
                updateZoom(chart);<br />
            });<br />
        }  </p>
<p>    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Bubble Map Demo &#8211; sibeeshpassion<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;container&quot; style=&quot;min-width: 310px; height: 400px; margin: 0 auto&quot;&gt;&lt;/div&gt;<br />
    &lt;label&gt;Min Bubble Size&lt;/label&gt;<br />
    &lt;input type=&quot;number&quot; value=&quot;8&quot; min=&quot;1&quot; id=&quot;mapMinBubSize&quot; title=&quot;Type Bubble Min Size.&quot; /&gt;<br />
    &lt;label&gt;Max Bubble Size&lt;/label&gt;<br />
    &lt;input type=&quot;number&quot; min=&quot;1&quot; value=&quot;40&quot; id=&quot;mapMaxBubSize&quot; title=&quot;Type Bubble Max Size.&quot; /&gt;<br />
    &lt;label&gt;Color&lt;/label&gt;<br />
    &lt;input type=&quot;color&quot; value=&quot;#BAD6F2&quot; id=&quot;mapColor&quot; title=&quot;Select Bubble Color.&quot; /&gt;<br />
    &lt;label&gt;Select Map&lt;/label&gt;<br />
    &lt;select name=&quot;tech&quot; id=&quot;mapSelectMap&quot; class=&quot;tech&quot; title=&quot;Select Map.&quot;&gt;<br />
        &lt;option value=&quot;0&quot;&gt;Select Map&lt;/option&gt;<br />
        &lt;option value=&quot;countries/us/us-all&quot; selected=&quot;selected&quot;&gt;US alone&lt;/option&gt;<br />
        &lt;option value=&quot;custom/world&quot;&gt;Custom World&lt;/option&gt;<br />
    &lt;/select&gt;<br />
    &lt;div id=&quot;apply&quot; style=&quot;cursor: pointer; background-color: red; color: white; width: 100px; padding: 5px; float: right;&quot;&gt;Apply Settings&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Please download the source code for more details. I hope you liked this article. Now please share your thoughts and suggestions. It matters a lot.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/how-to-save-the-zoom-view-of-our-map/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Working With Bubble Map</title>
		<link>https://mail.sibeeshpassion.com/working-with-bubble-map/</link>
					<comments>https://mail.sibeeshpassion.com/working-with-bubble-map/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 29 Apr 2015 20:45:47 +0000</pubDate>
				<category><![CDATA[High Map]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Bubble Map]]></category>
		<category><![CDATA[Create Map]]></category>
		<category><![CDATA[HighChart]]></category>
		<category><![CDATA[HighMap]]></category>
		<category><![CDATA[Map]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=2041</guid>

					<description><![CDATA[In this post we will explain how to create a Bubble Map in our application.A Bubble Map is a tool for plotting the count or measure by country or any geo-locations in the map as a bubble. As the measure value increases, the bubble size will be increased, so we can get a live impression on what the data is. The only thing we need is, just the lat and long of those positions. Background A few days ago I got a requirement to implement a Bubble Map in my application. So I thought of sharing that with you all. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will explain how to create a Bubble Map in our application.A Bubble Map is a tool for plotting the count or measure by country or any geo-locations in the map as a bubble. As the measure value increases, the bubble size will be increased, so we can get a live impression on what the data is. The only thing we need is, just the lat and long of those positions.</p>
<p><strong>Background</strong></p>
<p>A few days ago I got a requirement to implement a Bubble Map in my application. So I thought of sharing that with you all. Here we will see how to implement it in an easy way.</p>
<p>So Let Us Start. What you need first is to include the necessary JavaScript files. The required files are listed below.<br />
[js]<br />
&lt;script src=&quot;Scripts/jquery-1.11.1.min.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;Scripts/highmaps.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;Scripts/proj4.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;Scripts/us-all.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;Scripts/world.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Once you are downloaded the files and provide the references, you are ready to go further. Now it is time to get our data that we need to populate in the Bubble Map. In this example I am using the following data.<br />
[js]<br />
var jsdata = [{ &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;32.8796&quot;, &quot;lon&quot;: &quot;-111.7282&quot;, &quot;Quantity&quot;: &quot;29,248&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.3197&quot;, &quot;lon&quot;: &quot;-111.9837&quot;, &quot;Quantity&quot;: &quot;102,928&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.3939&quot;, &quot;lon&quot;: &quot;-111.6965&quot;, &quot;Quantity&quot;: &quot;108,863&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.4495&quot;, &quot;lon&quot;: &quot;-112.3410&quot;, &quot;Quantity&quot;: &quot;67,218&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.6155&quot;, &quot;lon&quot;: &quot;-111.9263&quot;, &quot;Quantity&quot;: &quot;66,556&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.6384&quot;, &quot;lon&quot;: &quot;-112.2073&quot;, &quot;Quantity&quot;: &quot;147,552&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.6145&quot;, &quot;lon&quot;: &quot;-117.7101&quot;, &quot;Quantity&quot;: &quot;26,053&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.7008&quot;, &quot;lon&quot;: &quot;-117.9362&quot;, &quot;Quantity&quot;: &quot;26,057&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.7963&quot;, &quot;lon&quot;: &quot;-116.3845&quot;, &quot;Quantity&quot;: &quot;497,249&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8274&quot;, &quot;lon&quot;: &quot;-118.0868&quot;, &quot;Quantity&quot;: &quot;32,052&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8763&quot;, &quot;lon&quot;: &quot;-117.7418&quot;, &quot;Quantity&quot;: &quot;23,521&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8996&quot;, &quot;lon&quot;: &quot;-118.3669&quot;, &quot;Quantity&quot;: &quot;26,169&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0302&quot;, &quot;lon&quot;: &quot;-118.3865&quot;, &quot;Quantity&quot;: &quot;21,996&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0569&quot;, &quot;lon&quot;: &quot;-117.2995&quot;, &quot;Quantity&quot;: &quot;59,135&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0737&quot;, &quot;lon&quot;: &quot;-117.8859&quot;, &quot;Quantity&quot;: &quot;4,757&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.1820&quot;, &quot;lon&quot;: &quot;-118.3140&quot;, &quot;Quantity&quot;: &quot;28,909&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.2257&quot;, &quot;lon&quot;: &quot;-119.1551&quot;, &quot;Quantity&quot;: &quot;22,569&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.2300&quot;, &quot;lon&quot;: &quot;-118.5500&quot;, &quot;Quantity&quot;: &quot;22,413&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.4130&quot;, &quot;lon&quot;: &quot;-118.5036&quot;, &quot;Quantity&quot;: &quot;18,399&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.4813&quot;, &quot;lon&quot;: &quot;-117.3389&quot;, &quot;Quantity&quot;: &quot;23,268&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.6029&quot;, &quot;lon&quot;: &quot;-118.1464&quot;, &quot;Quantity&quot;: &quot;24,651&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;37.5038&quot;, &quot;lon&quot;: &quot;-121.9762&quot;, &quot;Quantity&quot;: &quot;4&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;38.3525&quot;, &quot;lon&quot;: &quot;-122.7148&quot;, &quot;Quantity&quot;: &quot;2&quot; }, { &quot;State&quot;: &quot;Colorado&quot;, &quot;lat&quot;: &quot;38.4766&quot;, &quot;lon&quot;: &quot;-107.8812&quot;, &quot;Quantity&quot;: &quot;3,294&quot; }, { &quot;State&quot;: &quot;Colorado&quot;, &quot;lat&quot;: &quot;39.0730&quot;, &quot;lon&quot;: &quot;-108.5710&quot;, &quot;Quantity&quot;: &quot;8,704&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.8400&quot;, &quot;lon&quot;: &quot;-82.6800&quot;, &quot;Quantity&quot;: &quot;75,066&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9400&quot;, &quot;lon&quot;: &quot;-82.3200&quot;, &quot;Quantity&quot;: &quot;135,365&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9600&quot;, &quot;lon&quot;: &quot;-82.3200&quot;, &quot;Quantity&quot;: &quot;-6&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9925&quot;, &quot;lon&quot;: &quot;-82.7296&quot;, &quot;Quantity&quot;: &quot;27,274&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0661&quot;, &quot;lon&quot;: &quot;-82.5688&quot;, &quot;Quantity&quot;: &quot;261&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0790&quot;, &quot;lon&quot;: &quot;-80.6984&quot;, &quot;Quantity&quot;: &quot;15,720&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0941&quot;, &quot;lon&quot;: &quot;-81.9738&quot;, &quot;Quantity&quot;: &quot;85,437&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.1918&quot;, &quot;lon&quot;: &quot;-82.3812&quot;, &quot;Quantity&quot;: &quot;97,233&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.3027&quot;, &quot;lon&quot;: &quot;-81.4216&quot;, &quot;Quantity&quot;: &quot;135,193&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.5622&quot;, &quot;lon&quot;: &quot;-81.2074&quot;, &quot;Quantity&quot;: &quot;120,424&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.6629&quot;, &quot;lon&quot;: &quot;-81.4176&quot;, &quot;Quantity&quot;: &quot;110,185&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;29.1800&quot;, &quot;lon&quot;: &quot;-81.0800&quot;, &quot;Quantity&quot;: &quot;66,725&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;32.8100&quot;, &quot;lon&quot;: &quot;-83.7100&quot;, &quot;Quantity&quot;: &quot;3&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.3671&quot;, &quot;lon&quot;: &quot;-84.7647&quot;, &quot;Quantity&quot;: &quot;87,508&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.4600&quot;, &quot;lon&quot;: &quot;-84.2100&quot;, &quot;Quantity&quot;: &quot;155,811&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.4759&quot;, &quot;lon&quot;: &quot;-82.0709&quot;, &quot;Quantity&quot;: &quot;10,875&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.5600&quot;, &quot;lon&quot;: &quot;-84.5400&quot;, &quot;Quantity&quot;: &quot;17,937&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.5610&quot;, &quot;lon&quot;: &quot;-84.3223&quot;, &quot;Quantity&quot;: &quot;203,297&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.6810&quot;, &quot;lon&quot;: &quot;-84.1604&quot;, &quot;Quantity&quot;: &quot;134,700&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.8200&quot;, &quot;lon&quot;: &quot;-84.3600&quot;, &quot;Quantity&quot;: &quot;122,120&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.9168&quot;, &quot;lon&quot;: &quot;-83.4439&quot;, &quot;Quantity&quot;: &quot;84,648&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.9522&quot;, &quot;lon&quot;: &quot;-84.1343&quot;, &quot;Quantity&quot;: &quot;105,862&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0051&quot;, &quot;lon&quot;: &quot;-84.5752&quot;, &quot;Quantity&quot;: &quot;-14&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0076&quot;, &quot;lon&quot;: &quot;-84.5769&quot;, &quot;Quantity&quot;: &quot;204,888&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0600&quot;, &quot;lon&quot;: &quot;-83.9800&quot;, &quot;Quantity&quot;: &quot;104,291&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.1900&quot;, &quot;lon&quot;: &quot;-84.1200&quot;, &quot;Quantity&quot;: &quot;186,459&quot; }, { &quot;State&quot;: &quot;Idaho&quot;, &quot;lat&quot;: &quot;42.9101&quot;, &quot;lon&quot;: &quot;-112.4605&quot;, &quot;Quantity&quot;: &quot;5,524&quot; }, { &quot;State&quot;: &quot;Idaho&quot;, &quot;lat&quot;: &quot;43.6048&quot;, &quot;lon&quot;: &quot;-116.3496&quot;, &quot;Quantity&quot;: &quot;14,476&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;41.5300&quot;, &quot;lon&quot;: &quot;-87.8500&quot;, &quot;Quantity&quot;: &quot;54,989&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;41.7200&quot;, &quot;lon&quot;: &quot;-88.0300&quot;, &quot;Quantity&quot;: &quot;72,366&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.0500&quot;, &quot;lon&quot;: &quot;-87.8300&quot;, &quot;Quantity&quot;: &quot;59,164&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.1000&quot;, &quot;lon&quot;: &quot;-87.9700&quot;, &quot;Quantity&quot;: &quot;49,074&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.1300&quot;, &quot;lon&quot;: &quot;-88.3300&quot;, &quot;Quantity&quot;: &quot;77,454&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.2300&quot;, &quot;lon&quot;: &quot;-87.9300&quot;, &quot;Quantity&quot;: &quot;51,251&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.2600&quot;, &quot;lon&quot;: &quot;-88.9700&quot;, &quot;Quantity&quot;: &quot;57,571&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.6292&quot;, &quot;lon&quot;: &quot;-86.1252&quot;, &quot;Quantity&quot;: &quot;24,227&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.6303&quot;, &quot;lon&quot;: &quot;-86.1249&quot;, &quot;Quantity&quot;: &quot;1,074&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.7613&quot;, &quot;lon&quot;: &quot;-86.3488&quot;, &quot;Quantity&quot;: &quot;12,319&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.7634&quot;, &quot;lon&quot;: &quot;-86.3489&quot;, &quot;Quantity&quot;: &quot;1,027&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;40.0028&quot;, &quot;lon&quot;: &quot;-86.1227&quot;, &quot;Quantity&quot;: &quot;901&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;41.4900&quot;, &quot;lon&quot;: &quot;-87.4700&quot;, &quot;Quantity&quot;: &quot;83,677&quot; }, { &quot;State&quot;: &quot;Kentucky&quot;, &quot;lat&quot;: &quot;38.1438&quot;, &quot;lon&quot;: &quot;-85.6751&quot;, &quot;Quantity&quot;: &quot;-85&quot; }];<br />
[/js]</p>
<p>So our data is also ready now. Now  we can check whether the populated data is correct or not. According to the Bubble Map, if any of the data is incorect then the map itself won&#8217;t load correctly. So it is always better to provide a check. I encountered many issues when doing this (because I was creating my data dynamically in my application), so I do not want it to happen in your case. You can use the following code for the check process.<br />
[js]<br />
$.each(jsdata, function (ix, entry)<br />
{<br />
                if (Object.keys(entry).length &gt;= 4)<br />
                {<br />
                    tmp = entry[zPoint].replace(/\,/g, &#8221;).replace(/\$/g, &#8221;).replace(/\%/g, &#8221;).replace(/\(/g, &#8221;).replace(/\)/g, &#8221;);<br />
                    if (isNaN(tmp)) {<br />
                        entry.z = entry[zPoint];<br />
                    }<br />
                    else {    </p>
<p>                    }<br />
                    data1.push(entry);<br />
                }<br />
});<br />
[/js]</p>
<p>Here what I am doing is checking whether all the data has the necessary properties. In our case it is 4 (State, Quantity, lat and lon) .</p>
<p>Now we will load the map as follows.<br />
[js]<br />
chart = $(&#8216;#container&#8217;).highcharts(&#8216;Map&#8217;, {<br />
               chart: {<br />
                   borderWidth: 1<br />
               },<br />
               title: {<br />
                   text: &#8216;Bubble map&#8217;<br />
               },<br />
               subtitle: {<br />
                   text: &#8216;Bubble map sub title&#8217;<br />
               },  </p>
<p>               tooltip: {<br />
                   pointFormat: &#8216;{point.State}: {point.Quantity}&#8217;<br />
               },  </p>
<p>               mapNavigation: {<br />
                   enabled: true,<br />
                   buttonOptions: {<br />
                       verticalAlign: &#8216;bottom&#8217;<br />
                   }<br />
               },<br />
               xAxis: {<br />
               },<br />
               yAxis: {<br />
               },<br />
               legend: {<br />
                   enabled: true,<br />
                   title: {<br />
                       style: {<br />
                           color: (Highcharts.theme &amp;&amp; Highcharts.theme.textColor) || &#8216;black&#8217;<br />
                       }<br />
                   },<br />
                   layout: &#8216;vertical&#8217;,<br />
                   align: &#8216;right&#8217;,<br />
                   verticalAlign: &#8216;bottom&#8217;,<br />
                   floating: true,<br />
                   valueDecimals: 0,<br />
                   valueSuffix: &#8216;$&#8217;,<br />
                   backgroundColor: (Highcharts.theme &amp;&amp; Highcharts.theme.legendBackgroundColor) || &#8216;rgba(255, 255, 255, 0.85)&#8217;,<br />
                   symbolRadius: 0,<br />
                   symbolHeight: 14<br />
               },<br />
               series: [{<br />
                   mapData: map,<br />
                   borderColor: &#8216;#E0E0E0&#8217;,<br />
                   colour: &#8216;#E0E0E0&#8217;,<br />
                   showInLegend: false,<br />
                   enableMouseTracking: true,<br />
                   cursor: &#8216;pointer&#8217;,<br />
                   dataLabels: {<br />
                       enabled: true,<br />
                       format: &#8216;{point.properties.postal-code}&#8217;,<br />
                       textDecoration: &#8216;none&#8217;,<br />
                       style: { &quot;color&quot;: &quot;darkgrey&quot;, &quot;fontWeight&quot;: &quot;bold&quot;, &quot;HcTextStroke&quot;: &quot;0px rgba(0,0,0,0.5)&quot; }<br />
                   },<br />
                   events: {<br />
                       click: function (e) {<br />
                           e.point.zoomTo();<br />
                       }<br />
                   },<br />
               },<br />
               {<br />
                   type: &#8216;mapbubble&#8217;,<br />
                   color: &#8216;#E0E0E0&#8217;,<br />
                   dataLabels: {<br />
                       enabled: true,<br />
                       formatter: function () {<br />
                       }<br />
                   },<br />
                   enableMouseTracking: true,<br />
                   joinBy: [&#8216;iso-a2&#8217;, &#8216;code&#8217;],<br />
                   name: zPoint,<br />
                   data: data1,<br />
                   minSize: $(&quot;#mapMinBubSize&quot;).val(),<br />
                   maxSize: $(&quot;#mapMaxBubSize&quot;).val(),<br />
                   color: $(&quot;#mapColor&quot;).val(),<br />
                   displayNegative: true,<br />
                   sizeBy: &#8216;width&#8217;,<br />
                   cursor: &#8216;pointer&#8217;,<br />
                   negativeColor: Highcharts.getOptions().colors[0]<br />
               }<br />
               ],<br />
               chart: {<br />
                   marginRight: 50<br />
               },<br />
               exporting: {<br />
                   enabled: false<br />
               }<br />
           }<br />
[/js]</p>
<p>In the preceding codes you can see we are taking the values from some UI elements (for examle $(&#8220;#mapMinBubSize&#8221;).val()). Don&#8217;t worry, we will see the settings option later. One more important thing is you can find a  variable called zPoint in the preceding code, this is the value of our bubble. That is, according to the value of the zPoint the Map Bubble will increase or decrease.<br />
[js]<br />
var zPoint = &quot;Quantity&quot;;<br />
[/js]</p>
<p>In the next part , we will create a function for loading the map.<br />
[js]<br />
$(function () {<br />
           loadMap();<br />
       });<br />
[/js]</p>
<p>Now it is time to write our complete code in that function.<br />
[js]<br />
function loadMap() {<br />
          var selectMap = $.trim($(&quot;#mapSelectMap&quot;).val());<br />
          var zPoint = &quot;Quantity&quot;;<br />
          var jsdata = [{ &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;32.8796&quot;, &quot;lon&quot;: &quot;-111.7282&quot;, &quot;Quantity&quot;: &quot;29,248&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.3197&quot;, &quot;lon&quot;: &quot;-111.9837&quot;, &quot;Quantity&quot;: &quot;102,928&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.3939&quot;, &quot;lon&quot;: &quot;-111.6965&quot;, &quot;Quantity&quot;: &quot;108,863&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.4495&quot;, &quot;lon&quot;: &quot;-112.3410&quot;, &quot;Quantity&quot;: &quot;67,218&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.6155&quot;, &quot;lon&quot;: &quot;-111.9263&quot;, &quot;Quantity&quot;: &quot;66,556&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.6384&quot;, &quot;lon&quot;: &quot;-112.2073&quot;, &quot;Quantity&quot;: &quot;147,552&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.6145&quot;, &quot;lon&quot;: &quot;-117.7101&quot;, &quot;Quantity&quot;: &quot;26,053&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.7008&quot;, &quot;lon&quot;: &quot;-117.9362&quot;, &quot;Quantity&quot;: &quot;26,057&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.7963&quot;, &quot;lon&quot;: &quot;-116.3845&quot;, &quot;Quantity&quot;: &quot;497,249&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8274&quot;, &quot;lon&quot;: &quot;-118.0868&quot;, &quot;Quantity&quot;: &quot;32,052&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8763&quot;, &quot;lon&quot;: &quot;-117.7418&quot;, &quot;Quantity&quot;: &quot;23,521&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8996&quot;, &quot;lon&quot;: &quot;-118.3669&quot;, &quot;Quantity&quot;: &quot;26,169&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0302&quot;, &quot;lon&quot;: &quot;-118.3865&quot;, &quot;Quantity&quot;: &quot;21,996&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0569&quot;, &quot;lon&quot;: &quot;-117.2995&quot;, &quot;Quantity&quot;: &quot;59,135&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0737&quot;, &quot;lon&quot;: &quot;-117.8859&quot;, &quot;Quantity&quot;: &quot;4,757&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.1820&quot;, &quot;lon&quot;: &quot;-118.3140&quot;, &quot;Quantity&quot;: &quot;28,909&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.2257&quot;, &quot;lon&quot;: &quot;-119.1551&quot;, &quot;Quantity&quot;: &quot;22,569&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.2300&quot;, &quot;lon&quot;: &quot;-118.5500&quot;, &quot;Quantity&quot;: &quot;22,413&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.4130&quot;, &quot;lon&quot;: &quot;-118.5036&quot;, &quot;Quantity&quot;: &quot;18,399&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.4813&quot;, &quot;lon&quot;: &quot;-117.3389&quot;, &quot;Quantity&quot;: &quot;23,268&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.6029&quot;, &quot;lon&quot;: &quot;-118.1464&quot;, &quot;Quantity&quot;: &quot;24,651&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;37.5038&quot;, &quot;lon&quot;: &quot;-121.9762&quot;, &quot;Quantity&quot;: &quot;4&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;38.3525&quot;, &quot;lon&quot;: &quot;-122.7148&quot;, &quot;Quantity&quot;: &quot;2&quot; }, { &quot;State&quot;: &quot;Colorado&quot;, &quot;lat&quot;: &quot;38.4766&quot;, &quot;lon&quot;: &quot;-107.8812&quot;, &quot;Quantity&quot;: &quot;3,294&quot; }, { &quot;State&quot;: &quot;Colorado&quot;, &quot;lat&quot;: &quot;39.0730&quot;, &quot;lon&quot;: &quot;-108.5710&quot;, &quot;Quantity&quot;: &quot;8,704&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.8400&quot;, &quot;lon&quot;: &quot;-82.6800&quot;, &quot;Quantity&quot;: &quot;75,066&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9400&quot;, &quot;lon&quot;: &quot;-82.3200&quot;, &quot;Quantity&quot;: &quot;135,365&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9600&quot;, &quot;lon&quot;: &quot;-82.3200&quot;, &quot;Quantity&quot;: &quot;-6&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9925&quot;, &quot;lon&quot;: &quot;-82.7296&quot;, &quot;Quantity&quot;: &quot;27,274&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0661&quot;, &quot;lon&quot;: &quot;-82.5688&quot;, &quot;Quantity&quot;: &quot;261&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0790&quot;, &quot;lon&quot;: &quot;-80.6984&quot;, &quot;Quantity&quot;: &quot;15,720&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0941&quot;, &quot;lon&quot;: &quot;-81.9738&quot;, &quot;Quantity&quot;: &quot;85,437&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.1918&quot;, &quot;lon&quot;: &quot;-82.3812&quot;, &quot;Quantity&quot;: &quot;97,233&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.3027&quot;, &quot;lon&quot;: &quot;-81.4216&quot;, &quot;Quantity&quot;: &quot;135,193&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.5622&quot;, &quot;lon&quot;: &quot;-81.2074&quot;, &quot;Quantity&quot;: &quot;120,424&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.6629&quot;, &quot;lon&quot;: &quot;-81.4176&quot;, &quot;Quantity&quot;: &quot;110,185&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;29.1800&quot;, &quot;lon&quot;: &quot;-81.0800&quot;, &quot;Quantity&quot;: &quot;66,725&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;32.8100&quot;, &quot;lon&quot;: &quot;-83.7100&quot;, &quot;Quantity&quot;: &quot;3&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.3671&quot;, &quot;lon&quot;: &quot;-84.7647&quot;, &quot;Quantity&quot;: &quot;87,508&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.4600&quot;, &quot;lon&quot;: &quot;-84.2100&quot;, &quot;Quantity&quot;: &quot;155,811&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.4759&quot;, &quot;lon&quot;: &quot;-82.0709&quot;, &quot;Quantity&quot;: &quot;10,875&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.5600&quot;, &quot;lon&quot;: &quot;-84.5400&quot;, &quot;Quantity&quot;: &quot;17,937&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.5610&quot;, &quot;lon&quot;: &quot;-84.3223&quot;, &quot;Quantity&quot;: &quot;203,297&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.6810&quot;, &quot;lon&quot;: &quot;-84.1604&quot;, &quot;Quantity&quot;: &quot;134,700&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.8200&quot;, &quot;lon&quot;: &quot;-84.3600&quot;, &quot;Quantity&quot;: &quot;122,120&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.9168&quot;, &quot;lon&quot;: &quot;-83.4439&quot;, &quot;Quantity&quot;: &quot;84,648&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.9522&quot;, &quot;lon&quot;: &quot;-84.1343&quot;, &quot;Quantity&quot;: &quot;105,862&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0051&quot;, &quot;lon&quot;: &quot;-84.5752&quot;, &quot;Quantity&quot;: &quot;-14&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0076&quot;, &quot;lon&quot;: &quot;-84.5769&quot;, &quot;Quantity&quot;: &quot;204,888&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0600&quot;, &quot;lon&quot;: &quot;-83.9800&quot;, &quot;Quantity&quot;: &quot;104,291&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.1900&quot;, &quot;lon&quot;: &quot;-84.1200&quot;, &quot;Quantity&quot;: &quot;186,459&quot; }, { &quot;State&quot;: &quot;Idaho&quot;, &quot;lat&quot;: &quot;42.9101&quot;, &quot;lon&quot;: &quot;-112.4605&quot;, &quot;Quantity&quot;: &quot;5,524&quot; }, { &quot;State&quot;: &quot;Idaho&quot;, &quot;lat&quot;: &quot;43.6048&quot;, &quot;lon&quot;: &quot;-116.3496&quot;, &quot;Quantity&quot;: &quot;14,476&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;41.5300&quot;, &quot;lon&quot;: &quot;-87.8500&quot;, &quot;Quantity&quot;: &quot;54,989&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;41.7200&quot;, &quot;lon&quot;: &quot;-88.0300&quot;, &quot;Quantity&quot;: &quot;72,366&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.0500&quot;, &quot;lon&quot;: &quot;-87.8300&quot;, &quot;Quantity&quot;: &quot;59,164&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.1000&quot;, &quot;lon&quot;: &quot;-87.9700&quot;, &quot;Quantity&quot;: &quot;49,074&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.1300&quot;, &quot;lon&quot;: &quot;-88.3300&quot;, &quot;Quantity&quot;: &quot;77,454&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.2300&quot;, &quot;lon&quot;: &quot;-87.9300&quot;, &quot;Quantity&quot;: &quot;51,251&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.2600&quot;, &quot;lon&quot;: &quot;-88.9700&quot;, &quot;Quantity&quot;: &quot;57,571&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.6292&quot;, &quot;lon&quot;: &quot;-86.1252&quot;, &quot;Quantity&quot;: &quot;24,227&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.6303&quot;, &quot;lon&quot;: &quot;-86.1249&quot;, &quot;Quantity&quot;: &quot;1,074&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.7613&quot;, &quot;lon&quot;: &quot;-86.3488&quot;, &quot;Quantity&quot;: &quot;12,319&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.7634&quot;, &quot;lon&quot;: &quot;-86.3489&quot;, &quot;Quantity&quot;: &quot;1,027&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;40.0028&quot;, &quot;lon&quot;: &quot;-86.1227&quot;, &quot;Quantity&quot;: &quot;901&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;41.4900&quot;, &quot;lon&quot;: &quot;-87.4700&quot;, &quot;Quantity&quot;: &quot;83,677&quot; }, { &quot;State&quot;: &quot;Kentucky&quot;, &quot;lat&quot;: &quot;38.1438&quot;, &quot;lon&quot;: &quot;-85.6751&quot;, &quot;Quantity&quot;: &quot;-85&quot; }];<br />
          var data1 = [];<br />
          var tmp = &#8221;;<br />
          var formatedVal = 0;<br />
          if (selectMap == &quot;0&quot;) {<br />
              var H = Highcharts,<br />
                           map = H.maps[&#8216;countries/us/us-all&#8217;],<br />
                              chart;<br />
          }<br />
          else {<br />
              var H = Highcharts,<br />
                                map = H.maps[selectMap],<br />
                                   chart;<br />
          }<br />
          $.each(jsdata, function (ix, entry) {<br />
              if (Object.keys(entry).length &gt;= 4) {<br />
                  tmp = entry[zPoint].replace(/\,/g, &#8221;).replace(/\$/g, &#8221;).replace(/\%/g, &#8221;).replace(/\(/g, &#8221;).replace(/\)/g, &#8221;);<br />
                  if (isNaN(tmp)) {<br />
                      entry.z = entry[zPoint];<br />
                  }<br />
                  else {  </p>
<p>                  }<br />
                  data1.push(entry);<br />
              }<br />
          });<br />
          chart = $(&#8216;#container&#8217;).highcharts(&#8216;Map&#8217;, {<br />
              chart: {<br />
                  borderWidth: 1<br />
              },<br />
              title: {<br />
                  text: &#8216;Bubble map&#8217;<br />
              },<br />
              subtitle: {<br />
                  text: &#8216;Bubble map sub title&#8217;<br />
              },  </p>
<p>              tooltip: {<br />
                  pointFormat: &#8216;{point.State}: {point.Quantity}&#8217;<br />
              },  </p>
<p>              mapNavigation: {<br />
                  enabled: true,<br />
                  buttonOptions: {<br />
                      verticalAlign: &#8216;bottom&#8217;<br />
                  }<br />
              },<br />
              xAxis: {<br />
              },<br />
              yAxis: {<br />
              },<br />
              legend: {<br />
                  enabled: true,<br />
                  title: {<br />
                      style: {<br />
                          color: (Highcharts.theme &amp;&amp; Highcharts.theme.textColor) || &#8216;black&#8217;<br />
                      }<br />
                  },<br />
                  layout: &#8216;vertical&#8217;,<br />
                  align: &#8216;right&#8217;,<br />
                  verticalAlign: &#8216;bottom&#8217;,<br />
                  floating: true,<br />
                  valueDecimals: 0,<br />
                  valueSuffix: &#8216;$&#8217;,<br />
                  backgroundColor: (Highcharts.theme &amp;&amp; Highcharts.theme.legendBackgroundColor) || &#8216;rgba(255, 255, 255, 0.85)&#8217;,<br />
                  symbolRadius: 0,<br />
                  symbolHeight: 14<br />
              },<br />
              series: [{<br />
                  mapData: map,<br />
                  borderColor: &#8216;#E0E0E0&#8217;,<br />
                  colour: &#8216;#E0E0E0&#8217;,<br />
                  showInLegend: false,<br />
                  enableMouseTracking: true,<br />
                  cursor: &#8216;pointer&#8217;,<br />
                  dataLabels: {<br />
                      enabled: true,<br />
                      format: &#8216;{point.properties.postal-code}&#8217;,<br />
                      textDecoration: &#8216;none&#8217;,<br />
                      style: { &quot;color&quot;: &quot;darkgrey&quot;, &quot;fontWeight&quot;: &quot;bold&quot;, &quot;HcTextStroke&quot;: &quot;0px rgba(0,0,0,0.5)&quot; }<br />
                  },<br />
                  events: {<br />
                      click: function (e) {<br />
                          e.point.zoomTo();<br />
                      }<br />
                  },<br />
              },<br />
              {<br />
                  type: &#8216;mapbubble&#8217;,<br />
                  color: &#8216;#E0E0E0&#8217;,<br />
                  dataLabels: {<br />
                      enabled: true,<br />
                      formatter: function () {<br />
                      }<br />
                  },<br />
                  enableMouseTracking: true,<br />
                  joinBy: [&#8216;iso-a2&#8217;, &#8216;code&#8217;],<br />
                  name: zPoint,<br />
                  data: data1,<br />
                  minSize: $(&quot;#mapMinBubSize&quot;).val(),<br />
                  maxSize: $(&quot;#mapMaxBubSize&quot;).val(),<br />
                  color: $(&quot;#mapColor&quot;).val(),<br />
                  displayNegative: true,<br />
                  sizeBy: &#8216;width&#8217;,<br />
                  cursor: &#8216;pointer&#8217;,<br />
                  negativeColor: Highcharts.getOptions().colors[0]<br />
              }<br />
              ],<br />
              chart: {<br />
                  marginRight: 50<br />
              },<br />
              exporting: {<br />
                  enabled: false<br />
              }<br />
          });<br />
      }<br />
[/js]</p>
<p>You can try giving a different setting or property to all the settings said above. Now if you run your code, you will get output as follows.</p>
<div id="attachment_8801" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/04/Create_Bubble_Map1.png"><img decoding="async" aria-describedby="caption-attachment-8801" src="http://sibeeshpassion.com/wp-content/uploads/2015/04/Create_Bubble_Map1-1024x332.png" alt="Create_Bubble_Map" width="634" height="206" class="size-large wp-image-8801" srcset="/wp-content/uploads/2015/04/Create_Bubble_Map1.png 1024w, /wp-content/uploads/2015/04/Create_Bubble_Map1-300x97.png 300w, /wp-content/uploads/2015/04/Create_Bubble_Map1-768x249.png 768w, /wp-content/uploads/2015/04/Create_Bubble_Map1-400x130.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-8801" class="wp-caption-text">Create_Bubble_Map</p></div>
<p>I hope you got the output. In the preceding implementation, I have given my tooltip as:<br />
[js]<br />
tooltip: {<br />
                   pointFormat: &#8216;{point.State}: {point.Quantity}&#8217;<br />
          },<br />
[/js]</p>
<p>You can try various options there too. Here I am taking the values State and Quantity from the relevant point. </p>
<p>The next thing we will do is to create some UI elements. We will set the map bubble color, bubble size, background map and so on in these elements so that our application will be user-friendly.<br />
Please add some UI elements as follows.<br />
[html]<br />
Bubble Map Demo &#8211; sibeeshpassion<br />
   &lt;br /&gt;<br />
   &lt;br /&gt;<br />
   &lt;div id=&quot;container&quot; style=&quot;min-width: 310px; height: 400px; margin: 0 auto&quot;&gt;&lt;/div&gt;<br />
   &lt;label&gt;Min Bubble Size&lt;/label&gt;<br />
   &lt;input type=&quot;number&quot; value=&quot;8&quot; min=&quot;1&quot; id=&quot;mapMinBubSize&quot; title=&quot;Type Bubble Min Size.&quot; /&gt;<br />
   &lt;label&gt;Max Bubble Size&lt;/label&gt;<br />
   &lt;input type=&quot;number&quot; min=&quot;1&quot; value=&quot;40&quot; id=&quot;mapMaxBubSize&quot; title=&quot;Type Bubble Max Size.&quot; /&gt;<br />
   &lt;label&gt;Color&lt;/label&gt;<br />
   &lt;input type=&quot;color&quot; value=&quot;#BAD6F2&quot; id=&quot;mapColor&quot; title=&quot;Select Bubble Color.&quot; /&gt;<br />
   &lt;label&gt;Select Map&lt;/label&gt;<br />
   &lt;select name=&quot;tech&quot; id=&quot;mapSelectMap&quot; class=&quot;tech&quot; title=&quot;Select Map.&quot;&gt;<br />
       &lt;option value=&quot;0&quot;&gt;Select Map&lt;/option&gt;<br />
       &lt;option value=&quot;countries/us/us-all&quot; selected=&quot;selected&quot;&gt;US alone&lt;/option&gt;<br />
       &lt;option value=&quot;custom/world&quot;&gt;Custom World&lt;/option&gt;<br />
   &lt;/select&gt;<br />
   &lt;div id=&quot;apply&quot; style=&quot;cursor: pointer; background-color: red; color: white; width: 100px; padding: 5px; float: right;&quot;&gt;Apply Settings&lt;/div&gt;<br />
[/html]</p>
<p>Now you can see those elements in your screen, right?</p>
<div id="attachment_8811" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/04/Create_Bubble_Map2.png"><img decoding="async" aria-describedby="caption-attachment-8811" src="http://sibeeshpassion.com/wp-content/uploads/2015/04/Create_Bubble_Map2-1024x35.png" alt="Create_Bubble_Map" width="634" height="22" class="size-large wp-image-8811" srcset="/wp-content/uploads/2015/04/Create_Bubble_Map2.png 1024w, /wp-content/uploads/2015/04/Create_Bubble_Map2-300x10.png 300w, /wp-content/uploads/2015/04/Create_Bubble_Map2-768x26.png 768w, /wp-content/uploads/2015/04/Create_Bubble_Map2-1000x35.png 1000w, /wp-content/uploads/2015/04/Create_Bubble_Map2-400x14.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-8811" class="wp-caption-text">Create_Bubble_Map</p></div>
<p>So we need to fire an event whenever the user clicks the apply settings button, right? Include the following code in your document ready function.</p>
<p>[js]<br />
$(&#8216;#apply&#8217;).click(function () {<br />
               loadMap();<br />
           });<br />
[/js]</p>
<p>Now we will check whether our given settings are being applid to the map. Please see the following screenshot.</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/04/Create_Bubble_Map3.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/04/Create_Bubble_Map3-1024x339.png" alt="Create_Bubble_Map3" width="634" height="210" class="alignnone size-large wp-image-8821" srcset="/wp-content/uploads/2015/04/Create_Bubble_Map3.png 1024w, /wp-content/uploads/2015/04/Create_Bubble_Map3-300x99.png 300w, /wp-content/uploads/2015/04/Create_Bubble_Map3-768x254.png 768w, /wp-content/uploads/2015/04/Create_Bubble_Map3-400x132.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
<p>Now we have changed the bubble colour, bubble size and the map loaded in the background. Before the map was US alone one. Now it is the complete world.</p>
<p>Whenever the user changes the map we are checking it as follows.<br />
[js]<br />
var selectMap = $.trim($(&quot;#mapSelectMap&quot;).val());<br />
if (selectMap == &quot;0&quot;) {<br />
                var H = Highcharts,<br />
                             map = H.maps[&#8216;countries/us/us-all&#8217;],<br />
                                chart;<br />
            }<br />
            else {<br />
                var H = Highcharts,<br />
                                  map = H.maps[selectMap],<br />
                                     chart;<br />
            }<br />
[/js]</p>
<p>Can you find the differences?</p>
<p><strong>Complete HTML</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Bubble Map Demo &#8211; sibeeshpassion&lt;/title&gt;<br />
    &lt;script src=&quot;Scripts/jquery-1.11.1.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/highmaps.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/proj4.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/us-all.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/world.js&quot;&gt;&lt;/script&gt;  </p>
<p>    &lt;script&gt;<br />
        $(function () {<br />
            loadMap();<br />
            $(&#8216;#apply&#8217;).click(function () {<br />
                loadMap();<br />
            });<br />
        });<br />
        function loadMap() {<br />
            var selectMap = $.trim($(&quot;#mapSelectMap&quot;).val());<br />
            var zPoint = &quot;Quantity&quot;;<br />
            var jsdata = [{ &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;32.8796&quot;, &quot;lon&quot;: &quot;-111.7282&quot;, &quot;Quantity&quot;: &quot;29,248&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.3197&quot;, &quot;lon&quot;: &quot;-111.9837&quot;, &quot;Quantity&quot;: &quot;102,928&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.3939&quot;, &quot;lon&quot;: &quot;-111.6965&quot;, &quot;Quantity&quot;: &quot;108,863&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.4495&quot;, &quot;lon&quot;: &quot;-112.3410&quot;, &quot;Quantity&quot;: &quot;67,218&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.6155&quot;, &quot;lon&quot;: &quot;-111.9263&quot;, &quot;Quantity&quot;: &quot;66,556&quot; }, { &quot;State&quot;: &quot;Arizona&quot;, &quot;lat&quot;: &quot;33.6384&quot;, &quot;lon&quot;: &quot;-112.2073&quot;, &quot;Quantity&quot;: &quot;147,552&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.6145&quot;, &quot;lon&quot;: &quot;-117.7101&quot;, &quot;Quantity&quot;: &quot;26,053&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.7008&quot;, &quot;lon&quot;: &quot;-117.9362&quot;, &quot;Quantity&quot;: &quot;26,057&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.7963&quot;, &quot;lon&quot;: &quot;-116.3845&quot;, &quot;Quantity&quot;: &quot;497,249&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8274&quot;, &quot;lon&quot;: &quot;-118.0868&quot;, &quot;Quantity&quot;: &quot;32,052&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8763&quot;, &quot;lon&quot;: &quot;-117.7418&quot;, &quot;Quantity&quot;: &quot;23,521&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;33.8996&quot;, &quot;lon&quot;: &quot;-118.3669&quot;, &quot;Quantity&quot;: &quot;26,169&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0302&quot;, &quot;lon&quot;: &quot;-118.3865&quot;, &quot;Quantity&quot;: &quot;21,996&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0569&quot;, &quot;lon&quot;: &quot;-117.2995&quot;, &quot;Quantity&quot;: &quot;59,135&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.0737&quot;, &quot;lon&quot;: &quot;-117.8859&quot;, &quot;Quantity&quot;: &quot;4,757&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.1820&quot;, &quot;lon&quot;: &quot;-118.3140&quot;, &quot;Quantity&quot;: &quot;28,909&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.2257&quot;, &quot;lon&quot;: &quot;-119.1551&quot;, &quot;Quantity&quot;: &quot;22,569&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.2300&quot;, &quot;lon&quot;: &quot;-118.5500&quot;, &quot;Quantity&quot;: &quot;22,413&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.4130&quot;, &quot;lon&quot;: &quot;-118.5036&quot;, &quot;Quantity&quot;: &quot;18,399&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.4813&quot;, &quot;lon&quot;: &quot;-117.3389&quot;, &quot;Quantity&quot;: &quot;23,268&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;34.6029&quot;, &quot;lon&quot;: &quot;-118.1464&quot;, &quot;Quantity&quot;: &quot;24,651&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;37.5038&quot;, &quot;lon&quot;: &quot;-121.9762&quot;, &quot;Quantity&quot;: &quot;4&quot; }, { &quot;State&quot;: &quot;California&quot;, &quot;lat&quot;: &quot;38.3525&quot;, &quot;lon&quot;: &quot;-122.7148&quot;, &quot;Quantity&quot;: &quot;2&quot; }, { &quot;State&quot;: &quot;Colorado&quot;, &quot;lat&quot;: &quot;38.4766&quot;, &quot;lon&quot;: &quot;-107.8812&quot;, &quot;Quantity&quot;: &quot;3,294&quot; }, { &quot;State&quot;: &quot;Colorado&quot;, &quot;lat&quot;: &quot;39.0730&quot;, &quot;lon&quot;: &quot;-108.5710&quot;, &quot;Quantity&quot;: &quot;8,704&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.8400&quot;, &quot;lon&quot;: &quot;-82.6800&quot;, &quot;Quantity&quot;: &quot;75,066&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9400&quot;, &quot;lon&quot;: &quot;-82.3200&quot;, &quot;Quantity&quot;: &quot;135,365&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9600&quot;, &quot;lon&quot;: &quot;-82.3200&quot;, &quot;Quantity&quot;: &quot;-6&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;27.9925&quot;, &quot;lon&quot;: &quot;-82.7296&quot;, &quot;Quantity&quot;: &quot;27,274&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0661&quot;, &quot;lon&quot;: &quot;-82.5688&quot;, &quot;Quantity&quot;: &quot;261&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0790&quot;, &quot;lon&quot;: &quot;-80.6984&quot;, &quot;Quantity&quot;: &quot;15,720&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.0941&quot;, &quot;lon&quot;: &quot;-81.9738&quot;, &quot;Quantity&quot;: &quot;85,437&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.1918&quot;, &quot;lon&quot;: &quot;-82.3812&quot;, &quot;Quantity&quot;: &quot;97,233&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.3027&quot;, &quot;lon&quot;: &quot;-81.4216&quot;, &quot;Quantity&quot;: &quot;135,193&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.5622&quot;, &quot;lon&quot;: &quot;-81.2074&quot;, &quot;Quantity&quot;: &quot;120,424&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;28.6629&quot;, &quot;lon&quot;: &quot;-81.4176&quot;, &quot;Quantity&quot;: &quot;110,185&quot; }, { &quot;State&quot;: &quot;Florida&quot;, &quot;lat&quot;: &quot;29.1800&quot;, &quot;lon&quot;: &quot;-81.0800&quot;, &quot;Quantity&quot;: &quot;66,725&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;32.8100&quot;, &quot;lon&quot;: &quot;-83.7100&quot;, &quot;Quantity&quot;: &quot;3&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.3671&quot;, &quot;lon&quot;: &quot;-84.7647&quot;, &quot;Quantity&quot;: &quot;87,508&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.4600&quot;, &quot;lon&quot;: &quot;-84.2100&quot;, &quot;Quantity&quot;: &quot;155,811&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.4759&quot;, &quot;lon&quot;: &quot;-82.0709&quot;, &quot;Quantity&quot;: &quot;10,875&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.5600&quot;, &quot;lon&quot;: &quot;-84.5400&quot;, &quot;Quantity&quot;: &quot;17,937&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.5610&quot;, &quot;lon&quot;: &quot;-84.3223&quot;, &quot;Quantity&quot;: &quot;203,297&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.6810&quot;, &quot;lon&quot;: &quot;-84.1604&quot;, &quot;Quantity&quot;: &quot;134,700&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.8200&quot;, &quot;lon&quot;: &quot;-84.3600&quot;, &quot;Quantity&quot;: &quot;122,120&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.9168&quot;, &quot;lon&quot;: &quot;-83.4439&quot;, &quot;Quantity&quot;: &quot;84,648&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;33.9522&quot;, &quot;lon&quot;: &quot;-84.1343&quot;, &quot;Quantity&quot;: &quot;105,862&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0051&quot;, &quot;lon&quot;: &quot;-84.5752&quot;, &quot;Quantity&quot;: &quot;-14&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0076&quot;, &quot;lon&quot;: &quot;-84.5769&quot;, &quot;Quantity&quot;: &quot;204,888&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.0600&quot;, &quot;lon&quot;: &quot;-83.9800&quot;, &quot;Quantity&quot;: &quot;104,291&quot; }, { &quot;State&quot;: &quot;Georgia&quot;, &quot;lat&quot;: &quot;34.1900&quot;, &quot;lon&quot;: &quot;-84.1200&quot;, &quot;Quantity&quot;: &quot;186,459&quot; }, { &quot;State&quot;: &quot;Idaho&quot;, &quot;lat&quot;: &quot;42.9101&quot;, &quot;lon&quot;: &quot;-112.4605&quot;, &quot;Quantity&quot;: &quot;5,524&quot; }, { &quot;State&quot;: &quot;Idaho&quot;, &quot;lat&quot;: &quot;43.6048&quot;, &quot;lon&quot;: &quot;-116.3496&quot;, &quot;Quantity&quot;: &quot;14,476&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;41.5300&quot;, &quot;lon&quot;: &quot;-87.8500&quot;, &quot;Quantity&quot;: &quot;54,989&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;41.7200&quot;, &quot;lon&quot;: &quot;-88.0300&quot;, &quot;Quantity&quot;: &quot;72,366&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.0500&quot;, &quot;lon&quot;: &quot;-87.8300&quot;, &quot;Quantity&quot;: &quot;59,164&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.1000&quot;, &quot;lon&quot;: &quot;-87.9700&quot;, &quot;Quantity&quot;: &quot;49,074&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.1300&quot;, &quot;lon&quot;: &quot;-88.3300&quot;, &quot;Quantity&quot;: &quot;77,454&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.2300&quot;, &quot;lon&quot;: &quot;-87.9300&quot;, &quot;Quantity&quot;: &quot;51,251&quot; }, { &quot;State&quot;: &quot;Illinois&quot;, &quot;lat&quot;: &quot;42.2600&quot;, &quot;lon&quot;: &quot;-88.9700&quot;, &quot;Quantity&quot;: &quot;57,571&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.6292&quot;, &quot;lon&quot;: &quot;-86.1252&quot;, &quot;Quantity&quot;: &quot;24,227&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.6303&quot;, &quot;lon&quot;: &quot;-86.1249&quot;, &quot;Quantity&quot;: &quot;1,074&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.7613&quot;, &quot;lon&quot;: &quot;-86.3488&quot;, &quot;Quantity&quot;: &quot;12,319&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;39.7634&quot;, &quot;lon&quot;: &quot;-86.3489&quot;, &quot;Quantity&quot;: &quot;1,027&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;40.0028&quot;, &quot;lon&quot;: &quot;-86.1227&quot;, &quot;Quantity&quot;: &quot;901&quot; }, { &quot;State&quot;: &quot;Indiana&quot;, &quot;lat&quot;: &quot;41.4900&quot;, &quot;lon&quot;: &quot;-87.4700&quot;, &quot;Quantity&quot;: &quot;83,677&quot; }, { &quot;State&quot;: &quot;Kentucky&quot;, &quot;lat&quot;: &quot;38.1438&quot;, &quot;lon&quot;: &quot;-85.6751&quot;, &quot;Quantity&quot;: &quot;-85&quot; }];<br />
            var data1 = [];<br />
            var tmp = &#8221;;<br />
            var formatedVal = 0;<br />
            if (selectMap == &quot;0&quot;) {<br />
                var H = Highcharts,<br />
                             map = H.maps[&#8216;countries/us/us-all&#8217;],<br />
                                chart;<br />
            }<br />
            else {<br />
                var H = Highcharts,<br />
                                  map = H.maps[selectMap],<br />
                                     chart;<br />
            }<br />
            $.each(jsdata, function (ix, entry) {<br />
                if (Object.keys(entry).length &gt;= 4) {<br />
                    tmp = entry[zPoint].replace(/\,/g, &#8221;).replace(/\$/g, &#8221;).replace(/\%/g, &#8221;).replace(/\(/g, &#8221;).replace(/\)/g, &#8221;);<br />
                    if (isNaN(tmp)) {<br />
                        entry.z = entry[zPoint];<br />
                    }<br />
                    else {  </p>
<p>                    }<br />
                    data1.push(entry);<br />
                }<br />
            });<br />
            chart = $(&#8216;#container&#8217;).highcharts(&#8216;Map&#8217;, {<br />
                chart: {<br />
                    borderWidth: 1<br />
                },<br />
                title: {<br />
                    text: &#8216;Bubble map&#8217;<br />
                },<br />
                subtitle: {<br />
                    text: &#8216;Bubble map sub title&#8217;<br />
                },  </p>
<p>                tooltip: {<br />
                    pointFormat: &#8216;{point.State}: {point.Quantity}&#8217;<br />
                },  </p>
<p>                mapNavigation: {<br />
                    enabled: true,<br />
                    buttonOptions: {<br />
                        verticalAlign: &#8216;bottom&#8217;<br />
                    }<br />
                },<br />
                xAxis: {<br />
                },<br />
                yAxis: {<br />
                },<br />
                legend: {<br />
                    enabled: true,<br />
                    title: {<br />
                        style: {<br />
                            color: (Highcharts.theme &amp;&amp; Highcharts.theme.textColor) || &#8216;black&#8217;<br />
                        }<br />
                    },<br />
                    layout: &#8216;vertical&#8217;,<br />
                    align: &#8216;right&#8217;,<br />
                    verticalAlign: &#8216;bottom&#8217;,<br />
                    floating: true,<br />
                    valueDecimals: 0,<br />
                    valueSuffix: &#8216;$&#8217;,<br />
                    backgroundColor: (Highcharts.theme &amp;&amp; Highcharts.theme.legendBackgroundColor) || &#8216;rgba(255, 255, 255, 0.85)&#8217;,<br />
                    symbolRadius: 0,<br />
                    symbolHeight: 14<br />
                },<br />
                series: [{<br />
                    mapData: map,<br />
                    borderColor: &#8216;#E0E0E0&#8217;,<br />
                    colour: &#8216;#E0E0E0&#8217;,<br />
                    showInLegend: false,<br />
                    enableMouseTracking: true,<br />
                    cursor: &#8216;pointer&#8217;,<br />
                    dataLabels: {<br />
                        enabled: true,<br />
                        format: &#8216;{point.properties.postal-code}&#8217;,<br />
                        textDecoration: &#8216;none&#8217;,<br />
                        style: { &quot;color&quot;: &quot;darkgrey&quot;, &quot;fontWeight&quot;: &quot;bold&quot;, &quot;HcTextStroke&quot;: &quot;0px rgba(0,0,0,0.5)&quot; }<br />
                    },<br />
                    events: {<br />
                        click: function (e) {<br />
                            e.point.zoomTo();<br />
                        }<br />
                    },<br />
                },<br />
                {<br />
                    type: &#8216;mapbubble&#8217;,<br />
                    color: &#8216;#E0E0E0&#8217;,<br />
                    dataLabels: {<br />
                        enabled: true,<br />
                        formatter: function () {<br />
                        }<br />
                    },<br />
                    enableMouseTracking: true,<br />
                    joinBy: [&#8216;iso-a2&#8217;, &#8216;code&#8217;],<br />
                    name: zPoint,<br />
                    data: data1,<br />
                    minSize: $(&quot;#mapMinBubSize&quot;).val(),<br />
                    maxSize: $(&quot;#mapMaxBubSize&quot;).val(),<br />
                    color: $(&quot;#mapColor&quot;).val(),<br />
                    displayNegative: true,<br />
                    sizeBy: &#8216;width&#8217;,<br />
                    cursor: &#8216;pointer&#8217;,<br />
                    negativeColor: Highcharts.getOptions().colors[0]<br />
                }<br />
                ],<br />
                chart: {<br />
                    marginRight: 50<br />
                },<br />
                exporting: {<br />
                    enabled: false<br />
                }<br />
            });<br />
        }  </p>
<p>    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Bubble Map Demo &#8211; sibeeshpassion<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;container&quot; style=&quot;min-width: 310px; height: 400px; margin: 0 auto&quot;&gt;&lt;/div&gt;<br />
    &lt;label&gt;Min Bubble Size&lt;/label&gt;<br />
    &lt;input type=&quot;number&quot; value=&quot;8&quot; min=&quot;1&quot; id=&quot;mapMinBubSize&quot; title=&quot;Type Bubble Min Size.&quot; /&gt;<br />
    &lt;label&gt;Max Bubble Size&lt;/label&gt;<br />
    &lt;input type=&quot;number&quot; min=&quot;1&quot; value=&quot;40&quot; id=&quot;mapMaxBubSize&quot; title=&quot;Type Bubble Max Size.&quot; /&gt;<br />
    &lt;label&gt;Color&lt;/label&gt;<br />
    &lt;input type=&quot;color&quot; value=&quot;#BAD6F2&quot; id=&quot;mapColor&quot; title=&quot;Select Bubble Color.&quot; /&gt;<br />
    &lt;label&gt;Select Map&lt;/label&gt;<br />
    &lt;select name=&quot;tech&quot; id=&quot;mapSelectMap&quot; class=&quot;tech&quot; title=&quot;Select Map.&quot;&gt;<br />
        &lt;option value=&quot;0&quot;&gt;Select Map&lt;/option&gt;<br />
        &lt;option value=&quot;countries/us/us-all&quot; selected=&quot;selected&quot;&gt;US alone&lt;/option&gt;<br />
        &lt;option value=&quot;custom/world&quot;&gt;Custom World&lt;/option&gt;<br />
    &lt;/select&gt;<br />
    &lt;div id=&quot;apply&quot; style=&quot;cursor: pointer; background-color: red; color: white; width: 100px; padding: 5px; float: right;&quot;&gt;Apply Settings&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Please download the source code for more details. I hope you liked this article. Now please share your thoughts and suggestions. It matters a lot.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/working-with-bubble-map/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Drag and Drop the Legend and Maintain the Position in Chart</title>
		<link>https://mail.sibeeshpassion.com/drag-and-drop-the-legend-and-maintain-the-position-in-chart/</link>
					<comments>https://mail.sibeeshpassion.com/drag-and-drop-the-legend-and-maintain-the-position-in-chart/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 29 Apr 2015 20:40:08 +0000</pubDate>
				<category><![CDATA[HighChart]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[Drag and drop legend in chart.]]></category>
		<category><![CDATA[Drag legend]]></category>
		<category><![CDATA[Draggable Legend]]></category>
		<category><![CDATA[Drop legend]]></category>
		<category><![CDATA[HighChart Legend]]></category>
		<category><![CDATA[HTML5 Chart]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Legend]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=1961</guid>

					<description><![CDATA[Today we will learn how to create a drag-able legend and maintain that position in the chart area, so that once we drag and drop the legend, even if we reload the chart again, it will take the legend position from the session storage, where we have set the values when dropping the legend. Cool, right? Background For the past few weeks I have been working in Charts, so a few days ago I got a requirement to make a drag-able legend and maintain the position. As you all know, everyone expects the best from their products, so I began [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Today we will learn how to create a drag-able legend and maintain that position in the chart area, so that once we drag and drop the legend, even if we reload the chart again, it will take the legend position from the session storage, where we have set the values when dropping the legend. Cool, right?</p>
<p><strong>Background</strong></p>
<p>For the past few weeks I have been working in Charts, so a few days ago I got a requirement to make a drag-able legend and maintain the position. As you all know, everyone expects the best from their products, so I began working to satisfy my client by giving them all the feasible options in the chart. Once I was done with that it was good.</p>
<p><strong>Download Source Code</strong></p>
<p><a href="http://sibeeshpassion.com/download/DragAndDropLegend.rar" target="_blank">Drag and Drop the Legend and Maintain the Position</a></p>
<p><strong>Load the required files</strong></p>
<p>To start, we must load some files, you can determine the files below.<br />
[js]<br />
   &lt;script src=&quot;Scripts/jquery-1.11.1.min.js&quot;&gt;&lt;/script&gt;<br />
   &lt;script src=&quot;Scripts/highcharts.js&quot;&gt;&lt;/script&gt;<br />
   &lt;script src=&quot;Scripts/highcharts-more.js&quot;&gt;&lt;/script&gt;<br />
   &lt;script src=&quot;Scripts/draggable-legend.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p><strong>Creating UI elements</strong></p>
<p>Now we need some UI elements to load the chart and show the drag and drop position. We will show the position values while the user drags and drops the legend, so that it looks more active.<br />
[html]<br />
    &lt;div id=&quot;container&quot; style=&quot;min-width: 310px; height: 400px; margin: 0 auto&quot;&gt;&lt;/div&gt;<br />
    Legend X: &lt;input id=&quot;txtLegendX&quot; type=&quot;number&quot; /&gt; &lt;br /&gt;<br />
    Legend X: &lt;input id=&quot;txtLegendY&quot; type=&quot;number&quot; /&gt;<br />
[/html]</p>
<p><strong>Creating options of chart</strong></p>
<p>The next step we need is to set the options of the chart. Please find the following settings.<br />
[js]<br />
var options = {<br />
                title: {<br />
                    text: &#8216;Worked hours in a week&#8217;<br />
                },<br />
                xAxis: {<br />
                    categories: [&#8216;Developing&#8217;, &#8216;Maitenance&#8217;, &#8216;Marketing&#8217;, &#8216;Business&#8217;, &#8216;Admin&#8217;]<br />
                },<br />
                series: [{<br />
                    type: &#8216;column&#8217;,<br />
                    name: &#8216;Monday&#8217;,<br />
                    data: [3, 2, 1, 3, 4]<br />
                }, {<br />
                    type: &#8216;column&#8217;,<br />
                    name: &#8216;Tuesday&#8217;,<br />
                    data: [2, 3, 5, 7, 6]<br />
                }, {<br />
                    type: &#8216;column&#8217;,<br />
                    name: &#8216;Wednesday&#8217;,<br />
                    data: [4, 3, 3, 9, 0]<br />
                }, {<br />
                    type: &#8216;column&#8217;,<br />
                    name: &#8216;Thursday&#8217;,<br />
                    data: [4, 3, 3, 9, 0]<br />
                }, {<br />
                    type: &#8216;column&#8217;,<br />
                    name: &#8216;Friday&#8217;,<br />
                    data: [4, 3, 3, 9, 0]<br />
                }, {<br />
                    type: &#8216;spline&#8217;,<br />
                    name: &#8216;Thursday&#8217;,<br />
                    data: [3, 2.67, 3, 6.33, 3.33],<br />
                    marker: {<br />
                        lineWidth: 2,<br />
                        lineColor: Highcharts.getOptions().colors[3],<br />
                        fillColor: &#8216;white&#8217;<br />
                    }<br />
                }],<br />
                legend: {<br />
                    enabled: true,<br />
                    layout: &#8216;vertical&#8217;,<br />
                    backgroundColor: &#8216;white&#8217;,<br />
                    align: &#8216;left&#8217;,<br />
                    verticalAlign: &#8216;top&#8217;,<br />
                    y: 50,<br />
                    x: 50,<br />
                    borderWidth: 1,<br />
                    borderRadius: 0,<br />
                    title: {<br />
                        text: &#8216;::Drag Me&#8217;<br />
                    },<br />
                    floating: true,<br />
                    draggable: true,<br />
                    zIndex: 20<br />
                }<br />
            };<br />
[/js]</p>
<p>In the preceding code block we have set the series and other settings including the legend. Please note that we have set the draggable and floating property to true. You can customize all of these properties as you need to.<br />
[js]<br />
floating: true,<br />
draggable: true,<br />
[/js]</p>
<p>Now if you run your application, you will get output as follows.</p>
<div id="attachment_9161" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart1-e1439362346617.png"><img decoding="async" aria-describedby="caption-attachment-9161" src="http://sibeeshpassion.com/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart1-e1439362346617.png" alt="Drag and Drop the Legend and Maintain the Position in Chart" width="650" height="148" class="size-full wp-image-9161" srcset="/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart1-e1439362346617.png 650w, /wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart1-e1439362346617-300x68.png 300w, /wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart1-e1439362346617-400x91.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9161" class="wp-caption-text">Drag and Drop the Legend and Maintain the Position in Chart</p></div>
<p>So our application is working fine, isn&#8217;t it?</p>
<p><strong>Changes in draggable-legend.js</strong></p>
<p>To continue with the process, we must make some changes in the draggable-legend.js. You can see the changes below. If you download the source code attached, you can see the changes by default.<br />
[js]<br />
addEvent(chart.container, &#8216;mousemove&#8217;, function (e) {  </p>
<p>});<br />
[/js]</p>
<p>I will include some code for our purposes in the preceding function in draggable-legend.js. At the end of the specified function I am including the following code block.<br />
[js]<br />
$(&quot;#txtLegendX&quot;).val(options.x);<br />
$(&quot;#txtLegendY&quot;).val(options.y);<br />
sessionStorage.setItem(&quot;legendx&quot;, options.x);<br />
sessionStorage.setItem(&quot;legendy&quot;, options.y);<br />
[/js]</p>
<p>The purpose of that code block is to set the value to the session storage and the UI element. Now we will run our application and see the output.</p>
<div id="attachment_9171" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart2-e1439362411227.png"><img decoding="async" aria-describedby="caption-attachment-9171" src="http://sibeeshpassion.com/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart2-e1439362411227.png" alt="Drag and Drop the Legend and Maintain the Position in Chart" width="650" height="194" class="size-full wp-image-9171" srcset="/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart2-e1439362411227.png 650w, /wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart2-e1439362411227-300x90.png 300w, /wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart2-e1439362411227-400x119.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9171" class="wp-caption-text">Drag and Drop the Legend and Maintain the Position in Chart</p></div>
<p>Now if you drag and drop the legend somewhere else, you can see that the values specified in the text boxes has changed.</p>
<div id="attachment_9181" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart3.png"><img decoding="async" aria-describedby="caption-attachment-9181" src="http://sibeeshpassion.com/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart3-1024x280.png" alt="Drag and Drop the Legend and Maintain the Position in Chart" width="634" height="173" class="size-large wp-image-9181" srcset="/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart3.png 1024w, /wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart3-300x82.png 300w, /wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart3-768x210.png 768w, /wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart3-400x109.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-9181" class="wp-caption-text">Drag and Drop the Legend and Maintain the Position in Chart</p></div>
<p>No we will check whether the values are updated to the session storage in the browser console.</p>
<div id="attachment_9191" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart4-e1439362495549.png"><img decoding="async" aria-describedby="caption-attachment-9191" src="http://sibeeshpassion.com/wp-content/uploads/2015/04/drag-and-drop-the-legend-and-maintain-the-position-in-chart4-1024x313.png" alt="Drag and Drop the Legend and Maintain the Position in Chart" width="634" height="194" class="size-large wp-image-9191" /></a><p id="caption-attachment-9191" class="wp-caption-text">Drag and Drop the Legend and Maintain the Position in Chart</p></div>
<p>Cool, it is updated, we are happy.</p>
<p>Now we need to retain this position even if the user reloads the chart, right? Normally what happens is, the chart will be loaded with the initial settings we have set in the option. </p>
<p><strong>Maintain the legend position</strong></p>
<p>To maintain the legend position, we must apply the legend position to the chart, we can take the values from the session storage where we already set the values.<br />
[js]<br />
if (sessionStorage.getItem(&quot;legendx&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;legendx&quot;) != &#8216;undefined&#8217; &amp;&amp; sessionStorage.getItem(&quot;legendy&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;legendy&quot;) != &#8216;undefined&#8217;) {<br />
                options.legend.x = parseInt(sessionStorage.getItem(&quot;legendx&quot;));<br />
                options.legend.y = parseInt(sessionStorage.getItem(&quot;legendy&quot;));<br />
                $(&quot;#txtLegendX&quot;).val(sessionStorage.getItem(&quot;legendx&quot;));<br />
                $(&quot;#txtLegendY&quot;).val(sessionStorage.getItem(&quot;legendy&quot;));<br />
            }<br />
            $(&#8216;#container&#8217;).highcharts(options);<br />
[/js]</p>
<p>We are checking the session storage values and applying values to the options and we provide that options to the chart. Sounds good? So our complete code for this implementation is as follows.</p>
<p><strong>Complete code</strong><br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Dragable Legend &#8211; sibeeshpassion&lt;/title&gt;<br />
    &lt;script src=&quot;Scripts/jquery-1.11.1.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/highcharts.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/highcharts-more.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;Scripts/draggable-legend.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(function () {<br />
            var options = {<br />
                title: {<br />
                    text: &#8216;Worked hours in a week&#8217;<br />
                },<br />
                xAxis: {<br />
                    categories: [&#8216;Developing&#8217;, &#8216;Maitenance&#8217;, &#8216;Marketing&#8217;, &#8216;Business&#8217;, &#8216;Admin&#8217;]<br />
                },<br />
                series: [{<br />
                    type: &#8216;column&#8217;,<br />
                    name: &#8216;Monday&#8217;,<br />
                    data: [3, 2, 1, 3, 4]<br />
                }, {<br />
                    type: &#8216;column&#8217;,<br />
                    name: &#8216;Tuesday&#8217;,<br />
                    data: [2, 3, 5, 7, 6]<br />
                }, {<br />
                    type: &#8216;column&#8217;,<br />
                    name: &#8216;Wednesday&#8217;,<br />
                    data: [4, 3, 3, 9, 0]<br />
                }, {<br />
                    type: &#8216;column&#8217;,<br />
                    name: &#8216;Thursday&#8217;,<br />
                    data: [4, 3, 3, 9, 0]<br />
                }, {<br />
                    type: &#8216;column&#8217;,<br />
                    name: &#8216;Friday&#8217;,<br />
                    data: [4, 3, 3, 9, 0]<br />
                }, {<br />
                    type: &#8216;spline&#8217;,<br />
                    name: &#8216;Thursday&#8217;,<br />
                    data: [3, 2.67, 3, 6.33, 3.33],<br />
                    marker: {<br />
                        lineWidth: 2,<br />
                        lineColor: Highcharts.getOptions().colors[3],<br />
                        fillColor: &#8216;white&#8217;<br />
                    }<br />
                }],<br />
                legend: {<br />
                    enabled: true,<br />
                    layout: &#8216;vertical&#8217;,<br />
                    backgroundColor: &#8216;white&#8217;,<br />
                    align: &#8216;left&#8217;,<br />
                    verticalAlign: &#8216;top&#8217;,<br />
                    y: 50,<br />
                    x: 50,<br />
                    borderWidth: 1,<br />
                    borderRadius: 0,<br />
                    title: {<br />
                        text: &#8216;::Drag Me&#8217;<br />
                    },<br />
                    floating: true,<br />
                    draggable: true,<br />
                    zIndex: 20<br />
                }<br />
            };<br />
            if (sessionStorage.getItem(&quot;legendx&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;legendx&quot;) != &#8216;undefined&#8217; &amp;&amp; sessionStorage.getItem(&quot;legendy&quot;) != null &amp;&amp; typeof sessionStorage.getItem(&quot;legendy&quot;) != &#8216;undefined&#8217;) {<br />
                options.legend.x = parseInt(sessionStorage.getItem(&quot;legendx&quot;));<br />
                options.legend.y = parseInt(sessionStorage.getItem(&quot;legendy&quot;));<br />
                $(&quot;#txtLegendX&quot;).val(sessionStorage.getItem(&quot;legendx&quot;));<br />
                $(&quot;#txtLegendY&quot;).val(sessionStorage.getItem(&quot;legendy&quot;));<br />
            }<br />
            $(&#8216;#container&#8217;).highcharts(options);  </p>
<p>        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Dragable Legend &#8211; sibeeshpassion<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;container&quot; style=&quot;min-width: 310px; height: 400px; margin: 0 auto&quot;&gt;&lt;/div&gt;<br />
    Legend X: &lt;input id=&quot;txtLegendX&quot; type=&quot;number&quot; /&gt; &lt;br /&gt;<br />
    Legend X: &lt;input id=&quot;txtLegendY&quot; type=&quot;number&quot; /&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>I hope you liked this article. Please provide your valuable suggestions. It matters a lot. Please download the source code to determine more.</p>
<p><strong>Points of interest</strong></p>
<p>Legend, Chart, Drag legend, Drop legend, Drag and drop legend in chart.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/drag-and-drop-the-legend-and-maintain-the-position-in-chart/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Working With Charts</title>
		<link>https://mail.sibeeshpassion.com/working-with-charts/</link>
					<comments>https://mail.sibeeshpassion.com/working-with-charts/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 29 Apr 2015 20:35:46 +0000</pubDate>
				<category><![CDATA[HighChart]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[High Chart Demo]]></category>
		<category><![CDATA[highchart source]]></category>
		<category><![CDATA[HTML5 Chart]]></category>
		<category><![CDATA[implement highchart]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Working with high chart]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=1861</guid>

					<description><![CDATA[Introduction This tip says how to formulate our data as a High Chart. Please provide your valuable comments. 🙂 Background I am working in a project where 80% of the processes are handled in the client side itself. So I was looking for a client-side chart and High Chart satisfied my requiremetns. It is a good plugin and also easy to use. What is High Chart? High Charts is solely based on native browser technologies and doesn&#8217;t require client-side plugins like Flash or Java. Furthermore you don&#8217;t need to install anything on your server. No PHP or ASP.NET. High Charts [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>This tip says how to formulate our data as a High Chart. Please provide your valuable comments. 🙂</p>
<p><strong>Background</strong></p>
<p>I am working in a project where 80% of the processes are handled in the client side itself. So I was looking for a client-side chart and High Chart satisfied my requiremetns. It is a good plugin and also easy to use. What is High Chart? High Charts is solely based on native browser technologies and doesn&#8217;t require client-side plugins like Flash or Java. Furthermore you don&#8217;t need to install anything on your server. No PHP or ASP.NET. High Charts needs only two JavaScript files to run, the highcharts.js core and either the jQuery, MooTools, Prototype or High Charts Standalone framework. The High Charts Standalone framework is designed for those who do not already use jQuery, MooTools or Prototype in their web page and wish to use High Charts with minimal overhead. Read more here:<a href="http://www.highcharts.com/docs" target="_blank"> HIGHCHARTS, HIGHSTOCK AND HIGHMAPS DOCUMENTATION</a>.</p>
<p><strong>What you must know</strong></p>
<ol>
<li>jQuery :<a href="http://jquery.com/">jQuery</a> .</li>
<li>JavaScript :<a href="http://www.w3schools.com/js/">W3Schools.com</a>.</li>
<li>CSS 3 : <a href="http://www.w3schools.com/css/css3_intro.asp">CSS3 Introduction</a> .</li>
<li>HTML :<a href="http://www.w3schools.com/html/">HTML(5) Tutorial</a> .</li>
<li>DOM Manipulations in jQuery :<a href="http://www.tutorialspoint.com/jquery/jquery-dom.htm">jQuery &#8211; DOM Manipulation</a> .</li>
</ol>
<div><strong>Using the code</strong></div>
<p>Before you start, you need to download the necessary files from: <a href="http://www.highcharts.com/download">http://www.highcharts.com/download</a>. Once you download the files, you need to include those in your project. Or you can use the CDN also.</p>
<p>[js]<br />
&lt;script src=“http://code.highcharts.com/highcharts.js”&gt;&lt;/script&gt;<br />
&lt;script src=“http://code.highcharts.com/modules/heatmap.js”&gt;&lt;/script&gt;<br />
&lt;script src=“http://code.highcharts.com/modules/exporting.js”&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Now it is time to add a UI element in which we will generate the chart. Please assign some width to that element, so that our chart can be formulated inside that element.<br />
[html]<br />
&lt;div id=“container” style=“height: 400px; min-width: 310px; max-width: 800px; margin: 0 auto”&gt;&lt;/div&gt;<br />
[/html]</p>
<p>Now what else is pending is only to add the script that does the formulation work as in the following:<br />
[js]<br />
$(function() {<br />
    $(‘#container’).highcharts({<br />
        chart: {<br />
            type: ‘heatmap’,<br />
            marginTop: 40,<br />
            marginBottom: 40<br />
        },<br />
        title: {<br />
            text: ‘Sales per employee per weekday’<br />
        },<br />
        xAxis: {<br />
            categories: [‘Alexander’, ‘Marie’, ‘Maximilian’, ‘Sophia’, ‘Lukas’, ‘Maria’, ‘Leon’, ‘Anna’, ‘Tim’, ‘Laura’]<br />
        },<br />
        yAxis: {<br />
            categories: [‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’],<br />
            title: null<br />
        },<br />
        colorAxis: {<br />
            min: 0,<br />
            minColor: ‘#FFFFFF’,<br />
            maxColor: Highcharts.getOptions().colors[0]<br />
        },<br />
        legend: {<br />
            align: ‘right’,<br />
            layout: ‘vertical’,<br />
            margin: 0,<br />
            verticalAlign: ‘top’,<br />
            y: 25,<br />
            symbolHeight: 320<br />
        },<br />
        tooltip: {<br />
            formatter: function() {<br />
                return ‘&lt;b&gt;’<br />
                this.series.xAxis.categories[this.point.x]<br />
                ‘&lt;/b&gt; sold &lt;br&gt;&lt;b&gt;’<br />
                this.point.value ‘&lt;/b&gt; items on &lt;br&gt;&lt;b&gt;’<br />
                this.series.yAxis.categories[this.point.y]<br />
                ‘&lt;/b&gt;’;<br />
            }<br />
        },<br />
        series: [{<br />
            name: ‘Sales per employee’,<br />
            borderWidth: 1,<br />
            data: [<br />
                [0, 0, 10],<br />
                [0, 1, 19],<br />
                [0, 2, 8],<br />
                [0, 3, 24],<br />
                [0, 4, 67],<br />
                [1, 0, 92],<br />
                [1, 1, 58],<br />
                [1, 2, 78],<br />
                [1, 3, 117],<br />
                [1, 4, 48],<br />
                [2, 0, 35],<br />
                [2, 1, 15],<br />
                [2, 2, 123],<br />
                [2, 3, 64],<br />
                [2, 4, 52],<br />
                [3, 0, 72],<br />
                [3, 1, 132],<br />
                [3, 2, 114],<br />
                [3, 3, 19],<br />
                [3, 4, 16],<br />
                [4, 0, 38],<br />
                [4, 1, 5],<br />
                [4, 2, 8],<br />
                [4, 3, 117],<br />
                [4, 4, 115],<br />
                [5, 0, 88],<br />
                [5, 1, 32],<br />
                [5, 2, 12],<br />
                [5, 3, 6],<br />
                [5, 4, 120],<br />
                [6, 0, 13],<br />
                [6, 1, 44],<br />
                [6, 2, 88],<br />
                [6, 3, 98],<br />
                [6, 4, 96],<br />
                [7, 0, 31],<br />
                [7, 1, 1],<br />
                [7, 2, 82],<br />
                [7, 3, 32],<br />
                [7, 4, 30],<br />
                [8, 0, 85],<br />
                [8, 1, 97],<br />
                [8, 2, 123],<br />
                [8, 3, 64],<br />
                [8, 4, 84],<br />
                [9, 0, 47],<br />
                [9, 1, 114],<br />
                [9, 2, 31],<br />
                [9, 3, 48],<br />
                [9, 4, 91]<br />
            ],<br />
            dataLabels: {<br />
                enabled: true,<br />
                color: ‘black’,<br />
                style: {<br />
                    textShadow: ‘none’,<br />
                    HcTextStroke: null<br />
                }<br />
            }<br />
        }]<br />
    });<br />
});<br />
[/js]</p>
<p><strong>Explanation</strong></p>
<p>Now it&#8217;s time to go deeper to see what we have done. There are a few properties we have set for our chat so far. The following are what they are:</p>
<div>
<ul>
<li>Chart: This property sets the chart type and chart styles. Here in this I am using heatmap. And you can set your own style to it.</li>
<li>Title: This sets the title for our chart. You can set a meaningful title related to our chart.</li>
<li>XAxis: Here you need to bind the series of elements that all you need to come under in X axis. You can bind that to the inner property categories.</li>
<li>YAxis: Here you need to bind the series of elements that all you need to come under in Y axis. You can bind that to the inner property categories.</li>
<li>ColorAxis: This property sets the colors for the chart. You can set the min color and max color so that we can get the shadow effect.</li>
<li>Legend: This is where we can set the limitation of which quadrant we need to show the data. You can set the y value to get the values as it&#8217;s multiplied one. You can also set its alignment.</li>
<li>Tooltip: Tooltip plays a main role in this chart, when you mouse over to the specific column you can see the small pop up that shows the exact value. You can set your own style for this J</li>
<li>Series: Now it&#8217;s time to apply the data. This is where we need to do that.</li>
</ul>
</div>
<div>You can find more and do the options in this JavaScript fiddle.</p>
<p><a href="http://jsfiddle.net/Sibeeshvenu/tgzvbqxb/">Sibeeshvevenu</a></div>
<p><strong>Output</strong></p>
<p><img decoding="async" src="http://www.c-sharpcorner.com/UploadFile/65794e/working-with-chart/Images/highchart.png" alt="" width="600" height="303" /></p>
<p><strong>Points of Interest</strong></p>
<p>jQuery, CSS, HTML and HighChart.</p>
<p><strong>History</strong></p>
<p>1st Version: 08-May-2015</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/working-with-charts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
