?
Solved

JFreeChart: XYLineAndShapeRenderer with error bars

Posted on 2012-03-26
3
Medium Priority
?
1,112 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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 step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

764 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