请问大家,有没有关于java 图表工具,可以丛数据库中直接生成?

03-05-13 cute

形式就和股票走势图一样。。。 有没有 这样相关得软件。
我需要在 UNIX 运行。

先谢了。。。

salajon
2003-05-21 10:34
我们是在jCharts基础上修改后完成的,它可以sourceforge.net
上找到的

xxmouse
2003-06-10 17:54
我用JFREEchart做了一个, 效果不错的。能出饼图, 直方图, 走势图。

wys1978
2003-06-10 21:06
Fins:

http://www.sidimar.ipzs.it/site/

A sample on Fins (IBM stocks price chart):

http://www.sidimar.ipzs.it/site/samples-time.html

goheaven
2003-07-02 16:22
推荐StyleReport.在CSDN上有广告。Java的,B/S模式,客户端不需要装任何东东。
最爽的是没有加密,直接修改inetsoft.report.internal.KeyUtil,就可以不受限制使用了:)

hua__hua
2003-07-24 16:03
我也用JFreeChart写了一个饼图,写成.java运行通过,但改成.jsp确报错,这是为什么呀?


错误:
org.apache.jasper.JasperException: org/jfree/ui/Drawable
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)


root cause

javax.servlet.ServletException: org/jfree/ui/Drawable
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
at org.apache.jsp.first_jsp._jspService(first_jsp.java:68)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)

alemjann
2003-08-06 11:16
我用JFreeChart也出问题了。希望这方面有经验的朋友指点。
用JFreeChart都需要哪些设置?
我的源代码:

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.TextTitle;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PiePlot;
import org.jfree.data.time.Day;
import org.jfree.data.DefaultCategoryDataset;
import org.jfree.data.DefaultPieDataset;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
//import org.jfree.data.time.TimeSeriesDataPair;

import java.awt.*;
import java.io.*;


public class JFreeChartTest {

public JFreeChartTest() {
	
	
	//图片标题
String title = "空调2002年市场占有率";
//设定数据源
DefaultPieDataset piedata = new DefaultPieDataset();
//第一个参数为名称,第二个参数是double数
piedata.setValue(new Integer(1), 27.3);
piedata.setValue(new Integer(2), 12.2);
piedata.setValue(new Integer(3), 5.5);
piedata.setValue(new Integer(4), 17.0);
piedata.setValue(new Integer(5), 9.0);
piedata.setValue(new Integer(6), 19.0);
//创建JFreeChart,都使用ChartFactory来创建JFreeChart,很标准的工厂设计模式
JFreeChart chart = ChartFactory.createPieChart(title, piedata, true, true, true);
//设定图片标题
chart.setTitle(new TextTitle(title, new Font("隶书", Font.ITALIC, 15)));
//chart.addSubtitle(new TextTitle("2002财年分析", new Font("隶书", Font.ITALIC, 12)));
//设定背景
chart.setBackgroundPaint(Color.white);
//chart.s
//饼图使用一个PiePlot 
PiePlot pie = (PiePlot)chart.getPlot();
//pie.setSectionLabelType(PiePlot.NAME_AND_PERCENT_LABELS);
pie.setSectionLabelType(PiePlot.NAME_AND_VALUE_LABELS);
//设定显示格式(名称加百分比或数值)
pie.setPercentFormatString("#,###0.0#%");
//设定百分比显示格式
pie.setBackgroundPaint(Color.white);
pie.setSectionLabelFont(new Font("黑体", Font.TRUETYPE_FONT, 12));
//设定背景透明度(0-1.0之间)
pie.setBackgroundAlpha(0.6f);
//设定前景透明度(0-1.0之间)
pie.setForegroundAlpha(0.90f);
//输出文件到指定目录
String rfname = "pie_chart" + ".jpeg";
String fileName = "d:/test/" + rfname;
try {
//可以保存文件为jpg或png格式。
ChartUtilities.saveChartAsJPEG(new File(fileName), 100, chart, 600, 600);
//第一个参数为文件名
//第二个参数质量
//第三个参数为哪个chart创建图片
//第四个宽度
//第五个高度
} catch (IOException exz) {
System.out.print("....Cant’t Create image File");
}
}

public static void main(String[] args) {
	JFreeChartTest test = new JFreeChartTest();
}	
}
<p class="indent">


错误信息:

Exception in thread "main" java.lang.NoClassDefFoundError: org/jfree/util/PaintT
able
        at org.jfree.chart.plot.PiePlot.initialise(Unknown Source)
        at org.jfree.chart.plot.PiePlot.<init>(Unknown Source)
        at org.jfree.chart.ChartFactory.createPieChart(Unknown Source)
        at JFreeChartTest.<init>(JFreeChartTest.java:36)
        at JFreeChartTest.main(JFreeChartTest.java:74)
Press any key to continue...
<p class="indent">

sky
2003-08-11 08:54
你需要把几个JAR文件引入到你的
JDK-LIB下面
一个是JCOMMON*.JAR
一个是JFREECHART*.JAR
这样就可以,
我用了你的方法已经可行了

pettyisme
2003-08-15 15:31
谁那有用JFREECHART作的线状图,有现成的程序帮忙共享一下,发到邮箱liulei0451@hit.edu.cn

lysmx
2003-09-05 11:11
TimeSeries king = new TimeSeries("啊啊");
for (int i = 1999; i < 2005; i++) {
for (int mon = 0; mon < 12; mon++) {
ibm.add(new Month(mon+1,i),new Double(400-Math.random()*100));
}
}

TimeSeries king = new TimeSeries("比比");
for (int i = 1999; i < 2005; i++) {
ibm.add(new Year(i),new Double(400-Math.random()*100));
}

这是我程序的一段,运行时总是报错:
org.jfree.data.SeriesException: TimeSeries.add(): you are trying to add data where the time period class is org.jfree.data.time.Month, but the TimeSeries is expecting an instance of org.jfree.data.time.Day.

是不是TimeSeries类的add方法只能用 new Day() 类型,我要用new Month(),new Year()类型怎么用



sharplog
2003-09-16 16:48
我下载了一个试用版,可是该公司给序列号不对:(
请问如何修改你说的这个inetsoft.report.internal.KeyUtil?
它在哪里?

435002
2004-07-31 10:37
去掉第一行的 package org/jfree/ui/Drawable 试一试

SportsBaby1980
2004-08-10 13:30
呵呵

可以自己手写啊
不是很困难的

猜你喜欢