|
ChartDirector: Error Converting argument 1 to type class DoubleArray |
Posted by Harry on Mar-21-2015 04:51 |
|
I have a CSV file that I parse and ChartDirector creates graphs.
I have an array of a variety of numbers.
ChartDirector works until one of the numbers starts with a decimal point ".978" then it causes the error in the subject. Error Converting argument 1 to type class DoubleArray.
The error happens on the layer1.addDataSet(array_name)
I have a loop that runs through the CSV file and pulls all the numbers from column 8 into "array_name". If I manually configure the loop to STOP before I hit the decimal number, the graph creates perfectly. The other values in the array are 1.012, so it seems to only have a problem with leading decimal or leading zero.
Is there any help, please?
Thanks, I've tried everything. |
Re: ChartDirector: Error Converting argument 1 to type class DoubleArray |
Posted by Peter Kwan on Mar-23-2015 23:13 |
|
Hi Harry,
For your case, the array_name should be an array of numbers. ChartDirector should support
all numbers according to your programming language. Note that ChartDirector may not
understand numbers in human language (which may just be a text string to ChartDirector).
It can only process numbers that are numbers according to the programming language.
The error message "Error Converting argument 1 to type class DoubleArray" means the
array_name is not an array of numbers. Either it is not an array, or the array contains non-
numbers according to your programming language. If ".978" is not supported, is it possible
that ".978" is not a number according to your programming language? For example, it may
be a text string and not convertible to a number according to your programming language.
If the above is the cause of the problem, you may need to convert the non-number into a
number with your own code before passing them to ChartDirector (eg. by prepending a "0"
in front if your code find out the first character is not a digit).
If you need further help, would you mind to clarify which programming language you are
using?
Regards
Peter Kwan |
|