jfreechart

Gradient fill under the line XYPlot chart in JFreeChart?

人走茶凉 提交于 2020-01-16 00:58:08
问题 Can I add the gradient filling to the XYPlot chart in JFreeChart? Example below: 回答1: I haven't tried it, but org.jfree.chart.renderer.xy.StackedXYAreaRenderer has a setSeriesFillPaint() method and java.awt.GradientPaint implements the Paint interface. 回答2: I found this works on an XYAreaRenderer plot.getRenderer().setSeriesPaint(seriesIndex, new GradientPaint(0.0f, 0.0f, new Color(255, 0, 0), 0.0f, 0.0f, new Color(0, 255, 255))); 回答3: Just share working code - fixed bugs in other publicly

JFreeCharts - Making a chart with X as category and Y as TimeInterval

我是研究僧i 提交于 2020-01-15 10:14:48
问题 I am trying to find out apis in JFreeChart, that would allow me to build up a chart, where a long the X axis I would have categories and the Y axis interval values corresponding to times. Y axis should represent time. X axis category. This is similar to a google calendar scenario, where in the X axis such as day of the week. And on the Y axis, you can write what you do along certain regions of time. The following JFREE chart, represents what I would like to represent. However, my Y axis is

JFreeChart how to draw ordered lines

独自空忆成欢 提交于 2020-01-15 05:30:46
问题 I am currently using JFreeChart scatter graph to display a number of points. When I use the scatter graph to draw lines it draws them in the wrong order for example: the ordered list (2,3),(2,5),(3,4) is the desired order to be printed. JFreeChart takes this and draws the line in this order (2,5),(2,3),(3,4). Is there an alternative chart type I could use that could display this differently or is there a way I can override their default ordering system? Thanks. 回答1: An XYSeries is typically

How do I properly add a MouseHandler to my JFreeChart-FX to drag the chart from left to right

╄→尐↘猪︶ㄣ 提交于 2020-01-14 19:52:09
问题 I managed to create a Candlestick Chart using JFreeChart-FX and display it using the fxgraphics2d API. But I am pretty much confused on how to enable any interaction with my chart and need some help to this. I'd be very grateful for any help in the right direction. I started with this example to get up my initial Chart and altered it so that it uses my data. Then I use a custom Canvas , which utilizes fxgraphics2d to make the JPanel component accessable as a node for my JavaFX applicaiton. So

How to display only “last 24 hours” from a “last 72 hours” JFreeChart TimeSeries

蓝咒 提交于 2020-01-11 10:33:11
问题 I wrote these 2 lines of code to create a chart using an XYDataset : final XYDataset dataset = new TimeSeriesCollection(myInfo.getSeries()); JFreeChart timechart = ChartFactory.createTimeSeriesChart(myInfo.getName() + " CPU (last 72h)", "", "CPU %", dataset, false, false, false); These lines created this nice "last 72h" chart: This is how I added the information to build this chart (this piece of code can run multiple times): SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM

Generating a standard deviation plot from a row in a JTable

时光怂恿深爱的人放手 提交于 2020-01-11 07:45:11
问题 I am trying to create a JTable that I can be able to click on a row and it will display a standard deviation curve. Here is what my JTable looks like right now. So for example, the standard deviation for the string screen saver, action->login, login->disclaimer, ok would look like this (I plotted it in excel) So my question is #1 is this possible and #2 if so then how? 回答1: ChartFactory.createHistogram() with an IntervalXYDataset such as HistogramDataset might be a suitable choice.

JFreeChart Bar Graph Labels

百般思念 提交于 2020-01-11 05:57:29
问题 I have made it possible for value labels to appear on top of the bar in JFreeChart. However, it would look better if the labels are inside the bars. How do I make this work? The image below shows what I wanted the graph to look like. 回答1: I used the following code to make it work: StackedBarRenderer renderer = new StackedBarRenderer(false); renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setBaseItemLabelsVisible(true); chart.getCategoryPlot().setRenderer

JFreeChart Bar Graph Labels

大憨熊 提交于 2020-01-11 05:57:12
问题 I have made it possible for value labels to appear on top of the bar in JFreeChart. However, it would look better if the labels are inside the bars. How do I make this work? The image below shows what I wanted the graph to look like. 回答1: I used the following code to make it work: StackedBarRenderer renderer = new StackedBarRenderer(false); renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setBaseItemLabelsVisible(true); chart.getCategoryPlot().setRenderer

JFreeChart with dual x-axis

☆樱花仙子☆ 提交于 2020-01-10 04:11:21
问题 I'd like to ask if it is possible to have a time series chart with dual x-axis (or y-axis but because it is a time series dataset I focus on dual x-axis). I have two data files in which the measurements were made during a minute or a whole day. As a result I can't have one x-axis. So, one solution is to transmorm one data file to the format of the other or to have two different x-axis. The second solution is it possible to be done? I found JFreeChartDualAxisDemo but it isn't what I want.

How to use jfreechart in unix

耗尽温柔 提交于 2020-01-07 09:43:56
问题 I had a java program which uses jfreechart API to create histogram, which is running fine in windows system but the same is not running in unix system. It is saying NoClassDef exception. I have added the jfreechart jar to the lib in Unix... Do I need to do anything else to make it run? 回答1: NoClassDef exceptions are really only thrown for the fact the class simply doesn't exist. Are you running the application through an IDE? If so, make sure the jar is in the classpath. If not, make sure you