jfreechart

JFreeChart with SWT

我怕爱的太早我们不能终老 提交于 2019-12-05 22:46:04
问题 I'm developping a plugin for eclipse and extending the org.eclipse.ui.views extension point. I want to use JFreeChart for drawing some graphics in eclipse view. Is it possible to use JFreeChart with SWT in eclipse view ? 回答1: Yes it is possible. The Eclipse-CS plugin does this if you want to see how it works. Here is an example screen shot: 来源: https://stackoverflow.com/questions/1499278/jfreechart-with-swt

JFreeChart : How to display hours format on the y axis

天大地大妈咪最大 提交于 2019-12-05 17:58:22
I can't find how to modify the label of the y axis. For now I use a TimeSeries with the MINUTE class, and then insert the TimeSeries into a Dataset. It look like this : final TimeSeries s1 = new TimeSeries("Importation Time", Minute.class); s1.add(new Minute(dateFinal),concateHourAndMinuteToGetASingleValue); dataset.addSeries(s1); What I would like to do is to modify the display label, and put a String (05h20 for exemple) instead of the Double value. Any help would be much appreciated :) Thank you! You will need to set a FormatOverride on the axis . Here is an example for both a NumberAxis and

JavaFX real-time LineChart with time axis

别来无恙 提交于 2019-12-05 16:38:07
问题 I'm trying to plot real-time graph, with time axis, but I have found the LineChart constructor only has the signature. LineChart(Axis<X> xAxis, Axis<Y> yAxis) I think embedding jfree chart in javafx is not a proper solution. I want a few of the jfree features in a javafx LineChart , is this possible? 回答1: Download Ensemble sample from http://www.oracle.com/technetwork/java/javafx/samples/index.html There are several examples in it for dynamic charts, e.g. "Advanced Stock Line Chart". You can

JFreeChart not appearing on JPanel - may be something to do with my code's logic

一曲冷凌霜 提交于 2019-12-05 15:24:48
This question relates to a similar question I posted on here a few days ago... Here is the interface which will show where I am wanting the chart to appear: I am wanting to display the chart on the large JPanel on the right hand side. What the chart is meant to do is to compare a particular player's stats with their country's average and the overall average (with three bars). The chart (should) know which player to show the comparison by getting the player's name from the textbox (the one with "getPlayerName" already in it. As with my similar question mentioned earlier, I have created a class

Setting different y-axis for two series with JFreeChart

不想你离开。 提交于 2019-12-05 13:27:48
I am using JFreeChart to plot two series of data (XYSeries) using a linechart. The complicating factor is that one of the data series has y-values that are typically much higher than the y-values of my second data series (let's say that the first series has y-values in the order of magnitude of millions, while the second series has y-values in the order of magnitude of hundreds). The existence of the high values in my first data set cause the range of the plot to be such that the y-values of my second data set are not comprehensible anymore. Adding a second y-axis to the plot, such that both

JfreeChart 乱码问题处理

寵の児 提交于 2019-12-05 09:43:01
在前面之间加上下面这段代码即可。 //创建主题样式 StandardChartTheme standardChartTheme=new StandardChartTheme("CN"); //设置标题字体 standardChartTheme.setExtraLargeFont(new Font("隶书",Font.BOLD,20)); //设置图例的字体 standardChartTheme.setRegularFont(new Font("宋书",Font.PLAIN,15)); //设置轴向的字体 standardChartTheme.setLargeFont(new Font("宋书",Font.PLAIN,15)); //应用主题样式 ChartFactory.setChartTheme(standardChartTheme); 为了验证,先给出没有上面代码的一串代码: import java.awt.Font; import javax.swing.JPanel; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.CategoryAxis; import

how to plot day-wise chart using Jfreechart

主宰稳场 提交于 2019-12-05 07:31:12
问题 I have data for every 15 minutes. I want to plot a graph to display values from 'date1' to 'date2'. The plot should show every 15 minutes value. But display on X-axis should show only dates. 回答1: How to create a sample XYPlot with 15 minute intervals (shown as date) 1) Create your data. XYSeries dataSeries = new XYSeries("SMS Sent"); 2) Add your axes. If you want the x-axis to show dates, use a DateAxis as the x-axis. Input your date data as a long (in milliseconds). jfreecharts will take

Plot points instead of lines? JFreeChart PolarChart

那年仲夏 提交于 2019-12-05 06:57:34
Currently, the PolarChart joins all the coordinates with lines creating a polygon. I just want it to plot each point with a dot and NOT join them together. Is this possible? I have tried using translateValueThetaRadiusToJava2D() and Graphics2D to draw circles but it's very clunky and contrived. Any suggestions welcome! So the DefaultPolarItemRenderer takes in all the polar points, converts the polar points to regular Java2D coordinates, makes a Polygon with those points and then draws it. Here's how I got it to draw dots instead of a polygon: public class MyDefaultPolarItemRenderer extends

Mapping JFreeChart Series Name to Series Index

家住魔仙堡 提交于 2019-12-05 05:55:56
I'm plotting a TimeTableXYDataset using a StackedXYBarRenderer . Unfortunately the colours of each series change on refresh. I know how to set colours using the setSeriesPaint method of the renderer, but that takes an integer series index as the argument. I create my datapoints using a string as the series name: ds.add(new SimpleTimePeriod(us.getDate(), new Date(us.getDate().getTime() + 1000*60)), us.getTotal(), us.getName())); How do I discover the mapping between series name and series index so I can call setSeriesPaint ? The easiest approach is to update a suitable Map as the data

How to make plots in Java like in Matlab (same syntax)

左心房为你撑大大i 提交于 2019-12-05 05:54:17
问题 Plotting in Matlab is very easy and straightforward. For example: figure('Position_',[100,80,1000,600]) plot(x,y1,'-.or','MarkerSize',0.2,'MarkerFaceColor','r','LineWidth',2) xlabel('Matrix1') ylabel('Matrix2') grid on hold on axis([-1,1,0,var1*1.2]) plot(x,y2,'-k','MarkerSize',0.5,'MarkerFaceColor','k','LineWidth',4) title('My plot') figuresdir = 'dir'; saveas(gcf,strcat(figuresdir, 'plotimage'), 'bmp'); I found, however, that plotting in Java is more difficult and I have to use packages