jfreechart

Java&JFreeChart - How to set a JFreeChart's ChartPanel resize with it's container ( say JPanel )?

安稳与你 提交于 2019-12-01 14:08:00
I just found that when i add a ChartPanel to a JFrame, the ChartPanel will resize to fit the frame as the JFrame dragged larger or smaller. However, when i add the ChartPanel to a JPanel, the JPanel's size( width and height ) changes to fit the JFrame as the JFrame resized. But the ChartPanel just keeps it's dimensions, leaving the enlarged JPanel a lot of empty space. How to make ChartPanel resize with it's container in GUI? Here is my sample codes : This case the chart resize with the JFrame ChartPanel chartPanel = new ChartPanel(createWhateverChart()); JFrame frame = new JFrame(); frame.add

JFreeChart strange rendering (headless RedHat)

我们两清 提交于 2019-12-01 14:06:30
I am currently migrating an application from a windows environment to a Redhat one. This application is using JfreeChart 1.0.6. It is a web app deployed in a tomcat 7 on a Redhat headless environment running on a Open-JDK6). I obtain the following PNG. It looks like handwrited chart and everything is shifted towards the top of the image. Did someone already encounter such issue and got a fix? See my chart below : image http://img194.imageshack.us/img194/4489/graph20120801105017.png See below the piece of code generating the chart : FacesContext facesContext = FacesContext.getCurrentInstance();

JFreeChart - customizing RingChart

被刻印的时光 ゝ 提交于 2019-12-01 12:57:11
I want to make two ring charts that look like the following: But the RingPlot doesn't seem very customizable. The best I could come up with is this: Any chance of doing what I want with JFreeChart? JFreeChart can do most things, this should get you started (I'll probably incorporate the center text feature into the upcoming 1.0.18 release so that the subclassing isn't necessary): package org.jfree.chart.demo; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GradientPaint; import java.awt.Graphics2D; import java.awt.Point; import java.awt.geom.Rectangle2D;

Read data from CSV file into ArrayList and display in XY Chart

…衆ロ難τιáo~ 提交于 2019-12-01 12:44:06
I would like to display a temperature curve over time. I have now read a file, which is CSV-similar, that let me know the time and the temperature indicated. Now I want to use JFreeChart to display an XY graph from the values. The original data of the file looks as follows: utc,local,celsius 2017-07-12T07:02:53+00:00,2017-07-12T09:02:53+02:00,26.25 2017-07-12T08:02:54+00:00,2017-07-12T10:02:54+02:00,26.08 2017-07-12T09:02:55+00:00,2017-07-12T11:02:55+02:00,25.78 2017-07-12T10:02:56+00:00,2017-07-12T12:02:56+02:00,25.96 2017-07-12T10:51:02+00:00,2017-07-12T12:51:02+02:00,26.14 2017-07-12T10:51

jFreeChart: DateAxis to behave like a CategoryAxis. Only discrete datevalues to be printed

馋奶兔 提交于 2019-12-01 12:32:41
I have a TimeSeries Chart with a XYdataset which has the milliseconds of each dates. Now I want to have a chart that only displays each date one time on the axis, no matter what the range of dates is. I already got it so far, that only the date is printed, not the time (via setNumberFormatOverride() method). What I have now, is this: alt text http://dl.getdropbox.com/u/1144075/Bildschirmfoto%202010-08-05%20um%2016.51.39.JPG What I want, is this: alt text http://dl.getdropbox.com/u/1144075/Bildschirmfoto%202010-08-05%20um%2016.54.54.JPG This is a snippet of my code. also, the setLabelAngle()

How add more than one line at a freechart Java?

最后都变了- 提交于 2019-12-01 12:11:57
I did a Java application and need to add a graphics to that. I could do this, but I can only add a product (line) to each graph. I wish I could add more. Here is my code String query="select date,price from produtcs where idProduct like 'Prod1'"; JDBCCategoryDataset dataset = new JDBCCategoryDataset (CriaConexao.getConexao(),query); JFreeChart chart = ChartFactory.createLineChart(Record of Price", "Date", "Price", dataset, PlotOrientation.VERTICAL, false, true, true); BarRenderer renderer = null; CategoryPlot plot= null; renderer=new BarRenderer(); ChartFrame frame = new ChartFrame("Record of

JFreeChart StackedXYAreaRenderer causes “crimp” in chart

眉间皱痕 提交于 2019-12-01 12:03:35
I'm using JFreeChart to show a stacked line chart of two sets of data over time, in this example dogs and cats . import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import javax.swing.JFrame; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.DateAxis; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.StackedXYAreaRenderer; import org.jfree.data.time.Minute; import org.jfree.data.time.TimeTableXYDataset;

Generating a standard deviation plot from a row in a JTable

∥☆過路亽.° 提交于 2019-12-01 12:00:51
I am trying to create a JTable that I can be able to click on a row and it will display a standard deviation curve. Here is what my JTable looks like right now. So for example, the standard deviation for the string screen saver, action->login, login->disclaimer, ok would look like this (I plotted it in excel) So my question is #1 is this possible and #2 if so then how? trashgod ChartFactory.createHistogram() with an IntervalXYDataset such as HistogramDataset might be a suitable choice. HistogramDemo1 , seen among the statistical charts in the JWS demo , is an example. You can determine which

How add more than one line at a freechart Java?

别来无恙 提交于 2019-12-01 11:54:29
问题 I did a Java application and need to add a graphics to that. I could do this, but I can only add a product (line) to each graph. I wish I could add more. Here is my code String query="select date,price from produtcs where idProduct like 'Prod1'"; JDBCCategoryDataset dataset = new JDBCCategoryDataset (CriaConexao.getConexao(),query); JFreeChart chart = ChartFactory.createLineChart(Record of Price", "Date", "Price", dataset, PlotOrientation.VERTICAL, false, true, true); BarRenderer renderer =

Multiple OHLC datasets in one image

不想你离开。 提交于 2019-12-01 11:50:19
How can I chart multiple datasets in one image using JFreeChart ? Essentially I want to chart a stock's price and it's moving average line in one image. I've tried getting the XYPlot and adding the second dataset, but it does not work. DefaultOHLCDataset dataset = new DefaultOHLCDataset(symbol, items); DefaultOHLCDataset dataset2 = new DefaultOHLCDataset(symbol, evs); JFreeChart chart2 = ChartFactory.createHighLowChart( symbol, "minutes", "prices", dataset, true); chart2.getXYPlot().setDataset(1, dataset2); Or is there any specialized java library for stock trading application that's easier to