Solved

JFreeChart: XYLineAndShapeRenderer with error bars

Posted on 2012-03-26
3
1,018 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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 …

860 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