一个大家都有益的问题,散分!

exceedzs 2003-08-01 11:25:07
请问大家:jfreechart的中文问题怎么解决,有好办法高分相送,
...全文
63 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
haimingway 2003-08-01
  • 打赏
  • 举报
回复
public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
mtou 2003-08-01
  • 打赏
  • 举报
回复
JFreeChart chart = ChartFactory.createVerticalBarChart3D(title, domain, range, dataset,true,true,false);

chart.setBackgroundPaint(new GradientPaint(0.0F, 0.0F, Color.white, 1000F, 0.0F, Color.red));
chart.setTitle(new TextTitle(title, new Font("隶书", Font.ITALIC, 15)));

Font font=new Font("黑体",Font.TRUETYPE_FONT, 12);

StandardLegend legend = (StandardLegend) chart.getLegend();
legend.setItemFont(font);

CategoryPlot plot = (CategoryPlot)chart.getPlot();
plot.setForegroundAlpha(0.9F);

CategoryAxis domain_axis = plot.getDomainAxis();
domain_axis.setTickLabelFont(font);

ValueAxis value_axis=plot.getRangeAxis();
value_axis.setTickLabelFont(font);


Hodex 2003-08-01
  • 打赏
  • 举报
回复
解决中文问题:
提交后
String title=new String(request.getParameter("title").getBytes("ISO8859_1"),"GBK");
再插入数据库。

另外最好是
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
shenyong 2003-08-01
  • 打赏
  • 举报
回复
还有顺便帮忙解决一下tomcat4.1的中文显示以及读取数据库中中文会出现乱码的解决方案。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧