Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XYPlot doesn't handle noDataMessage correctly #36

Open
matinh opened this issue Feb 10, 2015 · 3 comments
Open

XYPlot doesn't handle noDataMessage correctly #36

matinh opened this issue Feb 10, 2015 · 3 comments

Comments

@matinh
Copy link

matinh commented Feb 10, 2015

The XYPlot class has a method render() that states in the JavaDoc:

return A flag that indicates whether any data was actually rendered.

There is a check if the dataset is emptyOrNull. Right after this the foundData-flag is set to true, followed by conditional returns that skip rendering because of missing axes and the like. In this case, the returned value should IMHO still be false, as nothing was rendered.

@matinh
Copy link
Author

matinh commented Feb 11, 2015

Thinking a bit further about it, the plot would actually need info from the renderer if any data was rendered or not. Imagine a dataset with only null-values. The renderer wouldn't render anything but the plot couldn't know and would thus return foundData == true.
So should the XYRenderer.drawItem() method possibly return a boolean to indicate if anything was rendered, just like the draw() method from the plot? What do you think?

@jfree
Copy link
Owner

jfree commented Feb 11, 2015

It’s a tricky one, because if the emptyOrNull() check returns false then there is data, so in a sense we shouldn’t display the ‘no data message’ even if nothing is rendered for other reasons. Maybe there is a case for another message to be displayed when there is data but for some reason rendering is not possible.

Best regards,

David

On 11 Feb 2015, at 09:32, Martin Höller notifications@github.com wrote:

Thinking a bit further about it, the plot would actually need info from the renderer if any data was rendered or not. Imagine a dataset with only null-values. The renderer wouldn't render anything but the plot couldn't know and would thus return foundData == true.
So should the XYRenderer.drawItem() method possibly return a boolean to indicate if anything was rendered, just like the draw() method from the plot? What do you think?


Reply to this email directly or view it on GitHub.

@matinh
Copy link
Author

matinh commented Feb 12, 2015

Well, your arguments are valid. Still, if nothing is rendered it's going to be an empty chart and a message could make sense. Maybe we really would need another message.
On the other hand, the current JavaDoc suggests something different. It clearly says "A flag that indicates whether any data was actually rendered", which might also happen with not emtpy datasets.
So I at least agree with you at least, that this one is a tricky one ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants