jfreechart

JFreeChart simple plot (parabola)

天涯浪子 提交于 2019-11-27 16:21:34
I wrote a simple parabola plot using JFreeChart. package parabolademo; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartMouseEvent; import org.jfree.chart.ChartMouseListener; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.data.function.Function2D; import org.jfree.data.function.PolynomialFunction2D; import org.jfree.data.general.DatasetUtilities; import org.jfree.data.xy.XYDataset; import org

JPanel added but not displayed “in time”

我与影子孤独终老i 提交于 2019-11-27 16:15:57
I have a JFrame that displays JPanels depending on the MenuItem you click. It works, but now I need to call a method once a JPanel is added to the frame and it is being shown (because I'm using JFreeChart inside that panel and I have to call chartPanel.repaint() when the JPanel is visible): this.getContentPane().add( myjpanel, BorderLayout.CENTER ); //this = JFrame this.validate(); myjpanel.methodCalledOnceDisplayed(); Does it seem ok? Is myjpanel being shown really? It seems it is not: public void methodCalledOnceDisplayed() { chartPanel.repaint() } This is not working ( chartPanel

JFreeChart Scatter Plot Lines

旧街凉风 提交于 2019-11-27 16:15:52
问题 I'm trying to create a graph with JFreeChart, however it doesn't get the lines right. Instead of connecting the points in the order I put them, it connects the points from in order of their x-values. I'm using ChartFactory.createScatterPlot to create the plot and a XYLineAndShapeRenderer to set the lines visible. /edit: sscce: package test; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.PlotOrientation;

JFreeChart: DynamicTimeSeries with period of n milliseconds

谁说我不能喝 提交于 2019-11-27 15:52:02
I'm trying do define an interface in which I want to plot some values received by an external device. These values are received with a frequency that can be set through the interface. Of course the period of the plot should change according to the period defined by the user. So I started to define the followint Chart: int periodMs = 200; MilliDTSC dataset = new MilliDTSC(1,100, new MultipleOfMillisecond(periodMs)); dataset.setTimeBase(new MultipleOfMillisecond(periodMs)) dataset.addSeries(zeroSeries()),0,"Zero data") // zeroSeries returs a series with values set to 0 JFreeChart chart =

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

北城以北 提交于 2019-11-27 15:23:22
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, 2000, new Second()); dataset.setTimeBase(new Second(0,

JFreeChart select an area without zooming

早过忘川 提交于 2019-11-27 15:12:24
问题 I recently started using JFreeChart and there is something i would like to do but i'm not sure if it's possible. My program is supposed to draw a spectrogram (a sound graph) from a wav file. So i managed to get the data from my wav file in a double arraylist and to display it in a chart. But now i would like to be able to select an area of my spectrogram (with the same tool used for zooming) without zooming and to be able to play only the selected part on my sound. But i simply can't find any

Setting Different Color to particular Row in Series-JFreeChart

耗尽温柔 提交于 2019-11-27 14:53:44
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.swing.JPanel; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree

JavaWeb图表插件的小研究

早过忘川 提交于 2019-11-27 10:18:08
背景 最近的一个项目中,对数据的统计分析有很大的要求,这就要求有一款很强大的报表、图表插件。因此,组长给分了任务,让我们各自去研究不同的图表插件。用了一两天的时间,对java这块的图表插件做了一个简单的研究。java方向的图报表还是有很多很多的,例如,在业界颇具口碑的商业插件—— ChartDirector、 JavaScript图表 JScharts 等,以及开源插件—— JFreeChart(源码免费,文档付费)、 JasperReports 等。 现状 随着信息化时代的到来,计算机的应用也越来越广泛, 无论是企业还是政府机关,对数据的分析处理能力都是有严格要求的,以往的方式都是手工绘制图报表,来分析数据带来的影响和趋势。然而,图表的出现解放了人们的双手,利用计算机的高速处理能力,依托大数据量,绘制出各种各样的图表,以不同的方式展现出数据的趋势,使得阅读者对以往的数据和未来的趋势一目了然,运筹帷幄。 然而,就目前来说,在报表方面,国内只有稀疏的几家公司提供了很好的开发工具;但在图表方面,国内就欠缺很多了,大部分知名的图表插件都是国外的产品。而且,随着大数据时代的到来,对数据的处理、分析能力要求会更高,而图表、报表的需求也会越来越多。 介绍 在Web开发中,图形和图表是常用的数据呈现方式,图表能将枯燥的数据生动的表现出来。也许你正接手一个Web图表开发项目

Web图表开发工具JFreeChart与ChartDirector使用评测

为君一笑 提交于 2019-11-27 10:17:52
在Web开发中,图形和图表是常用的数据呈现方式,图表能将枯燥的数据生动的表现出来。也许你正接手一个Web图表开发项目,却被Web图表开发工具选型的问题困扰着,要么是价格昂贵,要么就是部署麻烦,或者图表效果不尽人意。那这篇关于JFreeChart和ChartDirector这两个Web图表工具的使用评测能给你一些帮助和启示。 JFreeChart是Java平台下开源的的图表类库,是一个完全基于Java的图表开发技术。支持的图表类型也比较丰富,比如饼图、柱状图、散点图、仪表盘、甘特图等多种图表,还可以生成Web图形报表。JFreeChart可导出PNG和JPEG格式的文件,可以与PDF和EXCEL关联。 JFreeChart,Web图形报表,Java开源图表工具 JFreeChart使用评测 稳定、轻量级且功能强大 免费开源,但是开发手册和示例要花钱购买 API处理简单,很容易上手 生成的图表运行顺畅 虽然JFreeChart的文档要收费,但好在国内还有很多人在使用JFreeChart,网上可以找到很多相关的使用教程,可以参考一下。JFreeChart的缺陷就是只适合生成图片,而且文字、图片都不是特别清晰,还需要进行一些调整,比较麻烦。在交互性方面它又比不上Flash图表工具,比如Open Flash Chart、AnyChart、FusionCharts等。

JFreechart Loop through polar chart sectors

心已入冬 提交于 2019-11-27 09:51:56
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 posted earlier Can someone please explain to me why it keeps looping? And why the number of series