Marco102
(Marco Ferretti)
October 1, 2013, 2:59pm
1
Hi
I am having difficulties formatting xasis values with vaadin charts for vaadin6.
As far as I undestand :
XAxis xaxis = new XAxis();
xaxis.setTitle("Year");
xaxis.getLabels().setFormatter("function() {return Math.floor(this.value/1) + ''}");
should format the values in x axis as 2009, 2010 etc.
What I get instead is 2,009 2,010 etc.
What am I missing ?
Petrus1
(Petrus Viljoen)
October 1, 2013, 6:43pm
2
Think your browser is using your Locale settings…
Not a Javascript expert but I think you can force it to do normal decimal convertion using:
“function() {return Math.floor(this.value/1).toString(10); }”
Dont think you need the /1 btw…
Marco102
(Marco Ferretti)
October 2, 2013, 7:46am
3
Hi Petrus,
just tested your solution but it didn’t change the behavior; on a side note … i tested the js on a plain html file and it works as expected
Marco102
(Marco Ferretti)
October 2, 2013, 8:15am
4
FYI : it works … just some kind of weird cache problem