﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Alpha-随笔分类-Jfreechart</title><link>http://www.blogjava.net/Alpha/category/10914.html</link><description>多少春秋风雨改 多少崎岖不变爱</description><language>zh-cn</language><lastBuildDate>Fri, 04 May 2007 04:56:22 GMT</lastBuildDate><pubDate>Fri, 04 May 2007 04:56:22 GMT</pubDate><ttl>60</ttl><item><title>JFreeChart在JSP中的应用实例</title><link>http://www.blogjava.net/Alpha/archive/2007/01/13/93569.html</link><dc:creator>Alpha</dc:creator><author>Alpha</author><pubDate>Sat, 13 Jan 2007 03:08:00 GMT</pubDate><guid>http://www.blogjava.net/Alpha/archive/2007/01/13/93569.html</guid><wfw:comment>http://www.blogjava.net/Alpha/comments/93569.html</wfw:comment><comments>http://www.blogjava.net/Alpha/archive/2007/01/13/93569.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.blogjava.net/Alpha/comments/commentRss/93569.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Alpha/services/trackbacks/93569.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: JFreeChart是一个开源的JAVA项目，它主要用来开发各种各样的图表，这些图表包括：饼图、柱状图(普通柱状图以及堆栈柱状图)、线图、区域图、分布图、混合图、甘特图以及一些仪表盘等等。在这些不同式样的图表上可以满足目前商业系统的要求。JFreeChart是一种基于JAVA语言的图表开发技术。JFreeChart可用于Servlet、JSP、Applet、Java Appication环境中，通过JDBC可动态显示任何数据库数据，结合Itext可以输出至PDF文件。&nbsp;&nbsp;<a href='http://www.blogjava.net/Alpha/archive/2007/01/13/93569.html'>阅读全文</a><img src ="http://www.blogjava.net/Alpha/aggbug/93569.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Alpha/" target="_blank">Alpha</a> 2007-01-13 11:08 <a href="http://www.blogjava.net/Alpha/archive/2007/01/13/93569.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux下java中文字体问题[与JfreeChart有关]</title><link>http://www.blogjava.net/Alpha/archive/2006/05/20/47162.html</link><dc:creator>Alpha</dc:creator><author>Alpha</author><pubDate>Sat, 20 May 2006 05:10:00 GMT</pubDate><guid>http://www.blogjava.net/Alpha/archive/2006/05/20/47162.html</guid><wfw:comment>http://www.blogjava.net/Alpha/comments/47162.html</wfw:comment><comments>http://www.blogjava.net/Alpha/archive/2006/05/20/47162.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/Alpha/comments/commentRss/47162.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Alpha/services/trackbacks/47162.html</trackback:ping><description><![CDATA[<div>最近要用jfreechart,在图表中会用到中文,</div>
		<div>在windows环境下,不会发生乱码问题.</div>
		<div>但是部署到linux下,就发生中文乱码问题,中文全变成方框，摸索了一段时间才将之解决。</div>
		<div>
				<p>为了确定你的Linux环境下程序会使用的字体文件，先跑跑这个程序：from others<br /><br /></p>
				<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
						<span style="COLOR: #008080">1</span>
						<img id="Codehighlighter1_25_333_Open_Image" onclick="this.style.display='none'; Codehighlighter1_25_333_Open_Text.style.display='none'; Codehighlighter1_25_333_Closed_Image.style.display='inline'; Codehighlighter1_25_333_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" />
						<img id="Codehighlighter1_25_333_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_25_333_Closed_Text.style.display='none'; Codehighlighter1_25_333_Open_Image.style.display='inline'; Codehighlighter1_25_333_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />
						<span style="COLOR: #0000ff">public</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">class</span>
						<span style="COLOR: #000000"> PrintLocale </span>
						<span id="Codehighlighter1_25_333_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
								<img src="http://www.blogjava.net/images/dot.gif" />
						</span>
						<span id="Codehighlighter1_25_333_Open_Text">
								<span style="COLOR: #000000">{<br /></span>
								<span style="COLOR: #008080">2</span>
								<span style="COLOR: #000000">
										<img id="Codehighlighter1_70_331_Open_Image" onclick="this.style.display='none'; Codehighlighter1_70_331_Open_Text.style.display='none'; Codehighlighter1_70_331_Closed_Image.style.display='inline'; Codehighlighter1_70_331_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />
										<img id="Codehighlighter1_70_331_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_70_331_Closed_Text.style.display='none'; Codehighlighter1_70_331_Open_Image.style.display='inline'; Codehighlighter1_70_331_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span>
								<span style="COLOR: #0000ff">public</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">static</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">void</span>
								<span style="COLOR: #000000"> main(String[] args) </span>
								<span id="Codehighlighter1_70_331_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
										<img src="http://www.blogjava.net/images/dot.gif" />
								</span>
								<span id="Codehighlighter1_70_331_Open_Text">
										<span style="COLOR: #000000">{<br /></span>
										<span style="COLOR: #008080">3</span>
										<span style="COLOR: #000000">
												<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(System.getProperty(</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">user.language</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">));<br /></span>
										<span style="COLOR: #008080">4</span>
										<span style="COLOR: #000000">
												<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(System.getProperty(</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">user.region</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">));<br /></span>
										<span style="COLOR: #008080">5</span>
										<span style="COLOR: #000000">
												<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(System.getProperty(</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">file.encoding</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">));<br /></span>
										<span style="COLOR: #008080">6</span>
										<span style="COLOR: #000000">
												<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(System.getProperty(</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">os.version</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">));<br /></span>
										<span style="COLOR: #008080">7</span>
										<span style="COLOR: #000000">
												<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span>
								</span>
								<span style="COLOR: #000000">
										<br />
								</span>
								<span style="COLOR: #008080">8</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span>
						</span>
						<span style="COLOR: #000000">
								<br />
						</span>
						<span style="COLOR: #008080">9</span>
						<span style="COLOR: #000000">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</span>
				</div>
		</div>
		<br />
		<div>访问顺序可以看:</div>
		<div>
				<a href="http://www-128.ibm.com/developerworks/cn/websphere/library/techarticles/yangyaping0307/waslinux.html">
						<font color="#0d5d91">
								<u>http://www-128.ibm.com/developerworks/cn/websphere/library/techarticles/yangyaping0307/waslinux.html</u>
						</font>
				</a>
		</div>
		<div>
				<font color="#0d5d91">
				</font> </div>
		<div>比如: linux as 3.0 ，linux 7.3 same</div>
		<div>会大概有如下的访问顺序:</div>
		<div> </div>
		<div>font.properties.zh_CN.Redhat</div>
		<div>
				<div>font.properties.zh_CN</div>
				<div>
						<div>font.properties.zh</div>
						<div>
								<div>font.properties</div>
								<div> </div>
								<div> </div>
								<div>1 . 将此文件拷贝到%JAVA_HOME%/jre/lib下面去<br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">serif.</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">=-</span><span style="COLOR: #000000">b</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">h</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">luxi serif</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">medium</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">r</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">normal</span><span style="COLOR: #000000">--*-%</span><span style="COLOR: #000000">d</span><span style="COLOR: #000000">-*-*-</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-*-</span><span style="COLOR: #000000">iso8859</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1<br />    serif.</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">=-</span><span style="COLOR: #000000">misc</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">ZYSong18030</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">medium</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">r</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">normal</span><span style="COLOR: #000000">--*-%</span><span style="COLOR: #000000">d</span><span style="COLOR: #000000">-*-*-</span><span style="COLOR: #000000">c</span><span style="COLOR: #000000">-*-</span><span style="COLOR: #000000">iso10646</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />serif.italic.</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">=-</span><span style="COLOR: #000000">b</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">h</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">luxi serif</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">medium</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">i</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">normal</span><span style="COLOR: #000000">--*-%</span><span style="COLOR: #000000">d</span><span style="COLOR: #000000">-*-*-</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-*-</span><span style="COLOR: #000000">iso8859</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1<br />    serif.italic.</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">=-</span><span style="COLOR: #000000">misc</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">ZYSong18030</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">medium</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">r</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">normal</span><span style="COLOR: #000000">--*-%</span><span style="COLOR: #000000">d</span><span style="COLOR: #000000">-*-*-</span><span style="COLOR: #000000">c</span><span style="COLOR: #000000">-*-</span><span style="COLOR: #000000">iso10646</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1<br /></span><span style="COLOR: #000000">    <img src="http://www.blogjava.net/images/dot.gif" /><img src="http://www.blogjava.net/images/dot.gif" /><img src="http://www.blogjava.net/images/dot.gif" />.<br />  略<br />   <img src="http://www.blogjava.net/images/dot.gif" /><img src="http://www.blogjava.net/images/dot.gif" /><img src="http://www.blogjava.net/images/dot.gif" /><br />   .appendedfontpath</span><span style="COLOR: #000000">=/</span><span style="COLOR: #000000">usr</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">share</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">fonts</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">zh_CN</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">TrueType<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span></div><br /><br />请注意 字符串-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1，除了中间什么*-%--*--c*--之外
<div>必须跟 /usr/share/fonts/zh_CN/TrueType/fonts.dir 中的完全一致。</div><div>如果把 ZYSong --&gt; zysong 也是不行的。</div><div> </div><div>2. 设置中文环境</div><div>   我是在程序中如下设置的:<br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">System.setProperty(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">user.language</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">zh</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);     <br />   System.setProperty(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">user.region</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">CN</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);</span></div></div></div>
						</div>
				</div>
		</div>
		<br />
		<br />
		<div>3. 编译代码文件,要用</div>
		<div>
				<font color="#000000">         javac -encoding GBK   xxxxxx.java </font>
		</div>
		<div>
				<font color="#000000">   如果是用ant工具,</font>
		</div>
		<div>
				<font color="#000000">       &lt;target name="compile" depends="prepare" description="complie All Java source"&gt;<br />          &lt;copy todir="${build.dir}"&gt;<br />            &lt;fileset dir="${src.dir}" includes="**/*.properties" /&gt;<br />         &lt;/copy&gt;<br />         &lt;javac srcdir="${src.dir}" destdir="${build.dir}" <font color="#ff0000">encoding="GBK"</font>&gt;<br />            &lt;classpath refid="project.classpath" /&gt;<br />         &lt;/javac&gt;</font>
		</div>
		<div>
				<font color="#000000">      &lt;/target&gt;</font>
		</div>
		<div>
				<font size="2">
				</font> </div>
		<div>
				<font size="2">
				</font> </div>
		<div>
				<div>可以访问这里的资源: <a href="http://dev.csdn.net/article/55/55126.shtm"><font color="#0d5d91"><u>http://dev.csdn.net/article/55/55126.shtm</u></font></a><br /><br /></div>
		</div><img src ="http://www.blogjava.net/Alpha/aggbug/47162.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Alpha/" target="_blank">Alpha</a> 2006-05-20 13:10 <a href="http://www.blogjava.net/Alpha/archive/2006/05/20/47162.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux下配置jfreechart</title><link>http://www.blogjava.net/Alpha/archive/2006/05/09/45213.html</link><dc:creator>Alpha</dc:creator><author>Alpha</author><pubDate>Tue, 09 May 2006 06:58:00 GMT</pubDate><guid>http://www.blogjava.net/Alpha/archive/2006/05/09/45213.html</guid><wfw:comment>http://www.blogjava.net/Alpha/comments/45213.html</wfw:comment><comments>http://www.blogjava.net/Alpha/archive/2006/05/09/45213.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Alpha/comments/commentRss/45213.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Alpha/services/trackbacks/45213.html</trackback:ping><description><![CDATA[在linux下，我把运行jfreechart相应的包jfreechart-0.9.18.jar、jcommon-0.9.3.jar等已经copy到tomcat的common/lib下，但是，程序运行还是提示如下错误：<br />java.lang.NoClassDefFoundError<br />org.jfree.chart.axis.Axis.&lt;init&gt;(Axis.java:180)<br />at org.jfree.chart.axis.CategoryAxis.&lt;init&gt;(CategoryAxis.java:137)<br />at org.jfree.chart.axis.CategoryAxis3D.&lt;init&gt;(CategoryAxis3D.java:78)<br />at org.jfree.chart.ChartFactory.createBarChart3D(ChartFactory.java:507)
<p>解决的办法是：<br />编辑/etc/profile文件，在最后加入export CATALINA_OPTS='-Djava.awt.headless=true'<br />即可<br /><br /><br /></p><img src ="http://www.blogjava.net/Alpha/aggbug/45213.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Alpha/" target="_blank">Alpha</a> 2006-05-09 14:58 <a href="http://www.blogjava.net/Alpha/archive/2006/05/09/45213.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>