javascript - Format point value in hightcharts -


i have graph 2 line series. points in each series percent them database in format : 0.24 24% , 0.02 2% ... there method multiply value 100 directly in graph options ? try use pointformat , pointformatter test isn't succesfull...

my graph configuration :

options.evolres.chart = {     renderto: 'container_graph',     backgroundcolor: '#f1f1f1',     width: $('#container_graph:parent').width(),     height: 700 };  options.evolres.title = {     text: 'title',     x: -20 };  options.evolres.yaxis = [     {         title: {             text: 'result'         },         labels: {             format: '{value}%'         },         min: 0,          max: 100,         tickinterval: 10                 } ];    options.evolres.xaxis = {     categories: ['t1','t2','t3','t4','t5','t6'],     labels: {         rotation: -45,         y: 20     } };  options.evolres.tooltip = {     crosshairs: true,     shared: true,     valuedecimals: 2 };  options.evolres.series = [     {         name: 'result x',         data: [0.2, 0.85, 0.63, 0.05, 0.26, 0.85],         yaxis: 0,         type: 'areaspline',         tooltip: {             valuesuffix : '%'         }     },{         name: 'result y',         data: [0.25, 0.35, 0.73, 0.05, 0.16, 0.25],         yaxis: 0,         type: 'areaspline',         tooltip: {             valuesuffix : '%'         }     } ] 

try out this

  tooltip: {         formatter: function () {             var s = '<b>' + this.x + '</b>';              $.each(this.points, function () {                 s += '<br/>' + this.series.name + ': ' +                     this.y *100;             });              return s;         },         shared: true     } 

sample fiddle :)


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -