jfreechart

How to deal with 2 TimeSerieses with the exact values?

纵然是瞬间 提交于 2019-12-14 02:53:37
问题 I'm creating a TimeSeries chart with 2 TimeSeries es in it (i.e. A Dataset holding 2 TimeSeries objects. It happens that both TimeSeries objects holds the same exact values and they are simply overlapping but that's not clear to the client as he only sees the result color or mixing the colors of both TimeSeries objects ! So he's seeing that the chart is displaying 2 sets of data, while only one line is drawn ! Is their a build-in way to deal with that ? How would you fix that ? Personally I'm

Get plots from CombinedDomainXYPlot (and remove them)

我是研究僧i 提交于 2019-12-14 02:19:58
问题 Is there a way to get plot list added to CombinedDomainXYPlot if I don't keep any references to them? I'd like to get there plots, work with them and possibly remove them from the compined plot. This is example code for adding plots to CombinedDomainXYPlot: // axis DateAxis domainAxis = new DateAxis("Date"); // plot container CombinedDomainXYPlot plotCombined = new CombinedDomainXYPlot(domainAxis); // plot 1 XYPlot plot1 = new XYPlot(); plot1.setDomainAxis(domainAxis); plotCombined.add(plot1)

how to get image map from Jfree chart's Image

允我心安 提交于 2019-12-14 01:31:26
问题 In bar chart, I want to use hyperlinks for every color(or segment). To make this I need to use Image MAP (using Jfree chart). My code is creating image through Jfree chart, but I also want individual hyperlink with every color code. Can you please advice how I can get coordinates from Jfree chart's image based on color code or row key or column key. public class Demo { public static void main(String arg[]) throws IOException{ DefaultCategoryDataset result = new DefaultCategoryDataset();

Adding custom font JFreeChart

自古美人都是妖i 提交于 2019-12-14 01:26:04
问题 I am trying to add the following Font to my JFreeChart title: http://www.urbanfonts.com/fonts/Back_to_Bay_6.htm Trying to achieve this with the code: InputStream is = new FileInputStream("backtobay.ttf"); java.awt.Font customFont = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, is); customFont = customFont.deriveFont(24f); chart.getTitle().setFont(customFont); Ends up with a normal font: Any ideas why? Is it possible it has something to do that I am running Mac? public class

Why javafx based charts take more memory as compared to swing based charts

风流意气都作罢 提交于 2019-12-13 23:54:28
问题 CandleStick charts have been developed both using JavaFx(using CSS and extending XYChart and creating candle using Region and line) and JFree charting library. But memory usage in Jfree(400 Mb) is far less comapred to javafx(2.5Gb). (Data is taken after runing both for 2 hours using JConsole) AdvCandleStickChartSample /** * Copyright (c) 2008, 2012 Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. */ import javafx.application.Application; import javafx

Intersection points of series

心已入冬 提交于 2019-12-13 22:36:52
问题 Is it possible to find the intersection points of two series in JFreeChart? The chart series that are intersecting don't have any common points among them. So, the intersection point needs to be calculated for two series that happens to intersect each other on the graph. List<Line> lineOne = one.getItems(); List<Line> lineTwo = two.getItems(); for (Line i : lineOne) { for (Line j : lineTwo) { if (i.intersection(j) != null) { System.out.println(i.intersection(j)); } } } The code above is what

My JFrame is not showing output of the dial

故事扮演 提交于 2019-12-13 21:24:36
问题 This is my DialPlot class: public class Demo { private DefaultValueDataset dataset = new DefaultValueDataset(0); private ChartPanel buildDialPlot(int minimumValue=0,int maximumValue,int majorTickGap) { DialPlot plot = new DialPlot(dataset); plot.setDialFrame(new StandardDialFrame()); plot.addLayer(new DialValueIndicator(0)); plot.addLayer(new DialPointer.Pointer()); int redLine =maximumValue / 5 + 10; plot.addLayer(new StandardDialRange(maximumValue, redLine, Color.blue)); plot.addLayer(new

Is it possible to have two (X and Y) CategoryAxes in JFreeChart?

一曲冷凌霜 提交于 2019-12-13 18:48:11
问题 I am creating a correlation matrix in JFreeChart. I'm nearly done except that both axes have number values (i: say 1 to 20). I use DefaultXYZDataset and a customized BlockRenderer with a overridden PaintScale Class. The value z itself is represented by the colour of a filled rectangle at the positions (x,y) in ([1 to 20], [1 to 20]). Is it possible to replace the axis labels on X and Y by a String e.g. names[i]? To achieve this, have I to change the NumberAxes into CategoryAxes? Both axes

Setting series visiblity to False also hides it from the legend

佐手、 提交于 2019-12-13 18:17:23
问题 I am using JFreeChart. When i click on a Legend item i have put a listener. In the listener i make the series that was clicked invisble. But as a side effect the series also vanishes from the Legend. I do not want the series to vanish from the legend. What can i do so that i can show/hide series on the plot but not affect the legend. Setting the Legend to be fixed using plot.setFixedLegendItems(list) cause other mouse effects to stop working (on mouse over of data point the series line

How to change from line chart to bar chart

时光毁灭记忆、已成空白 提交于 2019-12-13 18:15:11
问题 I have this line chart and want to make it a bar chart, but I'm new to Java and am not knowing if it possible since the x-axis is TimeSeries . This is the code I have that visualizes the line chart: public class Time { private static Time INSTANCE; public static boolean isInitialized = false; private Marker marker; private Long markerStart; private Long markerEnd; private XYPlot plot; long last_lowerBound; long last_upperBound; @Inject public Time() { } Composite comp; TimeSeriesCollection