javascript - Add Series value in legend for pie charts -



javascript - Add Series value in legend for pie charts -

using highcharts.js - want add together series value legend , don't think need utilize label formatting function ( tried using ). here code have unable see charts below code. pretty sure doing little mistake. can please point out doing mistake. $(function () {

$(document).ready(function () { // build chart $('#container').highcharts({ chart: { plotbackgroundcolor: null, plotborderwidth: null, plotshadow: false }, title: { text: 'browser market shares @ specific website, 2014' }, tooltip: { pointformat: '{series.name}: <b>{point.percentage:.1f}%</b>' }, plotoptions: { pie: { allowpointselect: true, cursor: 'pointer', datalabels: { enabled: false }, showinlegend: true } }, legend: { enabled: true, floating: true, align: 'left', verticalalign: 'middle', labelformat: ' {series.name} + ' ' + {point.percentage:.1f}' , borderwidth: 0 }, series: [{ type: 'pie', name: 'browser share', data: [ ['firefox', 45.0], ['ie', 26.8], { name: 'chrome', y: 12.8, sliced: true, selected: true }, ['safari', 8.5], ['opera', 6.2], ['others', 0.7] ] }] }); }); });

figured myself. have utilize labelformatter. here code.

legend: { layout: 'vertical', enabled: true, floating: true, align: 'right', verticalalign: 'middle', labelformatter: function() { homecoming this.name + ' ' +this.percentage; } }

javascript highcharts

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -