jfreechart

How to specify the position and layout of a JFreeChart chart legend

二次信任 提交于 2019-12-04 09:17:40
问题 I am using JFreeChart to render a stacked area chart. By default, the chart legend is rendered below the plot with the elements laid out horizontally. I would like the legend to appear on the right of the plot with the elements laid out as a vertical list. Is this possible and, if so, how do I do it? 回答1: A little more time examining the API would have given me the answer: LegendTitle legend = chart.getLegend(); legend.setPosition(RectangleEdge.RIGHT); 回答2: Here is the equivalent for older

Time series chart horizontal gridlines through min/max peaks

烈酒焚心 提交于 2019-12-04 07:08:40
问题 I am using JFreeChart to plot a timeseries chart. The chart is working fine, but the gridline alignment is becoming a problem. My requirement is to show the horizontal gridlines through the peak values (i.e for the max and min value). Could you please let me know if there is any property for this, as I am getting grids randomly. 回答1: Have you considered using a Marker to highlight the min and max values? As trashgod sugested you use the Dataset to get the minimum and maximum values and then

How to create a Chart Explorer with Java and JFreeChart?

喜欢而已 提交于 2019-12-04 06:56:37
问题 I have created a Java desktop program , with the help of JFreeChart libraries. I can open a stock data file (symbol.txt) and have the program display a couple of indicators. I want to create an explorer in a new JFrame window that will open a folder with stock data files and check some indicator value. My problem is to find a way to open multiple files at once (at the user level) but process every file one after the other at the program level (open first file, check indicator, close first

jfreechart: Gantt Chart Task Label Font Size

给你一囗甜甜゛ 提交于 2019-12-04 06:41:30
问题 I put my Gantt Chart (ChartPanel) in a JScrollPane,and create a button named [zoom in]. The function for the button [zoom in] is: When I click [zoom in] button, the width of chart panel will be doubled. newSize = originalChartWidth * 2; chartPanel.setPreferredSize(new java.awt.Dimension(newSize, 1000)); After click [zoom in] button, the scroll bar of JScrollPane will be appeared. Then the user can scroll to watch the whole chart after zoom in. But there is a problem, When I double the chart

How to add a Jfreechart(pie chart) to a panel in netbeans

喜夏-厌秋 提交于 2019-12-04 06:30:17
问题 Im using netbeans gui editor and im trying to add a Jfreechart that is itself in a internal frame, and this internal frame I am wanting to add it to a panel, as you can see in this image (sorry I cant post image directly because im a newbie): http://www.flickr.com/photos/63259070@N06/6370734167/ The internal frame doesn't even show up on the panel "Estadisticas" when I run it, I think its harder because im not doing the gui by code but it shouldn't be that hard, If anyone could help me add

JFreeChart - Java Heap Space issue

时间秒杀一切 提交于 2019-12-04 06:28:42
问题 I am using JFreeChart for the first time and I am using a TimeSeriesCollection() to create a TimeSeriesChart. My reslutset from the DB query is app. aroung 1000 records. I am using org.jfree.date.time.Minute.Minute(int min.....) object to add it to a TimeSeries object. I have a JFrame on which I add the ChartPanel directly. The user will provide new input parameters and reload the chart data with new dataset. So I clean up before every reload by calling the following in a method dataset

How do I show rainfall index along with temperature on my JFreeChart TimeSeries chart?

 ̄綄美尐妖づ 提交于 2019-12-04 05:59:41
问题 Currently, my TimeSeries graph shows the temperature of a location every 2 seconds. Now, if I want to show the rainfall index along with the temperature every 2 seconds, how can I achieve it? Here is my code: import testWeatherService.TestWeatherTimeLapseService; public class graph extends JFrame implements ActionListener { private static TimeSeries series; static final int COUNT = 200; /** The Constant WINDOW. */ public static final int WINDOW = 25; TestWeatherTimeLapseService getLocData =

JFreechart Polar Chart shape annotation

折月煮酒 提交于 2019-12-04 05:42:03
问题 I am trying to color different region of a polar chart with different colors. e.g coloring the region between the angle 20 and 60 and between the radii 2 and 4. How can I do this? I was thinking of using a shape annotation and from there drawing an arc, but it seems there is no shape annotation for polar plots. Any ideas? Thank you import java.awt.Color; import java.awt.Dimension; import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; import org.jfree.chart.ChartPanel;

How would I create a JFreeChart scatterplot best fit line

三世轮回 提交于 2019-12-04 05:31:41
问题 I have an arraylist of points I want to include in a JFreeChart scatterplot. That works fine, but I now want a best fit line on it. After some searching, JFreeChart doesn't support such calculations directly, so what I want to do is calculate it myself and then stick a line into the chart manually. How do I get a line in a scatterplot? XYSeries series = new XYSeries("Data"); for (Point p : points) { series.add(p.getX(), p.getY()); } XYSeriesCollection dataset = new XYSeriesCollection(series);

JFreeChart import error

主宰稳场 提交于 2019-12-04 05:15:00
问题 Anyone can tell me where can I find the full version of JFreeChart? I downloaded the JCommon and JFreeChart as well (from the sourceforge page), but the JFreeChart contains only the jfreechart-demo.jar, so even if I correctly added the libraries in Eclipse, it doesn't work either... Many Thanks! 回答1: When unpacked, the required JAR files are in the lib directory. $ ls -ln lib total 5800 -rw-r--r--@ 1 501 20 45024 Jul 31 2014 hamcrest-core-1.3.jar -rw-r--r--@ 1 501 20 330246 Jul 31 2014