jfreechart

Setting Range for X,Y Axis-JfreeChart

淺唱寂寞╮ 提交于 2019-11-26 21:00:33
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.setRange(0.00,1.00); domainAxis.setTickUnit(new NumberTickUnit(0.1)); final NumberAxis rangeAxis = new NumberAxis("Y-Axis

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

百般思念 提交于 2019-11-26 20:59:02
I'm trying to add a legend under the plot in scattered chart as shown below. Anyone knows if this is possible? Before: After: 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 StandardXYItemLabelGenerator("{0} {1} {2}", format, format); renderer.setBaseItemLabelGenerator(generator); renderer

Invalid or corrupt JAR File built by Maven shade plugin

徘徊边缘 提交于 2019-11-26 19:49:29
问题 After adding the Maven jFree dependency to my existing application, I'm not able to execute the created jar. The only error message I get is the following: java -jar target/com.company.product-1.0.0-SNAPSHOT.jar Error: Invalid or corrupt jarfile target/com. company.product-1.0.0-SNAPSHOT.jar The complete pom.xml looks like this: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=

How can I fix this code so I can add this JFreeChart to a panel

倾然丶 夕夏残阳落幕 提交于 2019-11-26 18:40:06
问题 I am trying to make a chart that is embedded specifically in a panel on a JInternalFrame ; it is a pie chart from the library JFreeChart . I want to embed the chart on a panel which goes by the variable name jpPaneles , but it has proven to be impossible. This is really crucial for my project, so if anyone has the time to help me out, I would greatly appreciate it. I am working in NetBeans GUI editor. Here is the code and you can see I try to add frame1 to a panel. import org.jfree.chart

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

血红的双手。 提交于 2019-11-26 18:01:22
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 this data for JFreeChart charts, if that makes any difference. I am also open to using any library. Thank you

Changing shape of single point in JFreeChart XYPLot

℡╲_俬逩灬. 提交于 2019-11-26 17:56:51
I am using JFreeChart XYPLot for plotting a XYData set with different labels . I have created different XYSeries objects for different labels so that I can have different colors for different labels . Now I need to require the change the shapes of specific points(test data) in each XYDataSeries as below . In the above plotting , there are two different XYSeries with blue and red color . Out of these two I need to change the shapes of some points(test data) to X instead of circle . Is it possible in JFreeChart. This post explained on how to do it for whole data set , but I want to change only

JFreechart Loop through polar chart sectors

南笙酒味 提交于 2019-11-26 17:52:28
问题 I have the following code to method loop throug the sectors of a polar plot, but the method is being called several times, as if it was in a loop. I want to create a series on each sectors of the plot, the sector being defines by the axis tick unit and the angle tick unit. When I comment out the polarDataset.addSeries(new XYSeries("test")) and the for loop for this new series, the problem disappears, making me believe there might be something up with this. This is a continuation of a question

JFreeChart: Dispay mouse coordinates near to mouse as hints (on mouse move)

大兔子大兔子 提交于 2019-11-26 17:33:53
问题 What I want is, on a XYPlot, the coordinates of mouse displayed as hint near to mouse, when (the mouse) move on chart only! In another words, when the crosshair moves to another point, the positioning of the coordinate values would move too, following the crosshair. Also 1 horizontal line and 1 vertical line will be drawn, that intersects specifically at the point that mouse is over on. Is this possible? Until now I can get the coordinates and printed on console using ChartMouseListener and

Setting Different Color to particular Row in Series-JFreeChart

拈花ヽ惹草 提交于 2019-11-26 16:57:06
问题 I have array of elements and they belong to one Series,with these elements I calculated Centroids. Problem is when I display them with "ScatterPlot" I need to show "Array Elements" with "One Color" and the Centroid of these points in "Different Color". import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Shape; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax

Java JFreeChart Category Step Chart horizontal (image to explane)

杀马特。学长 韩版系。学妹 提交于 2019-11-26 16:57:05
问题 i need the following type of chart: It should be a "steped" line chart with categories on the vertical axis, like this: I found this example of an Category Step Chart, but it the orientation is not right for my purpose. http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/category/CategoryStepRenderer.html All i have done so far is this, but as you can see the red line does not fit to the orientation of the chart(should be horizontal): The corresponding code to this: