<?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/category/products/highchart/feed/" rel="self" type="application/rss+xml" />
	<link>https://mail.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Tue, 10 Jul 2018 11:50:43 +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>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>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>
		<item>
		<title>Create a Combo Chart and Make Your Chart Draggable</title>
		<link>https://mail.sibeeshpassion.com/create-a-combo-chart-and-make-your-chart-draggable/</link>
					<comments>https://mail.sibeeshpassion.com/create-a-combo-chart-and-make-your-chart-draggable/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 29 Apr 2015 20:34:03 +0000</pubDate>
				<category><![CDATA[HighChart]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[Combo Chart]]></category>
		<category><![CDATA[Draggable Chart]]></category>
		<category><![CDATA[HTML5 Chart]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=1821</guid>

					<description><![CDATA[Introduction Hi all, this article explains how to create a Combo chart. As you all know, the word combo is short for combination, in this case it is a combination of chart types. Which means we can have multiple chart types in one chart. Background For the past few months I have been working in a dashboard application, so I encountered a situation to work with a Combo chart in my application. As I began working with the Combo chart, when I finished the work I got a new requirement that a Pie chart must be draggable in the chart [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong><br />
Hi all, this article explains how to create a Combo chart. As you all know, the word combo is short for combination, in this case it is a combination of chart types. Which means we can have multiple chart types in one chart.</p>
<p><strong>Background</strong></p>
<p>For the past few months I have been working in a dashboard application, so I encountered a situation to work with a Combo chart in my application. As I began working with the Combo chart, when I finished the work I got a new requirement that a Pie chart must be draggable in the chart area. So I thought of working on that and share it with you all.</p>
<p><strong>What we need first</strong></p>
<p>Include the necessary JavaScript files and UI elements as follows.</p>
<div>
<div class="dp-highlighter">
<div class="bar"></div>
<ol class="dp-c">
<li class="alt">&lt;script src=<span class="string">&#8220;http://code.highcharts.com/highcharts.js&#8221;</span>&gt;&lt;/script&gt;</li>
<li>&lt;script src=<span class="string">&#8220;http://code.highcharts.com/modules/exporting.js&#8221;</span>&gt;&lt;/script&gt;</li>
<li class="alt">&lt;div id=<span class="string">&#8220;container&#8221;</span> style=<span class="string">&#8220;min-width: 310px; height: 400px; margin: 0 auto&#8221;</span>&gt;&lt;/div&gt;</li>
<li>&lt;div id=<span class="string">&#8220;container2&#8221;</span> style=<span class="string">&#8220;width: 150px; height: 150px; margin: 0 auto; position:absolute; top: 120px; left: 150px;&#8221;</span>&gt;&lt;/div&gt;</li>
</ol>
</div>
</div>
<p><strong>Combo chart configuration</strong></p>
<p>Our next step is to configure the Combo chart. You can determine the configuration here.</p>
<div>
<div class="dp-highlighter">
<div class="bar"></div>
<ol class="dp-c">
<li class="alt">$(function()</li>
<li>{</li>
<li class="alt">    $(<span class="string">&#8216;#container&#8217;</span>).highcharts({</li>
<li>        title: {</li>
<li class="alt">            text: <span class="string">&#8216;Worked hours in a week&#8217;</span></li>
<li>        },</li>
<li class="alt">        xAxis: {</li>
<li>            categories: [<span class="string">&#8216;Apples&#8217;</span>, <span class="string">&#8216;Oranges&#8217;</span>, <span class="string">&#8216;Pears&#8217;</span>, <span class="string">&#8216;Bananas&#8217;</span>, <span class="string">&#8216;Plums&#8217;</span>]</li>
<li class="alt">        },</li>
<li>        series: [{</li>
<li class="alt">            type: <span class="string">&#8216;column&#8217;</span>,</li>
<li>            name: <span class="string">&#8216;Monday&#8217;</span>,</li>
<li class="alt">            data: [3, 2, 1, 3, 4]</li>
<li>        }, {</li>
<li class="alt">            type: <span class="string">&#8216;column&#8217;</span>,</li>
<li>            name: <span class="string">&#8216;Tuesday&#8217;</span>,</li>
<li class="alt">            data: [2, 3, 5, 7, 6]</li>
<li>        }, {</li>
<li class="alt">            type: <span class="string">&#8216;column&#8217;</span>,</li>
<li>            name: <span class="string">&#8216;Wednesday&#8217;</span>,</li>
<li class="alt">            data: [4, 3, 3, 9, 0]</li>
<li>        }, {</li>
<li class="alt">            type: <span class="string">&#8216;column&#8217;</span>,</li>
<li>            name: <span class="string">&#8216;Thursday&#8217;</span>,</li>
<li class="alt">            data: [4, 3, 3, 9, 0]</li>
<li>        }, {</li>
<li class="alt">            type: <span class="string">&#8216;column&#8217;</span>,</li>
<li>            name: <span class="string">&#8216;Friday&#8217;</span>,</li>
<li class="alt">            data: [4, 3, 3, 9, 0]</li>
<li>        }, {</li>
<li class="alt">            type: <span class="string">&#8216;spline&#8217;</span>,</li>
<li>            name: <span class="string">&#8216;Thursday&#8217;</span>,</li>
<li class="alt">            data: [3, 2.67, 3, 6.33, 3.33],</li>
<li>            marker: {</li>
<li class="alt">                lineWidth: 2,</li>
<li>                lineColor: Highcharts.getOptions().colors[3],</li>
<li class="alt">                fillColor: <span class="string">&#8216;white&#8217;</span></li>
<li>            }</li>
<li class="alt">        }]</li>
<li>    });</li>
<li class="alt">    $(<span class="string">&#8216;#container2&#8217;</span>).highcharts({</li>
<li>        chart: {</li>
<li class="alt">            backgroundColor: <span class="string">&#8216;rgba(0,0,0,0)&#8217;</span></li>
<li>        },</li>
<li class="alt">        title: {</li>
<li>            text: <span class="keyword">null</span></li>
<li class="alt">        },</li>
<li>        exporting: {</li>
<li class="alt">            enabled: <span class="keyword">false</span></li>
<li>        },</li>
<li class="alt">        credits: {</li>
<li>            enabled: <span class="keyword">false</span></li>
<li class="alt">        },</li>
<li>        series: [{</li>
<li class="alt">            type: <span class="string">&#8216;pie&#8217;</span>,</li>
<li>            name: <span class="string">&#8216;Total&#8217;</span>,</li>
<li class="alt">            data: [{</li>
<li>                name: <span class="string">&#8216;Monday&#8217;</span>,</li>
<li class="alt">                y: 13,</li>
<li>                color: Highcharts.getOptions().colors[0]</li>
<li class="alt">            }, {</li>
<li>                name: <span class="string">&#8216;Tuesday&#8217;</span>,</li>
<li class="alt">                y: 23,</li>
<li>                color: Highcharts.getOptions().colors[1]</li>
<li class="alt">            }, {</li>
<li>                name: <span class="string">&#8216;Wednesday&#8217;</span>,</li>
<li class="alt">                y: 19,</li>
<li>                color: Highcharts.getOptions().colors[2]</li>
<li class="alt">            }, {</li>
<li>                name: <span class="string">&#8216;Thursday&#8217;</span>,</li>
<li class="alt">                y: 19,</li>
<li>                color: Highcharts.getOptions().colors[2]</li>
<li class="alt">            }, {</li>
<li>                name: <span class="string">&#8216;Friday&#8217;</span>,</li>
<li class="alt">                y: 19,</li>
<li>                color: Highcharts.getOptions().colors[2]</li>
<li class="alt">            }],</li>
<li>            size: 90,</li>
<li class="alt">            showInLegend: <span class="keyword">false</span>,</li>
<li>            dataLabels: {</li>
<li class="alt">                enabled: <span class="keyword">false</span></li>
<li>            }</li>
<li class="alt">        }]</li>
<li>    });</li>
<li class="alt">    $(<span class="string">&#8220;#container2&#8221;</span>).draggable();</li>
<li>});</li>
</ol>
</div>
</div>
<p>Please note that I have given the Pie chart as a separate chart so that we can make it draggable as follows.</p>
<div class="dp-highlighter">
<div class="bar"></div>
<ol class="dp-c">
<li class="alt">$(<span class="string">&#8220;#container2&#8221;</span>).draggable();</li>
</ol>
</div>
<p>You can determine the demo here: <a href="http://jsfiddle.net/sibeeshvenu/oc1mn8ru/4/">http://jsfiddle.net/sibeeshvenu/oc1mn8ru/4/</a></p>
<p><strong>Output</strong></p>
<p>Now if you run this configuration you will get output as follows.</p>
<p><img decoding="async" src="http://www.c-sharpcorner.com/UploadFile/65794e/combo-chart-and-make-chart-as-draggable/Images/comboart1.png" alt="" width="600" height="333" /></p>
<p>Now the interesting fact is, you can drag the pie to where ever you want it.</p>
<p><img decoding="async" src="http://www.c-sharpcorner.com/UploadFile/65794e/combo-chart-and-make-chart-as-draggable/Images/comboart2.png" alt="" width="600" height="325" /></p>
<p><strong>Conclusion</strong></p>
<p>I hope you liked this article. Now please share your thoughts and suggestions. It matters a lot.</p>
<p>Kindest Regards,</p>
<p>Sibeesh Venu<br />
<a href="http://www.c-sharpcorner.com/UploadFile/65794e/combo-chart-and-make-chart-as-draggable/www.sibeeshpassion.com">Sibeesh Passion</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/create-a-combo-chart-and-make-your-chart-draggable/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
