jfreechart

Increase Size of Dot in Graph

╄→尐↘猪︶ㄣ 提交于 2019-12-13 17:26:34
问题 I am creating a scatter plot graph using JFreeChart. Sometimes I only have a few points, and the dots are so small. They are almost invisible? Does anyone know how to increase the size of the dots? Sorry if this seems trivial, I am new to JFreeChart. Thanks 回答1: The OverlaidXYPlotDemoTZ class at this link: http://www.jfree.org/phpBB2/viewtopic.php?t=5068&highlight=xydotrenderer demonstrates how to do this. 来源: https://stackoverflow.com/questions/4879362/increase-size-of-dot-in-graph

Jfreechart optimize X axis labels

删除回忆录丶 提交于 2019-12-13 17:19:12
问题 In JFreechart I have an X axis with dates (and times). How can I ask JFreechart to optimize them and make the most out of it? Right now it contains more label than the space and all the labels gets converted into '...'. It is totally fine if not all ticks will have labels, but I want as much as can be (if they fit and can be displayed fully). How can I achieve this? UPDATE1: Here is the complete minimal source to reproduce the truncated labels. (also updated the screenshot). JFreechart does

Update transparancy of jFreeChart in real time with JSlider

♀尐吖头ヾ 提交于 2019-12-13 17:11:48
问题 I would like to ask a follow up question to this Q&A question (How can I update a JFreeChart's appearance after it's been made visible?) from @trashgod. I am trying to give the user a JSlider to control the transparency of the graphs. I added a JSlider and a ChangeListener to repaint whenever there is a JSlider change. slider.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { chartPanel.repaint(); } }); However, the transparency is not updated until

Append PDF at the available space of another PDF file

本秂侑毒 提交于 2019-12-13 16:18:06
问题 Viral Patel's tutorial on how to merge and split PDF files is useful. Unfortunately, I need something more than merging the files but appending a PDF to another PDF. I am generating reports and one component is a graph using JFreeCharts. The graph I make is turned into PDF and read again by the merge code. Let us say I have main.pdf for the text and tables PDF and chart.pdf for the latter. I am certain that main.pdf has an extra space that another figure can fit into which is chart.pdf and I

How to add JFreeChart library to JDK? Error: package org.jfree.chart does not exist

痴心易碎 提交于 2019-12-13 16:17:04
问题 I'm starting with Java after some experience with other languages. For all of them I have been using Atom code editor. And so I have managed with Java but recently I have found out that I need to use an external library JFreeChart. I am using JDK 8 to run Java on cmd (Windows) and I'm not using any IDE. I tried so far: javac -cp "lib/*" ./Test.java with jfreechart-1.0.19.jar and jcommon-1.0.23.jar in lib folder. Using Maven with pom.xml: <project xmlns="http://maven.apache.org/POM/4.0.0"

jFreeChart: How to map String values to axis?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 15:33:10
问题 I am plotting frequency in Hz, using the TimeSeriesChart. So far so good. But I need to add a second Y (value) axis that would represent musical tones. I need the ticks to be represented by String values (C#9,A4 and so on), so I figured out I should use SymbolAxis. The problem is I need to map the string tick values to exact number values, such as: A4->440, A#4->466.164, B4->493.883, C5 ->523.251..... So it won't be linear nor logarithmic. How can I do that? Thanks. (v1.0.17) 回答1: I answered

Stacked Bar Chart with percentage composition inside the Bar and total above the Bar in JFreeChart

笑着哭i 提交于 2019-12-13 15:26:46
问题 I am trying to create a Stacked Bar Chart. My requirement is I need percentage composition inside the bar and total count on top of the Bar. Please suggest solutions. My Requirement: Sample : http://www.jfree.org/jfreechart/api/javadoc/images/StackedBarRenderer3DSample.png I want percentage composition inside the bar and total composition on the top of the bar. 回答1: It's not clear what you are doing now, but using a StackedBarRenderer with setRenderAsPercentages(true) will display the

JFreeChart TimeSeries Chart remove days with no value

扶醉桌前 提交于 2019-12-13 13:11:42
问题 Is there a simple way to remove days with no value? Here is some of my data 12-04-2012 => 15 13-04-2012 => 12 15-04-2012 => 10 16-04-2012 => 5 In chart 14-04-2012 is painted. I mean, theres a longer line between 13-04 and 15-04. Is it possible to have equal gaps between values? 回答1: Are you using an TimeSeries (org.jfree.data.time.TimeSeries )? if so consider using a CategoryDataset (org.jfree.data.time.TimeSeries) private static CategoryDataset createDataset() { DefaultCategoryDataset

Changing the colors of Gantt renderer

你说的曾经没有我的故事 提交于 2019-12-13 08:24:49
问题 I want to change the colors of the renderers in my chart. I'm using JFreeChart in the same line. I want to have different collors according to the task description. The problem is I keep having the same color in a line. package testJFreeChart; import java.awt.Color; import java.awt.GradientPaint; import java.awt.Graphics2D; import java.awt.Paint; import java.awt.geom.Rectangle2D; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List;

How can JFreeChart print a scatter point directly on the x axis?

北慕城南 提交于 2019-12-13 07:16:48
问题 I try to make a scatter chart but the data point is not exactly at the (2,0) coordinate and only partly visible. The image shows the generated output from JFreeChart: http://i.stack.imgur.com/oGpZW.png But it should be like this (made with GIMP): http://i.stack.imgur.com/dqrnh.jpg Does anybody know how to do it? thanks for any help!!! 回答1: For anybody else, here is the solution, which didn't satisfy me completely but is acceptable: http://i.stack.imgur.com/70TbB.png The interesting lines of