zimozhang / charts4j

Automatically exported from code.google.com/p/charts4j
Other
0 stars 0 forks source link

DataUtil scaling produces negative values #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Just use this  line of code, and look at the result.
DataUtil.scaleWithinRange(10, 99, new double[] {3, 6, 1, 6, 6})

What is the expected output? What do you see instead?
I expect a list of values between 10 and 99. I see instead a list of
negative values.

What version of the product are you using? On what operating system?
I'm using charts4j v1.2, on a windows XP system. Java version is 1.6

Additional details : please see attached screenshot

Original issue reported on code.google.com by andrei.t...@gmail.com on 14 Apr 2010 at 7:33

Attachments:

GoogleCodeExporter commented 8 years ago
You defined a range between 10 and 90 and then supply values that are outside 
(below) that range. It is therefore to be expected that the scaled values would 
be negative. The only thing that I can think of that would help this situation 
is perhaps throwing an exception if values are supplied that are outside the 
range.

Original comment by Julien.C...@gmail.com on 7 Jan 2011 at 4:51