Click here to Skip to main content
15,889,878 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used high chart for column graph.in Y axis it is showing percentage value.I don't want to show max and min value 100 and 0 respectively.
Posted
Comments
Afzaal Ahmad Zeeshan 26-Sep-14 8:32am    
Have you even looked at the API to edit the code?
Nihar Ranjan Sahu 26-Sep-14 8:46am    
Yes but its not working.I am using the below code.


$(function () {

$('#Occupancy_Phy').highcharts({

chart: {
type: 'column'

},
draw: { legend: 'none' },
title: {
text: 'Physical',
style: {
color: '#000'
}
},
xAxis: {
categories: [<%=StateCategories %>],
title: {
text: null
},
gridLineWidth: 0,
minorGridLineWidth: 0
},
yAxis: {
min: 0,
title: {
text: null
},
gridLineWidth: 0,
minorGridLineWidth: 0, max: 100
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">Amount: </td>' +
'<td style="padding:0">{point.y}% </td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {

column: {
pointPadding: 0.2,
size: '100%',
borderWidth: 0,
events: {
legendItemClick: function () {
return false;
}
}
},
allowPointSelect: false,
legend: {
enable: false
},
series: {
pointWidth: 15,
colorByPoint: true,
legend: false,
dataLabels: {
enabled: true
}

}
},
navigation: {
buttonOptions: {
enabled: false
}
},
series: [{ <%=StateSerices %> }]
});
});

1 solution

Inside the Tooltip of your code, remove this line of code.

HTML
<td style="padding:0">{point.y}% </td>


This is the code, where the y axis is being populated with the percentage. Once you remove it, or just remove the {point.y}% part, it will work and you won't see the percentage again.

This code (I believe) creates the percentage and prints on the screen. So if you want to write it anywhere else, you can use it again to print the value.

However, it is a good approach to read the API of the library, rather than just the existing or provided code by the library developers. In their API they explain the code very well. So before asking a question, atleast try to Google out the question once. 99% problems are already solved.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900