jfreechart

JFreeChart connect one point to all other around

坚强是说给别人听的谎言 提交于 2019-11-29 16:08:31
is it possible to connect one point to all others around in JFreeChart here how it should looks so all the points around connected to X point chart.setBackgroundPaint(Color.white); final XYPlot plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); Shape cross = ShapeUtilities.createDiagonalCross(3, 1); Shape somehing = ShapeUtilities.createDiamond(4); final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesLinesVisible(0, false); renderer.setSeriesLinesVisible(1,

Align bars with bar labels in Jfreechart

随声附和 提交于 2019-11-29 15:59:46
I have a problem with data labels to align with correct bar in this chart. This bar chart is generated using jfreechart in jsp. This is a pretty common mistake in JFreeChart. Each category in your chart ('abc', 'xyz' etc) has a value for each of the 6 series ('q1', 'q2' ... 'q6'), so there are 36 data items in all. But 30 of those data items are null, because you didn't specify them. JFreeChart leaves a space where the bar would appear, when the data value is null. If you really have only six data values, you should have one series with 6 categories, or one category and six series. The simple

Points on a line in jfreechart

我的未来我决定 提交于 2019-11-29 15:52:54
How to get all the points (x,y) lying on the line connecting two data-points in a chart in jfreechart ?. In a chart, as we point to the end-points of the line, it shows the x & y coordinates. Can't we get the coordinates at any point on the line (via code)? As you have two points, use the formulae of a linear equation to obtain the slope and intercept of the line. Once you have the equation, you can evaluate it at any point. Addendum: The org.jfree.data.statistics.Regression class offers some built-in support for regression analysis. 来源: https://stackoverflow.com/questions/10086306/points-on-a

How to show information of each task in Gantt chart

六眼飞鱼酱① 提交于 2019-11-29 15:43:33
i am using Jfreechart to write a projet of analysing log file, i have a problem of overvide generateToolTip ,what i want to do is when the user move his mouse to a point of a bar, then the "tip" will be show the information of this block(a subtask), i need to show the discription of each subTask. i put my exemple here, i just can show the description of the last subtask . please give me some help if you can. thanks Jiang public class Test { class MyToolTipGenerator extends IntervalCategoryToolTipGenerator { DateFormat format; private MyToolTipGenerator(String value, DateFormat format) { super

JFreeChart for dynamic xy plots in java swing gui application

≯℡__Kan透↙ 提交于 2019-11-29 15:40:39
问题 Has anyone worked with JFreeChart-open source library for plotting xy plots? Could someone post an example of how to create an xy plot dynamically with the x and y values generated from the program? And where can i get a turorial doc or something of that kind to know about how to use the JFreeChart for developing applications? Thanks in advance.. 回答1: Have you tried looking at the JFreeChart demos? See here. If you find a sample that suits what you want to do, searching for the name of the

JFreechart SeriesException

别等时光非礼了梦想. 提交于 2019-11-29 15:25:52
I am trying to plot a bar chart using timeseries by introducing the beginning and the end date , but i got a problem with the end date it indicate : Exception in thread "main" org.jfree.data.general.SeriesException : You are attempting to add an observation for the time period 4-mai-2011 but the series already contains an observation for that time period. Duplicates are not permitted. Try using the addOrUpdate() method. final TimeSeries series2 = new TimeSeries("ip max", Day.class); String datebegin = "04/29/2011 02:00:01"; String dateend = "05/04/2011 02:00:01"; DateFormat formatter; Date

How can I create a bar-chart with JFreeChart, that shortens too long bars with a visible hint?

佐手、 提交于 2019-11-29 15:01:08
问题 I want to create a bar-chart, but extraordinary high values should be shortened. An example is this image: (source: epa.gov) I hope it is clear what I want. My question is: How can I do this with JFreeChart. If it isn't possible with JFreeChart you can possibly recommend alternative open-source Java-libraries to produce such an output. 回答1: You could do it with a CombinedDomainCategoryPlot or CombinedDomainXYPlot . Set the range axis of the first plot to your cut off value and then do

目前能够找到的最有效的 JFreeChart 中文乱码解决方案

ⅰ亾dé卋堺 提交于 2019-11-29 14:55:14
由于JFreeChart组件的版本、操作平台、JDK 的设置等因素,在使用 JFreeChart 组件时可能会出现中文乱码的现象。遇到此问题时,可通过设置文字的字体来解决问题。在此提供以下两种解决此问题的方法。 一、设置主题的样式(强烈推荐) 在创建统计图表之前,创建主题样式并指定样式中的字体,通过 ChartFactory 类的 setChartTheme() 方法设置主题样式,这种方式在目前已知的所有版本的 JFreeChart 中均可使用,效果相当不错,我找了好久才找到,而且我觉得这应该是解决中文字体显示为方块的比较标准的方法之壹。 //创建主题样式 StandardChartTheme standardChartTheme = new StandardChartTheme("CN"); //设置标题字体 standardChartTheme.setExtraLargeFont(new Font("隶书", Font.BOLD, 20)); //设置图例的字体 standardChartTheme.setRegularFont(new Font("宋书", Font.PLAIN, 15)); //设置轴向的字体 standardChartTheme.setLargeFont(new Font("宋书", Font.PLAIN, 15)); //应用主题样式

Help with JFreeChart overlay

这一生的挚爱 提交于 2019-11-29 14:51:46
问题 I'm having an issue with a JFreeChart overlaid graph. I'm using JFreeChart 1.0.13. What I am trying to do seems like it was easier to do in earlier versions of JFreeChart? The graph shows a line chart and a bar chart. The data range plotted by the line chart for the Y axis is in the 0-100 range, and the axis for the bar chart is in the 0-5 range. Individually, when I lay out each chart and paint it, they look great. Here's an example: Bar Chart Line Chart But when I overlay them, the bar

Get Area or Elements in zoomed Scatterplot

被刻印的时光 ゝ 提交于 2019-11-29 13:33:31
I've got the following problem. I want to zoom-in a Scatterplot and then select all the displayed elements. It would be sufficient to somehow get the displayed area in the zoomed-in Scatterplot. From the range of this area i could determine which elements are displayed in the area and which are not. \edit: Found the Solution (Implementing AxisChangeListener Interface) import java.awt.Color; import java.awt.Dimension; import org.jfree.chart.ChartPanel; import org.jfree.chart.event.AxisChangeEvent; import org.jfree.chart.event.AxisChangeListener; import org.jfree.chart.plot.PlotOrientation;