Page 1 sur 1

Comment afficher le pourcentage avec le tooltip?

Posté : 24 oct. 2014, 12:19
par lipdjo
Bonjour,

J'ai fait un graphe avec un seul axe x des abscisses et plusieurs axes y. lien : http://54.72.206.24/site/graphe_alarm_onglet_smooth.php
si sur une courbe à un instant t,sur un total de 50 unités, j'ai une quantité de 20 unités sur une courbe, sur une autre au même instant encore 20 et sur toutes les autres 0 , j'aimerais avoir au passage de la souris 50% pour la première courbe , 50% pour la deuxième et 0% pour toutes les autres.
J'aimerais savoir si c'est possible.Si oui comment?

$(function () {

$('#all').highcharts('StockChart', {


rangeSelector : {
// selected : 1
buttons: [
{type: 'day',count: 1,text: '1j'},
{type: 'day',count: 3,text: '3j'},
{type: 'day',count: 7,text: '7j'},
{type: 'month',count: 1,text: '1m'},
{type: 'year',count: 1,text: '1a'},
{type: 'all',text: 'Tout'}]

},

title : {
text : 'ALL CODEHTTP DEVICE : PC/MAC/XBOX...'
},

yAxis: [
{ //--- Premier axe y
min : 0 ,
title: {
text: 'SUCCESS(2xx)'
},
height: 200,
},

{ //--- Deuxième axe y
title: {
text: 'ALARMES 1xx'
},
height: 200,
top: 380,
},

{ //--- 3eme axe y
title: {
text: 'ALARMES 3xx'
},
height: 200,
top: 380,
},

{ //--- quatrieme axe y
title: {
text: 'ALARMES 4xx'
},
height: 200,
top: 380,
},

{
title: { //--- Quatrième axe y et etc.....
text: 'ALARMES 5xx'
},
height: 200,
top: 380,
}],


scrollbar:
{
barBackgroundColor: 'gray',
barBorderRadius: 7,
barBorderWidth: 0,
buttonBackgroundColor: 'gray',
buttonBorderWidth: 0,
buttonBorderRadius: 7,
trackBackgroundColor: 'none',
trackBorderWidth: 1,
trackBorderRadius: 8,
trackBorderColor: '#CCC'
},

legend: {
enabled: true
},

series: [{
yAxis: 0,
data: [ [......] ] ,
name : 'nombre de success' ,
color : '#00FA9A' ,
marker : {
enabled : true,
radius : 3
},
shadow : true
},{
yAxis: 1,
data: [ [........] ] ,
name : 'nombre d alarmes 1xx',
color : '#F5F5F5' ,
marker : {
enabled : true,
radius : 3
}
},
{
yAxis: 1,
data: [ [........] ] ,
name : 'nombre d alarmes 4xx' ,
color : 'red' ,
marker : {
enabled : true,
radius : 3
},
shadow : true
},{
yAxis: 3,
data: [ [......] ] ,
name : 'nombre d alarmes 5xx',
color :'Highlight' ,
marker : {
enabled : true,
radius : 3
},
shadow : true
}]

});
});

Re: Comment afficher le pourcentage avec le tooltip?

Posté : 24 oct. 2014, 14:31
par Météo Villarzel
Salut,
il est tous à fait possible de faire des calculs en PHP ou en javascript pour le tooltip

http://www.startyourdev.com/javascript/ ... operateurs

A+