Solved

JFreeChart: XYLineAndShapeRenderer with error bars

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

757 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

18 Experts available now in Live!

Get 1:1 Help Now