hi at everybody,
i don't know if this is the best way, but
i need to plot a bubble chart with the smallest ball on top respect the big one.
To do this i try to preorder the data and after that i add on the dataset(defaultxyzdataset), but i obtain the same result.
So my question is exist some method to order the dataset, or it is the correct way to do this?
Many thanks at all for the reply.
re-order the dataset
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: re-order the dataset
There is no JFree functionality that would allow the ordering of an existing, unordered XYDataset, or its series, not to mention ordering of an XYZDataset by the Z value.
It should be straightforward to get the data out of an XYZDataset, for example as an array of double[3][itemCount] where [0][itemIndex] is the x value, [1][itemIndex] the y value and [2][itemIndex] the z value of the respective item. Sorting this array by the z value should also be straightforward. You would have to make sure that the value with the smallest z value has the highest item index.
Since that did not work, your sorting algorithm is apparently broken.
It should be straightforward to get the data out of an XYZDataset, for example as an array of double[3][itemCount] where [0][itemIndex] is the x value, [1][itemIndex] the y value and [2][itemIndex] the z value of the respective item. Sorting this array by the z value should also be straightforward. You would have to make sure that the value with the smallest z value has the highest item index.
Since that did not work, your sorting algorithm is apparently broken.
Re: re-order the dataset
oh many many thanks for the hint!!!
i will try to implements this, because yesterday i had try to presort the value and after put that in the dataset with no success.
again many thanks, it is beautiful to have the possibility of hint from other expert people about this powerful library!!!
i will try to implements this, because yesterday i had try to presort the value and after put that in the dataset with no success.
again many thanks, it is beautiful to have the possibility of hint from other expert people about this powerful library!!!