How do I turn off the default formatting of a numeric field?

In our data file we have an attribute "Year" that we want to group on. However, in the visualization the Year gets treated as a numeric value and commas are inserted into it for display (i.e "2005" --> "2,005"). Is there any way to fix this display issue?

The best way to fix this is to add formatting headers to the CSV file, so the year is not formatted using the default number format.

Assuming your data file looks like:

Category,Item,Year,# Units
Finance,Stocks,2005,1000
....

Then, the solution is to add the special "#header" as the first line of your CSV file, and define two lines of headers, one for the name of each column, the other for the format. So your data file would look like:

#header:name,format
Category,Item,Year,# Units
,,####,"#,##0"
Finance,Stocks,2005,1000
....

This would then format Year without any commas, but format # Units with a comma to separate the thousands.

For a full example of using CSV headers, check out the Specifying Display Formats in CSV example located in the examples/applet/data/2-csv-with-headers directory. The ads.csv file located in this directory shows a sample data file. The formats used are the ones provided by the DecimalFormat Java class. You can find full documentation on these formats at:

http://java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html