jfreechart

JFreeChart scaling of Boxplots with several Categories

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i am currently working on a java-based project using JFreeChart to display boxplots. My Problem is how to display a chart containing boxplots for a CategoryDataset with about 20 Categories and 5+ Series. Currently if the preferred size of the ChartPanel is not set, the Legend, Labels and Annotations are readable but the Boxplots are too small. Or the size of the ChartPanel is set so that the Boxplots have an acceptable size but then the legend, labels and annotations are horizontally stretched. My question is, how to correctly scale the

Jfreechart - Refresh a chart according to changing data

匿名 (未验证) 提交于 2019-12-03 01:30:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to know how to refresh a chart if we want to change "in live" some piece of data. I mean for instance, I have a chart with a TaskSeries which appears on 3 years and I would like to change 3 years by 5 years. I want the chart to change immediately. Is there some kind of update chart or something like that ? I know that you could say "get your TaskSeries, do your changes and it will be refreshed automatically" but my TaskSeries are generated and I cannot easily change these ones. That's why I would like to find a way to

JFreeChart - How to show real-time on the X-Axis of a TimeSeries chart

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to show live data on a TimeSeries chart with real time shown on the x-axis (or at least have the speed of the time the same as real-time). Here is a SSCCE of the problem with random numbers as the live input. The time shown on the x-axis is much faster than real-time (assuming it is shown in hh:mm:ss format): public class DynamicTimeSeriesChart extends JPanel { private DynamicTimeSeriesCollection dataset; private JFreeChart chart = null; public DynamicTimeSeriesChart(final String title) { dataset = new DynamicTimeSeriesCollection(1,

JFreeChart heap space

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm just wondering if there's a way to stop JFreeChart thrashing the heap, or an alternative that doesn't do it so much. SpreadsheetDate , Millisecond and Day are taking up about 70 MB of the heap, but the garbage collector is probably getting thrashed too. They are, collectively, the biggest users of heap space in my app. There's also TimeSeriesDataItem which uses 12 MB. This is with recording things every 200 milliseconds or so, for all charts. I'm also updating / storing a fair few datasets which aren't used immediately, only when the

JFreechart X and Y axis scaling

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: It's possible to set the axis scale values in jfreechart? For example, I'd want X-axis scale 10 and Y-Axis scale 1. 回答1: You set the TickUnit , if you are using an XYPlot try this XYPlot plot = chart.getXYPlot(); NumberAxis xAxis = (NumberAxis) plot.getDomainAxis(); xAxis.setTickUnit(new NumberTickUnit(10)); NumberAxis yAxis = (NumberAxis) plot.getRangeAxis(); yAxis.setTickUnit(new NumberTickUnit(1)); 文章来源: JFreechart X and Y axis scaling

Generate chart with JFreeChart and Apache PDFBOX

拈花ヽ惹草 提交于 2019-12-03 00:49:10
I need to generate charts using JFreeChart and then export them to PDF using Apache PDFBOX . I don't want to use iText as it cannot be used in proprietary software. I searched all over Google, but no luck! Has anyone done it? trashgod Copy the OutputStream from your chosen writeChartAs*() method in ChartUtilities to the InputStream used to create a PDXObjectImage in AddImageToPDF . A typical copyStream() implementation is shown here . Addendum: Alternatively, use piped streams to copy from output to input, as shown here and here . You can try using JasperReports . They are a bit heavy, but

JFreeChart(六)之

匿名 (未验证) 提交于 2019-12-02 23:04:42
转载自 JFreeChart 3D饼图/条形图 三维/3D图表是那些显示在一个三维格式。可以使用这些图表来提供更好的显示效果和清晰的信息。三维/3D饼图是饼图另外一个不错的3D效果。 3D效果可以通过添加一些额外的代码来实现,它会创建一个饼图3D效果。 3D饼图 请看下面的例子来描述移动销售三维饼图。以下是不同移动品牌和销售(每天)名单。 S.N. 手机品牌 销量 (天) 1 Iphone 5S 20 2 Samsung Grand 20 3 MOTO G 40 4 Nokia Lumia 10 以下是对从上述给定的信息创建3D饼图的代码。此代码可以帮助嵌入一个饼图在AWT应用程序中。 import java . io .*; import org . jfree . chart . ChartFactory ; import org . jfree . chart . JFreeChart ; import org . jfree . chart . plot . PiePlot3D ; import org . jfree . data . general . DefaultPieDataset ; import org . jfree . chart . ChartUtilities ; public class PieChart3D { public static void

Adding ChartPanel to jPanel not working

孤者浪人 提交于 2019-12-02 21:56:35
问题 I got this panel: public class StripchartPanel extends javax.swing.JPanel { public StripchartPanel() { XYSeries series = new XYSeries("XYGraph"); series.add(1, 1); series.add(1, 2); series.add(2, 1); series.add(3, 9); series.add(4, 10); // Add the series to your data set XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(series); // Generate the graph JFreeChart chart = ChartFactory.createXYLineChart( "XY Chart", // Title "x-axis", // x-axis Label "y-axis", // y-axis

JFreeChart does not show the graph at every iteration on thread?

橙三吉。 提交于 2019-12-02 20:35:05
问题 I am getting counter values in one class using a thread and writing JFreeChart in another thread. While executing, it works alternatively, but only shows the graph at the end. It also displays the y axis label value as a Float but the actual retrieval value is int. How can I solve these issues? XYDataset Dataset; TimeSeries Series = new TimeSeries("Random Data"); Second sec = new Second(); ChartPanel CPanel; Value = Integer.parseInt(MySQLClass.Map_MySql.get(""+MainWindow.SelectedNode+""));

I need to create a XYLineChart with values from database (Java(Mysql)

杀马特。学长 韩版系。学妹 提交于 2019-12-02 19:57:37
问题 I need to create a XYLineChart with values from database. I see this: public class Test { public static void main(String[] args) { XYSeries series1 = new XYSeries("Lions"); series1.add(20, 10); series1.add(40, 20); series1.add(70, 50); XYSeries series2 = new XYSeries("Rabbits"); series2.add(20, 30); series2.add(40, 40); series2.add(70, 10); XYSeriesCollection xyDataset = new XYSeriesCollection(); xyDataset.addSeries(series1); xyDataset.addSeries(series2); JFreeChart chart = ChartFactory