We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi All, I'm relatively new to processing and can do some of the basics. I'm trying to do something a little more complex and hitting the a snag: I'm getting an error NumberformatException: For input string "Terraced House" I really don't know how to solve this. My code is below. My overall aim is to create a entry box for the user to select the area of the country they require and see what types for properties over a period of months/years. If you need me to post any more information please let me know.
import org.gicentre.utils.stat.*; // For chart classes.
XYChart scatterplot;
// Loads data into the chart and customises its appearance.
void setup()
{
size(500,250);
textFont(createFont("Arial",11),11);
// Both x and y data set here.
scatterplot = new XYChart(this);
// Load in data from a file
// (first line of file contains column headings).
String[] data = loadStrings("sample_blpu_inserts.csv");
float[] changed_date = new float[data.length-1];
float[] insert_count = new float[data.length-1];
String [] description = new String[data.length -1];
for (int i=0; i<data.length-1; i++)
{
String[] tokens = data[i+1].split(",");
changed_date[i] = Float.parseFloat(tokens[1]);
insert_count[i] = Float.parseFloat(tokens[2]);
}
scatterplot.setData(changed_date,insert_count);
// Axis formatting and labels.
scatterplot.showXAxis(true);
scatterplot.showYAxis(true);
scatterplot.setXFormat("0000");
scatterplot.setXAxisLabel("\nTime line "+
"(date");
scatterplot.setYAxisLabel("Number of inserts\n");
// Symbol styles
scatterplot.setPointColour(color(180,50,50,100));
scatterplot.setPointSize(5);
}
// Draws the scatterplot.
void draw()
{
background(255);
scatterplot.draw(20,20,width-40,height-40);
}
csv lines CHANGED_DATE,INSERT_COUNT,DESCRIPTION,AUTH_CODE,AUTH_NAME 02/02/2015,3,Terraced House,4625,SOLIHULL 02/02/2015,28,Terraced House,3715,RUGBY 02/02/2015,17,Semi-detached House,2720,RICHMONDSHIRE 02/02/2015,3,Residential,1520,CASTLE POINT 02/02/2015,3,Dwellings,1165,TORBAY 02/02/2015,4,Terraced House,3325,SOUTH SOMERSET
Answers
You'll get a better response if you format your code:
http://forum.processing.org/two/discussion/8045/how-to-format-code-and-text
And if you mention which library you are using the subject itself (to attract knowledgeable people).