jfreechart

HeatMaps with JFreeChart

时间秒杀一切 提交于 2021-02-06 13:52:46
问题 I have a dataset of points (x,y) and I would like to create an heatmap of this dataset. More specifically, I would like an image in which I have lighter colors in the areas where I have a bigger concentration of points and darker where there are less points. I am using JFreeChart libraries and I found some classes for example DefaultHeatMapDataset but I am not sure how to use them in the proper way. Does anybody has a clue on how to do it? Thanks in advance! Giovanni 回答1: Use an

Minor ticks not showing up on LogAxis in JFreeChart

倖福魔咒の 提交于 2021-02-05 08:01:49
问题 I'm using JFreeChart to plot some data and using a LogAxis for the range axis. I'm stumped as to why I can't seem to get the minor ticks to show up on the axis, but the grid lines show up fine. If I don't use the LogAxis I can turn the minor ticks on and off fine using setMinorTickMarksVisible() . Example below: public ChartOne(){ XYSeriesCollection xysc = new XYSeriesCollection(); XYSeries x1 = new XYSeries("Series 1"); x1.add(0.5, 2); x1.add(1, 2.2); x1.add(2, 2.4); x1.add(10, 2.75); x1.add

JFreeChart - XYLineAndShapeRenderer getItemLineVisible() not working

此生再无相见时 提交于 2021-02-05 08:00:31
问题 I'm simulating dummy real-time data using DynamicTimeSeriesCollection, like this. During random intervals, the data being passed to the plot should 'dropout' to simulate a network connection loss. At this point, this plot should stop drawing and only start plotting the data after the dropout has subsided. I subclassed XYLineAndShapeRenderer and overrode the getItemLineVisible() method: @Override public boolean getItemLineVisible(int series, int item){ if(offline){ return false; }else{ return

Dynamic JFreeChart TimeSeries

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-05 07:57:28
问题 [EDIT] Based on this example, I am now able to collect data and display it in a chart. I don't know exactly how to integrate that code that generates the chart into my application. /** @see http://stackoverflow.com/questions/5048852 */ public class Atol extends ApplicationFrame { private static final String TITLE = "Dynamic Series"; private static final String START = "Start"; private static final String STOP = "Stop"; private static final float MINMAX = 100; private static final int COUNT =

How do I remove the points in XYLineAndShapeRenderer?

狂风中的少年 提交于 2021-02-05 07:32:28
问题 I'm making an application in Java using JFreeChart which shows an XY line chart. The problem is that it shows every point of the dataset on the lines, and I don't want to display these points. Any idea on how to remove the points or make them not visible? This is a sample screenshot: Here is the code: JFrame frame = new JFrame(); XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesPaint(0, Color.RED); renderer.setSeriesStroke(0, new BasicStroke(2.0f, BasicStroke

How do I remove the points in XYLineAndShapeRenderer?

会有一股神秘感。 提交于 2021-02-05 07:32:05
问题 I'm making an application in Java using JFreeChart which shows an XY line chart. The problem is that it shows every point of the dataset on the lines, and I don't want to display these points. Any idea on how to remove the points or make them not visible? This is a sample screenshot: Here is the code: JFrame frame = new JFrame(); XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesPaint(0, Color.RED); renderer.setSeriesStroke(0, new BasicStroke(2.0f, BasicStroke

How to create Stacked bar chart Date time Category

偶尔善良 提交于 2021-01-29 08:02:17
问题 I expect to create Status chart like this However I cant XAXis Category was rendered incorrectly. Here is my code I studied from JFreeChart - horizontal stacked bar chart with date axis private static final String STANDBY_SERIES = "STANDBY"; private static final String HEATING_SERIES = "HEATING"; private static final String HOLDING_SERIES = "HOLDING"; private static final String COOLING_SERIES = "COOLING"; private static final String LOWERING_SERIES = "LOWERING"; private static final int

JFreeChart with XYBoxAnnotation Open on One Side

↘锁芯ラ 提交于 2021-01-28 08:08:20
问题 I'm using an XYBoxAnnotation to demarcate a rectangular area on a JFreeChart. I would like one side of the box to be "open", i.e go out to infinity. I tried setting the value to Double.POSITIVE_INFINITY but this did not seem to work. I also tried setting it to Double.MAX_VALUE , with no luck either. In these cases, the annotation doesn't even show up on the plot at all. And there are no exceptions thrown. Below is a very simple version of my code in which I generate the XYBoxAnnotation and

JFreeChart displaying three dots (…) in place of the values on the X axis

六眼飞鱼酱① 提交于 2021-01-28 07:52:01
问题 I am trying to plot a simple line chart and almost everything is fine, I am populating my dataset with a simple code like this: DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(-10 , "S21" , "1000" ); dataset.addValue(-20 , "S21" , "1001" ); dataset.addValue(-25 , "S21" , "1002" ); dataset.addValue(-30 , "S21" , "1003" ); dataset.addValue(-25 , "S21" , "1004" ); ... then I create a line chart: lineChart = ChartFactory.createLineChart( "S21", "Frequency (MHz)",

How to create multiple ScatterPlot chart using createCombinedChart() on JFreeChart?

六眼飞鱼酱① 提交于 2021-01-28 07:33:23
问题 I want to create multiple ScatterPlot chart on JFreeChart and to do so I've used the function createCombinedChart() . With my current code I get multiple charts just like the CombinedXYPlotDemo1 that you can found, but those are line chart and I want them as ScatterPlot. I've found this question but after trying I can't figure out how to make it work (maybe I just don't understand how to use it) here is a sample of my code (it's very similar to the Demo code + I retrieve from my database and