I am using google flot chart which displays graph on the base of the values selected by the user. Graph displays years on x-axis and prices on y-axis.
The problem is that if graph width is small it displays values properly. for example if I set width as
<div id="placeholder" style="width:500px;height:300px"></div>
But if the graph width is increased just like
<div id="placeholder" style="width:650px;height:300px"></div>
Graph show unwanted zeroes on x-axis e.g
Insted of 2010 it shows 2010.0
Insted of 2011 it shows 2011.0
Insted of 2012 it shows 2012.0
I just want to get rid of these unwanted zeroes. Google didn't help me at all and I've totally no idea for this stupid behavior of flot.
I had this problem too. I could easily fix it like this:
xaxis:
{
tickDecimals: 0
}
Looking through the doco, you might want to try setting tickDecimals
or setup a tickFormatter
for the xaxis
option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With