This is a migrated thread and some comments may be shown as answers.

How do you change the categories on the Axis?

1 Answer 119 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Mar
Top achievements
Rank 1
Mar asked on 13 Oct 2011, 08:41 PM
I am working off the index.html chart file from the examples folder I downloaded. I want to change the dates on the bottom of the chart from numbers to numbers/letters. I tried entering in the code below and got a syntax error. I'm guessing I can't enter in letters?  
categoryAxis: {
                            categories: [2005, 2006, 2007, 2008, 2009]

to 

categoryAxis: {
                            categories: [1st Year, 2nd Year, 3rd Year, 4th Year, 5th Year]

Any help is appreciated

Thanks

1 Answer, 1 is accepted

Sort by
0
qwerty
Top achievements
Rank 1
answered on 31 Oct 2011, 05:09 AM
try this
categoryAxis: {
                            categories: ['1st Year',' 2nd Year', '3rd Year', '4th Year', '5th Year']


because javascript interpreter think about    1st  is variables ,but the naming of variables can not start with numeric.
Tags
Charts
Asked by
Mar
Top achievements
Rank 1
Answers by
qwerty
Top achievements
Rank 1
Share this question
or