views:

146

answers:

2

Using series.add(180, 1); produces a perfectly valid chart like this (little red dot at the bottom with some PolarItemRenderer Mods!)

alt text

but using series.add(3000/(6000/360), 1); produces this beast:

alt text

I assume it's because somewhere, 6000/360 = 16.6... is getting rounded? How can I stop this happening? Thanks :)

+7  A: 

You are using integer division. 3000/(6000/360) = 3000 / 16 = 187. I don't know what you are trying to achieve, but use doubles instead of integers if you don't want the integer division.

Petar Minchev
A: 

Now realising that this was a bit of a stupid question! This was how I did it (maybe not the best way, but it works!)

double doub= ((double)6000)/((double)360);

series.add(6000/doub, 1);
billynomates
-1. Someone else answered your issue and two hours later you answer it yourself and accept your own answer?You should accept the other answer and write this one as a comment on it.
Don Roby
My answer specifically shows how to solve the issue with casting. I up-voted Peter, don't worry!
billynomates
Also, you can't add formatted code in comments. :P
billynomates