jfreechart

Can't find bundle for base name

淺唱寂寞╮ 提交于 2019-11-29 01:50:25
问题 I'm using a library that has a dependency on jfreechart (v 1.0.9). When I try to run the .jar, I get: java.util.MissingResourceException: Can't find bundle for base name org.jfree.chart.LocalizationBundle, locale en_US at java.util.ResourceBundle.throwMissingResourceException (ResourceBundle.java:1521) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260) at java.util.ResourceBundle.getBundle(ResourceBundle.java:962) I've tried creating a LocalizationBundle.properties file, but

Real-time graphing in Java

本秂侑毒 提交于 2019-11-29 01:12:53
问题 I have an application which updates a variable about between 5 to 50 times a second and I am looking for some way of drawing a continuous XY plot of this change in real-time. Though JFreeChart is not recommended for such a high update rate, many users still say that it works for them. I've tried using this demo and modified it to display a random variable, but it seems to use up 100% CPU usage all the time. Even if I ignore that, I do not want to be restricted to JFreeChart's ui class for

Add BufferedImage to PDFBox document

妖精的绣舞 提交于 2019-11-28 23:57:37
In my current project, I try to add a BufferedImage to a PDFBox document. More specificly, I use an image from a JFreeChart . My code looks like this: public void exportToPDF(JFreeChart chart, String filePath){ PDDocument doc = null; PDPage page = null; PDXObjectImage ximage = null; try { doc = new PDDocument(); page = new PDPage(); doc.addPage(page); PDPageContentStream content = new PDPageContentStream(doc, page); BufferedImage image = chart.createBufferedImage(300, 300); ximage = new PDJpeg(doc, image); content.drawImage(ximage, 20, 20); content.close(); } catch(IOException ie) { } doc.save

Jfreechart绘制漂亮的图表

百般思念 提交于 2019-11-28 15:27:44
要想绘制出漂亮的图表,就必须了解图表的构成部分,将图表进行分解成N个部分。 然后再对每一个部分进行渲染,设置样式:包括背景色、轮廓线条样式和颜色、填充颜色、字体大小、样式、颜色。同时,需要确保在整个项目中,图表的样式风格整体统一,统一,和谐才能打造漂亮、干净、专业的外观. 使用JfreeChart创建柱状图,折线图,饼图,堆积柱状图,时间序列图,二维Y轴坐标图. 所有代码和示例项目代码地址: http://www.oschina.net/code/snippet_855019_36505 封装好的美化Jfreechart的工具类 ChartUtils.java 大家可以直接使用. Jfreechart API详解和开发中大家所经常遇到的问题,请参考博客: http://my.oschina.net/abian/blog/278465 Jfreechart 图表属性拆解图: 美化后,Jfreechart图形效果展示: 柱状图界面: 代码:这是我封装的工具类,然后绘制图表就非常简单了,而且美观专业! package util; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Font; import java.awt.Paint; import java.awt.Rectangle; import

Change the Lines Style and colour of a JFreeChart

半腔热情 提交于 2019-11-28 14:43:38
I have 3 series: XYSeries s1 = new XYSeries("one"); s1.add(1,0); s1.add(2,1); XYSeries s2 = new XYSeries("two"); s1.add(3,0); s1.add(4,1); XYSeries s3 = new XYSeries("three"); s1.add(5,0); s1.add(6,1); Which i plot as a XYLineChart: XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(s1); dataset.addSeries(s2); dataset.addSeries(s3); JFreeChart chart = ChartFactory.createXYLineChart("title", "x", "y", dataset, PlotOrientation.VERTICAL, false, false, false); and add to a panel: ChartPanel cp = new ChartPanel(chart); panel_1.add(cp, BorderLayout.CENTER); panel_1.validate();

Drawing Line chart in Java [closed]

若如初见. 提交于 2019-11-28 14:41:05
I want to draw a graph on each point of which there will be a button. When I will click the button, it will do something. Here's a link ; I want my graph to look like this. Can anybody suggest me how to do it? trashgod Using JFreeChart , add a ChartMouseListener to your ChartPanel , as outlined here . In your implementation of chartMouseClicked() invoke Desktop#browse() , as illustrated here . In outline, chartPanel.addChartMouseListener(new ChartMouseListener() { public void chartMouseClicked(ChartMouseEvent e) { // construct a URI based the result from e.getEntity() desktop.browse(uri); }

How to plot color map in java?

不羁岁月 提交于 2019-11-28 14:31:41
I have a dataset with 3 column, x, y, and value at (x,y). I want to plot map similar to bellow map. How to plot this type of figure in jfreechart or any library available for this kind of plot? Catalina Island An XYBlockRenderer looks like a good match. You can use Color.getHSBColor() , like they show here , to make the PaintScale . image trashgod Starting with this example and using this idea , you can use a SpectrumPaintScale to get a palette of colors as shown below. import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Paint; import javax.swing

Update a plot in JFreeChart

Deadly 提交于 2019-11-28 14:24:06
I have a parabola plot, coefficients of parabola equation are stored in array a . In mouseDragged (mousemotionlistener), coefficients of parabola were changed and I want to update a parabola plot with new coefficients in realtime. How can I make this happen? public class ParabolaDemo extends ApplicationFrame { int flag = 0; double px = 0.0, py = 0.0, chartpx = 0.0, chartpy = 0.0, chartX = 0.0, chartY = 0.0; int windowheight = 270; ChartPanel chartPanel; PolynomialFunction2D p; double lrange = -20.0; double rrange = 20.0; double[] a; public ParabolaDemo(final String title) { super(title);

Exception with JFreechart in JInternalFrame

元气小坏坏 提交于 2019-11-28 14:14:27
Basically, I want a Java GUI with multiple frames, so I'm using JInternalFrame , but when I add my chart (created from JFreeChart ) to one of the frames, it gave me an exception. Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.plaf.ColorUIResource cannot be cast to java.util.List at javax.swing.plaf.metal.MetalUtils.drawGradient(Unknown Source) at javax.swing.plaf.metal.MetalInternalFrameTitlePane.paintComponent(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintToOffscreen(Unknown Source) at javax.swing

Code difference between jfreechart XYLineAndShaperanderer, XYDotRenderer and XYSplineRenderer?

白昼怎懂夜的黑 提交于 2019-11-28 14:10:39
I'm trying to create simple XYSplineRenderer, but code only work if I write XYDotRenderer a = new XYDotRenderer(); or XYLineAndShapeRenderer a = new XYLineAndShapeRenderer(); Can sameone tell what i do wrong? I'm just beginner in programming. Here is my code: package kubas; import org.jfree.chart.*; import org.jfree.chart.axis.*; import org.jfree.chart.plot.*; import org.jfree.chart.renderer.xy.XYSplineRenderer; import org.jfree.data.xy.*; import org.jfree.ui.ApplicationFrame; public class spausdink { public static void main(String[] args) { XYSeries series = new XYSeries("XY grafikas");