Solved

JFreeChart: XYLineAndShapeRenderer with error bars

Posted on 2012-03-26
3
999 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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 will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now