jfreechart

Changing the shapes of points in scatter plot

烂漫一生 提交于 2019-11-26 10:36:27
I have thousands of points to Plot on a JFreeChart scatter plot. The problem right now is that my program is plotting points with "squares", but I need some help on how to change the Shape of points from "squares" to "dots/circles". Any help would be appreciated. // * I am using ShapeUtilities,but its not changing the shape of point to "DaigonalCross" when I am Using for XYItemRenderer/XYDotRenderer--Any corrections please if anythng wrong in the code .. * /// import java.awt.Color; import java.awt.Dimension; import java.awt.Shape; import java.util.*; import javax.swing.JPanel; import org

Abnormal Behaviour of the Zoom In and Zoom Out Functionality of the JFreeChart?

馋奶兔 提交于 2019-11-26 10:03:00
问题 I have observed that the functionality of the \"Zoom-In\" and \"Zoom-out\" was implemented quite different than expected.Like for example when i do one step \"Zoom-out\" and then again after one step back of \"Zoom-In\". I couldn\'t see the Original graph again. I don\'t see \"Zoom-In\" and \"Zoom-out\" functionality of JFreechart to be in the sync. public class ChartPanelDemo { private static final String title = \"Historical Data Graph\"; private ChartPanel chartPanel = createChart();

Logarithmic Axis Labels/Ticks Customization

旧街凉风 提交于 2019-11-26 09:57:17
问题 I am using the JFreeChart API to generate some chart in my Java application. In one of my charts, I try to use the LogAxis object to make my y-axis a log-scale axis (A in the figure) by the following code: LogAxis logAxis = new LogAxis(\"Price($)\"); logAxis.setMinorTickMarksVisible(true); logAxis.setAutoRange(true); xyplot.setRangeAxis(logAxis); Then I got a y-axis in log-scale with ticks like 10^n (like figure A). I want to make it like B, which is more intuitive to the user, and each

JFreeChart PolarPlot: mathematical orientation

元气小坏坏 提交于 2019-11-26 09:13:20
问题 I\'d like to create a polar plot where the data is plotted in mathematical orientation (thus, the series starts and the east and continues counter-clockwise). The default behavior of JFreeChart\'s PolarPlot is to start north and continue the series clockwise. Is there any support for this built in the PolarPlot class? I know how to transform the data to reach the goal, but this approach is rather cumbersome, since I\'d need to adapt the angle labeling too. 回答1: As an aside, org.jfree.chart

Using JFreeChart Scatter Plots is there a Way to Subdivide Styles for Data Sets?

吃可爱长大的小学妹 提交于 2019-11-26 08:38:06
问题 I am using JFreeChart to render a scatter plot with a couple thousand data points. I control the appearance/style of each ScatterPlotDataset by attaching a suitable XYLineAndShapeRendererper to each data set; eg. points in data set 1 appear as circles and points in data set 2 appear as squares. I would like the user to be able to dynamically assign a sub-style per point in each data set; eg. if the data set were books then the user might wish to color fiction blue and nonfiction red. Is there

How do I rotate tick mark labels on the domain of a number axis in JFreeChart?

末鹿安然 提交于 2019-11-26 08:30:27
问题 Just like is being done in the following example, I want the tick mark labels on the domain of chart to be rotated 45 degrees as the are in this chart: http://left.subtree.org/2007/08/14/rotate-labels-jfreechart/ The difference is, I want to do this on a scatter plot with a numeric axis. I can\'t find an equivalent to setCategoryLabelPositions() in the class NumberAxis. 回答1: The method setVerticalTickLabels() may be an alternative. If not, I don't see any choice but to override

JFreechart draw arc on chart

雨燕双飞 提交于 2019-11-26 07:49:32
问题 I have 2 questions 1)I am trying to draw an arc on an XYplot using the shape annotation. I used the XYLine annotation to draw a line and I want the arc to start where the line ends. I am having some issues with the parameters.I want the arc to have a height of 17, width 44, and start at the point(3.0, 17) of the plot(this is where the line ends). But the code below does not work. Can someone please tell me what is wrong with the code? Arc2D.Double arc = new Arc2D.Double(3.0, 16.9, 44.0, 17.04

Is it possible to add Legend to the plot in JFreeChart?

一个人想着一个人 提交于 2019-11-26 07:47:39
问题 I\'m trying to add a legend under the plot in scattered chart as shown below. Anyone knows if this is possible? Before: After: 回答1: Extending StandardXYItemLabelGenerator is often a useful approach, but the supplied constructors may suffice. For this generator, the MessageFormat ArgumentIndex values correspond to the series name , domain and range . NumberFormat format = NumberFormat.getNumberInstance(); format.setMaximumFractionDigits(2); // etc. XYItemLabelGenerator generator = new

Setting Range for X,Y Axis-JfreeChart

孤街醉人 提交于 2019-11-26 07:47:08
问题 Any suggestions over how to set Range for X-Axis and Y-Axis. My \"X-Axis\" Range is from \"0.00 to 1.00\" with difference of \"0.05\". I mean 0.00 0.05 0.10 0.15.....0.90 0.95 1.00 My \"Y-Axis\" Range is from \"0.0 to 1.0\" with difference of \"0.1\". I mean 0.0 0.1 0.2 0.3 0.4.........0.9 1.0 I tried doing this Way, but it\'s not reflecting on the Graph; I don\'t know how to apply it to ChartFactory.createScatterPlot() . final NumberAxis domainAxis = new NumberAxis(\"X-Axis\"); domainAxis

Converting a JFreeChart TimeSeries series with Day data to Week or Month data?

天涯浪子 提交于 2019-11-26 06:09:24
问题 I realize this may be a silly question, and I know it could be done by determining what week or month each data point is in, etc. but, I\'m looking for a way to avoid coding that. If it\'s been done in a library (presumably all the gotchas gotten) I would rather use that. The raw data is stored in Excel spreadsheets, but I cannot manipulate the spreadsheets directly. I could make a copy and manipulate that if it\'s the only solution, but this would be the last resort. I am currently using