Highcharts – Keep tooltip showing on click

I just whipped this up. When you click a point it will persist the tooltip. It does this by cloning the tooltip svg element and appending it to the plot. Here’s a fiddle. $(function () { cloneToolTip = null; chart = new Highcharts.Chart({ chart: { renderTo: ‘container’ }, xAxis: { categories: [‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, … Read more

Rendering Highcharts using Angular js Directives

Example of pie chart: http://jsfiddle.net/csTzc/ function MyCtrl($scope, limitToFilter) { $scope.ideas = [ [‘ideas1’, 1], [‘ideas2’, 8], [‘ideas3’, 5] ]; $scope.limitedIdeas = limitToFilter($scope.ideas, 2); } angular.module(‘myApp’, []) .directive(‘hcPie’, function () { return { restrict: ‘C’, replace: true, scope: { items: ‘=’ }, controller: function ($scope, $element, $attrs) { console.log(2); }, template: ‘<div id=”container” style=”margin: 0 auto”>not … Read more

How can I get access to a Highcharts chart through a DOM-Container?

Highcharts 3.0.1 Users can use the highcharts plugin var chart=$(“#container”).highcharts(); Highcharts 2.3.4 Read from the Highcharts.charts array, for version 2.3.4 and later, the index of the chart can be found from the data on the <div> var index=$(“#container”).data(‘highchartsChart’); var chart=Highcharts.charts[index]; All versions Track charts in a global object/map by container id var window.charts={}; function foo(){ … Read more

Load data into Highcharts with Ajax

You have to use the setData methode of the series object as descriped in documentation. In your case it is options.series[0].setData(Data) And I think you have to turn your Ajax result from string to a real object/array by using JSON.parse(data). EDIT: @Ricardo Lohmann: in the ajax-call he did not specify the dataType he expects in … Read more

Highcharts percentage of total for simple bar chart

You’ll have to loop through the data and get the total, and then use the datalabel formatter function to get the percent. Example here: http://jsfiddle.net/JVNjs/319/ formatter:function() { var pcnt = (this.y / dataSum) * 100; return Highcharts.numberFormat(pcnt) + ‘%’; } edit:: updated example with axis labels: http://jsfiddle.net/JVNjs/320/ [[EDIT for comments If you are trying to … Read more