jfreechart

Android XYPlot set width of line, size of point and disable legend

不羁岁月 提交于 2019-12-24 06:38:40
问题 I'm trying to change width of line in XYPlot and size of point, any suggestion? And another question - how i disable legend to SimpleXYSeries? Set to null cause Error. 回答1: I'm trying to change width of line in XYPlot and size of point. Any suggestion? As shown here, you can alter the line thickness using either setSeriesStroke() or setBaseStroke() in your chosen renderer. Assuming XYLineAndShapeRenderer , you can change the rendered Shape using the approach shown here. How I disable the

How to get Y value from X value in JFreeChart

こ雲淡風輕ζ 提交于 2019-12-24 06:37:52
问题 I'm using JFreeChart to draw chart. I have XYSeries with points (0, 0), (1, 2), (2, 5) and I want to read Y value for let's say x=1.5. Is it possible to read value for points which are not in XYSeries? I couldn't find similar topic. 回答1: This is not supported directly. It does not make sense in many cases: There simply is no data available for x=1.5 . The value there could be 1000.0, or -3.141. You don't know. However, you're most likely looking for a linear interpolation. The pragmatic

Series lines not showing up properly in JFreeChart

大憨熊 提交于 2019-12-24 06:26:30
问题 I am working with this plot where the data and the lines are not showing properly. When it has more data and while zooming it with mouse wheel, the lines are not showing properly. I tried placing polygon box around series line thinking that the series will show up like the XYTextAnnotation , but it's not working. import java.awt.Color; import java.awt.BasicStroke; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.annotations.*; import org.jfree.data

How to deal with SpiderWebPlot in JFreeChart?

好久不见. 提交于 2019-12-24 01:46:51
问题 Discovering JFreeChart, I hit a problem using SpiderWebPlot. This is what I have today My values are {2, 2, 1.5} By default max value is set to the max value of my dataset (here 2) but I want to set it to 5 which as you can see it did but it did not draw the lines for the value between 2 and 5. How can I progamatically draw them ? UPDATE AFTER COMMENT : SpiderWebPlot plot = (SpiderWebPlot)chart.getPlot(); plot.setMaxValue(5.00); plot.setHeadPercent(0.01); return chart; I am using JFreeChart

JFreeChart & iText : black image when creating pdf

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 00:55:56
问题 I am using JFreeChart 1.0.9 to create a chart, and iText 1.3.1 to display this chart in a PDF file. To do so, I am creating a JFreeChart, and then converting it to a byte array : final TimeSeriesCollection dataset = new TimeSeriesCollection(); final TimeSeries s1 = new TimeSeries("Series 1", Minute.class); s1.add(new Minute(0, 0, 7, 12, 2003), 1.2); s1.add(new Minute(30, 12, 7, 12, 2003), 3.0); // 12h30 => value = 3 s1.add(new Minute(15, 14, 7, 12, 2003), 8.0); final TimeSeries s2 = new

JFreeChart heap space

蓝咒 提交于 2019-12-24 00:39:51
问题 I'm just wondering if there's a way to stop JFreeChart thrashing the heap, or an alternative that doesn't do it so much. SpreadsheetDate , Millisecond and Day are taking up about 70 MB of the heap, but the garbage collector is probably getting thrashed too. They are, collectively, the biggest users of heap space in my app. There's also TimeSeriesDataItem which uses 12 MB. This is with recording things every 200 milliseconds or so, for all charts. I'm also updating / storing a fair few

How to set JFreeChart to not order DataSet?

偶尔善良 提交于 2019-12-23 23:11:47
问题 I have small project which makes a graph plot of a data in database. One record in DB is like this: ID, Name, Xcoord, Ycoord For example, I've added 10 points coordinates of which is more or less like this: 1st(1:1) 2nd(2:2) 3rd(3:3) 4th(4:4) ... 10th(10:10); After that I want to add one more point 11th(5,7:5,7) , and 10th must connect with 11th. So line must go leftwards. Now XYPlot sorts my XYDataset and 11th point gets plotted in between of 5th and 6th Points, and I don't want that. Can

JFreeChart : How to draw the moving average over a OHLC chart

拟墨画扇 提交于 2019-12-23 18:23:01
问题 I am trying to overlay a moving average over an OHLC chart but it does not seem to work. I provide two critical functions of the code : private static OHLCDataset createPriceDataset(String filename) { OHLCSeries s1 = new OHLCSeries(filename); try { BufferedReader in = new BufferedReader(new FileReader(filename)); DateFormat df = new SimpleDateFormat("yyyyMMdd"); String inputLine; in.readLine(); while ((inputLine = in.readLine()) != null) { StringTokenizer st = new StringTokenizer(inputLine, "

How To Add a jFreeChart to a jPanel in a jFrame?

最后都变了- 提交于 2019-12-23 17:25:30
问题 I've looked at lots of questions/answers that are similar and found one which is exactly the same, but I have not managed to get my program to work. The output is a blank JFrame, it should output a JFrame with a graph(100x200) inside it. Here is the contained code: package my.Project; import java.awt.BorderLayout; import java.awt.Dimension; import javax.swing.JPanel; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree

How to draw moving and Running sine wave chart using JFree chart in java?

夙愿已清 提交于 2019-12-23 17:07:37
问题 I m using JFreeChart to draw Running or Moving Sine Wave in java with netbeans. I write code for it , but it does not like moving or running sine wave graph. So if you have any idea regarding that then suggest me. My code is below import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JPanel; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org