jfreechart

To convert the double into date format using a class in JFreeChart

落爺英雄遲暮 提交于 2019-12-02 03:28:32
I would like to know, if it is possible to set the both parameter as date, which in this example it take the first parameter as comparable and the second as double. But i want the double to be displayed as date. Is there a class that can be used. If not Is there other way to display both as date. For instance i need both the x-axis and y-axis as date. For the data.addValue("8/4/2012" ,7.0) I want it like this ("8/4/2012 20:06:02" ,"8/5/2012") --> Is it possible with the graph below. Thank you in advanced. public class Example1 { public static void main(String args[]){ DefaultKeyedValues data =

Pan chart using mouse - Jfreechart

☆樱花仙子☆ 提交于 2019-12-02 03:10:10
Can we implement the pan functionality as a mouse drag event in JfreeChart? Right now I press CTRL and drag my mouse to pan a chart. I want to implement the pan functionality just by dragging the mouse. Is that possible ? It is apparently impossible to change the modifier key with the current JFreeChart API, as discussed here (but it is in the pipeline). However, everything is there to pan a chart programmatically, so you could try the following: Add a MouseMotionListener to your ChartPanel to track mouseDragged() events. From these events, compute the requested movement of the chart. Call

Formatting Y-axis on JFreeChart

前提是你 提交于 2019-12-02 02:55:29
问题 I have a StackedXYAreaChart similar to the one below: On the Y-axis, instead of the tick units shown ( 2.5 , 5.0 , 7.5 , 10.0 , etc.), I have the following: 100,000 , 200,000 , 300,000 , 400,000 , etc. These represent Bytes, just like the one above. My question is: is there a way I could format these tick units such that they represent Kilobytes, i.e. 100 , 200 , 300 , 400 , etc. or even Megabytes, i.e. 0.1 , 0.2 , 0.3 , 0.4 , etc.? I don't want to display 10 MB as 10,000,000 on the Y-axis.

Java Swing - JFreeChart app works slowly

断了今生、忘了曾经 提交于 2019-12-02 02:37:40
问题 I create JFreeChart program that can: move points of splines don't allow to cross black splines (boundary splines) create new splines in real-time (as Grapher) mouse wheel zoom For adding new series to dataset I use this function: public static XYSeriesCollection createSplineDataset(File[] polFiles) { dataset = new XYSeriesCollection(); for (File polFile : polFiles) { XYSeries series = new XYSeries(polFile.getName()); Scanner s = null; try { s = new Scanner(new File(polFile.getAbsolutePath())

Using JavaFX Chart in Swing Application

孤街浪徒 提交于 2019-12-02 02:29:06
问题 I have a traditional Java swing application (extends JFrame and has a main class) that uses JFreeCharts for some charting functionality. I have recently seen JavaFX and think these charts look alot refresher and will give my users a better experience. I wish to embed a JavaFX chart scene into a jInternalFrame (which in turn is called from my jDesktopPane). I have followed a simple tutorial on how to create both a javafx application and a javafx chart but I am stuck on to how I get the scene

Shift the origin from (0,0) to (0,50) in JFreeChart

房东的猫 提交于 2019-12-02 02:25:49
As shown in image the graph is from line y=0, here i want to plot a graph from y=50, how can i specify this in JFreeChart ? Here is Some Code: public class Profile { double last=0; public void generateProfile(int[] pointValue,double[] distance){ ArrayList pv=new ArrayList(); ArrayList dist=new ArrayList(); pv.add(pointValue); dist.add(distance); for(int i=0;i<pv.size();i++){ System.out.print(pointValue[i]); } for(int i=0;i<dist.size();i++){ System.out.print(distance[i]); } XYSeries series = new XYSeries("Average Weight"); for(int i=0;i<pointValue.length;i++){ if(pointValue[i]!=0){ series.add

How to draw a spiderchart above a existing JfreeChart

不问归期 提交于 2019-12-02 02:25:25
I have one a jfree chart which I can generate everytime I run the code. Now i want to override few more spider graphs on the same chart. please help me how to do that Above this i need to add one more spider chart using jfree. Here is my code for doing this chart. package com.rectrix.exide.pdfbox; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GradientPaint; import java.awt.Paint; import java.awt.PaintContext; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.geom.AffineTransform; import java.awt

Formatting Y-axis on JFreeChart

泄露秘密 提交于 2019-12-02 02:13:57
I have a StackedXYAreaChart similar to the one below: On the Y-axis, instead of the tick units shown ( 2.5 , 5.0 , 7.5 , 10.0 , etc.), I have the following: 100,000 , 200,000 , 300,000 , 400,000 , etc. These represent Bytes, just like the one above. My question is: is there a way I could format these tick units such that they represent Kilobytes, i.e. 100 , 200 , 300 , 400 , etc. or even Megabytes, i.e. 0.1 , 0.2 , 0.3 , 0.4 , etc.? I don't want to display 10 MB as 10,000,000 on the Y-axis. Thanks! trashgod The static factory createStackedAreaChart() instatiates a NumberAxis for the range. The

PlotOrientation of BoxAndWhiskerChart JFreeChart

∥☆過路亽.° 提交于 2019-12-02 02:12:52
I have a question about JFreeChart : Is it possible to change the PlotOrientation of a BoxAndWhiskerChart to horizontal? I have a histogram, and I want to add a BoxAndWhiskerChart below. I need it horizontal so I can use the same axis scale. I tried to change the orientation in the Plot and ChartPanel . trashgod @Catalina Island shows the correct way to change the PlotOrientation here , but you may run into a bug in the BoxAndWhiskerRenderer shown below for PlotOrientation.HORIZONTAL . Note the truncated line on the lower whisker. The problem is here in drawHorizontalItem() : g2.draw(new

Using JavaFX Chart in Swing Application

ぐ巨炮叔叔 提交于 2019-12-02 02:12:32
I have a traditional Java swing application (extends JFrame and has a main class) that uses JFreeCharts for some charting functionality. I have recently seen JavaFX and think these charts look alot refresher and will give my users a better experience. I wish to embed a JavaFX chart scene into a jInternalFrame (which in turn is called from my jDesktopPane). I have followed a simple tutorial on how to create both a javafx application and a javafx chart but I am stuck on to how I get the scene inside my existing code. One example I have been through shows me how to achieve this but means