Solved

JFreeChart: XYLineAndShapeRenderer with error bars

Posted on 2012-03-26
3
1,065 Views
Last Modified: 2012-03-26
Attached is some code (SSCCE, except you need jfreechart jars), borrowed and then modified from the JFreeChart site. I want to display error bars along with the data but can't get them to show.
What do I need to do?

http://www.jfree.org/jfreechart/download.html
XYLineAndShapeRendererDemo.java
0
Comment
Question by:allelopath
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
gudii9 earned 500 total points
ID: 37766476
The first problem, at least, is a bug in an optimisation introduced in JFreeChart 1.0.6, where the renderer tries to process only the items that are visible in the chart (which can save a lot of processing if the data items are ordered by x-value).

The problem is that the drawSeriesLineAsPath option assumes that the renderer will be passed the 0 and N-1 items. With the optimisation, that doesn't actually happen when the plot is zoomed in. The quick fix is to call state.setProcessVisibleItemsOnly(false) in the renderer's initialise() method. I'll try to find a fix that will retain the optimisation.

http://www.java2s.com/Questions_And_Answers/JFreeChart/Renderer/XYLineAndShapeRenderer.htm
http://www.jfree.org/phpBB2/viewtopic.php?p=72791
http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/xy/XYErrorRenderer.html
0
 
LVL 1

Author Comment

by:allelopath
ID: 37766498
Also, I should use XYErrorRenderer.
0
 
LVL 1

Author Comment

by:allelopath
ID: 37766794
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question