jfreechart

Java tooltip with image in JAR file

强颜欢笑 提交于 2019-12-01 11:10:29
问题 I'm using JFreeChart where I customized the chart's tooltip by implementing the XYToolTipGenerator interface. As the generateToolTip() method is supposed to return a String, here is what I did to show images in the tooltip: @Override public String generateToolTip(XYDataset dataset, int series, int item) { (...) return "<html><body><img src=\"file:resources/img/image.png\"></body></html>"; } While this works perfectly when executing directly from my IDE (Eclipse), it obviously fails when being

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

落花浮王杯 提交于 2019-12-01 10:52:07
问题 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

how to display customized values on a bar in bar chart using jfree chart?

99封情书 提交于 2019-12-01 10:49:10
By using StandardCategoryItemLabelGenerator() Iam able to display the exact range axis value on a bar, Now my problem is I dont want to display the range axis value instead I want to display some other value of that bar How I can achieve that? for (String IDS : idMap.keySet()) { List<String> listValues = idMap.get(IDS); if(listValues != null && listValues.get(1) != null) { dataSet.setValue(Double.valueOf(listValues.get(1)), "", IDS); } } JFreeChart chart = ChartFactory.createBarChart3D("", "", "Time taken ", dataSet,PlotOrientation.VERTICAL, true, true, false); chart.setTitle(new org.jfree

Dynamic tool tip generator - Jfreechart

一个人想着一个人 提交于 2019-12-01 10:40:40
I am generating a dynamic chart (XYLineChart) using jFreeChart and I have a field which is not included in the dataset. The field is generated dynamically. I want to include that in my tooltip. Is there any possibility I can do it ? Here is the flow of the program: Create Chart using an empty dataset. Set chartPanel. (I guess here is the place where we define the TooltipGenerator). Receive dynamic data from socket. Add data to the dataset. ( Here is the only place where I have the data which I need to have in my tooltip text). Refresh Chart. trashgod The name to be displayed is not included

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

我的未来我决定 提交于 2019-12-01 09:53:59
问题 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

JFreeChart: overlapping bars in XY chart that have the same value

人盡茶涼 提交于 2019-12-01 09:45:28
问题 I have this problem where 2 bars from a different series overlap each other when they have the same value. And I would like 1 of both on top of the other. Unfortunately, I want the one that is now in the back, up front : I already tried changing the order of the category expression, but to no avail. Anyone can tell me how I can get the orange bar on top of the blue one please ? 回答1: You may try DatasetRenderingOrder: XYPlot plot = jFreeChart.getXYPlot(); plot.setDatasetRenderingOrder

JFreeChart and Y-axis Units

吃可爱长大的小学妹 提交于 2019-12-01 09:15:25
I have a StackedXYAreaChart that looks like the following: How do I format the Y-axis units so that they are evenly spaced out and are displayed at certain intervals? For example, instead of displaying units in increments of 1 (e.g. 0, 1, 2, 3, ... 100 ), I want to display units in increments of 10 or 25 (e.g., 0, 25, 50, 75, 100 ). Thanks! I found a solution to my own question. I'm using a CustomTickUnit that formats numbers and adds units to the suffix, e.g. 1000000 becomes 1 GB . I set up my tick units with the following code, which spaced them out evenly and formatted them appropriately so

how to display customized values on a bar in bar chart using jfree chart?

℡╲_俬逩灬. 提交于 2019-12-01 07:53:03
问题 By using StandardCategoryItemLabelGenerator() Iam able to display the exact range axis value on a bar, Now my problem is I dont want to display the range axis value instead I want to display some other value of that bar How I can achieve that? for (String IDS : idMap.keySet()) { List<String> listValues = idMap.get(IDS); if(listValues != null && listValues.get(1) != null) { dataSet.setValue(Double.valueOf(listValues.get(1)), "", IDS); } } JFreeChart chart = ChartFactory.createBarChart3D("", ""

JFreeChart StackedXYAreaRenderer causes “crimp” in chart

你说的曾经没有我的故事 提交于 2019-12-01 07:48:25
问题 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

JFreeChart - XYBarChart Show Separate Bars for Each Series

冷暖自知 提交于 2019-12-01 07:34:44
I'm creating a XYBarChart using JFreeChart and adding multiple series to it. Currently for a given x-value and different Y-values from the series, all of them are getting stacked on top of each other. Would be possible to show each series as a different bar for a given x-value? Edit : I'm posting the relevant section of my code that is used to create the chart for your reference. Note that I cannot use CategoryDataset because this does not provide zooming capabilities on the Domain Axis. This is an essential requirement for my implementation. XYSeriesCollection intervalXYDataSet = new