FusionCharts flash中文问题,X 轴正常,Y轴不能显示中文
来源:互联网 发布:太原电脑网络培训机构 编辑:程序博客网 时间:2024/04/29 13:40
最近在项目中遇到了使用FusionCharts发现报表的Y轴只要是中文就不显示,X轴没有问题,最后终于解决了此问题:
出现此问题的原因是因为FusionCharts不支持Y轴中文竖写,所以最简单的办法把中文横写就可以了。当然目前最新版本的FusionCharts可能已经解决此问题,鉴于项目中使用老版本的可能比较多!
1、如果是FusionCharts付费版则可以直接加入rotateYAxisName=‘0’属性即可让Y轴的中文横写。
chart.setDataXML("<chart rotateYAxisName='0' baseFont='宋体' baseFontSize='14' palette='10' caption='标题' xAxisName='X轴' yAxisName='Y轴' showValues='0' decimals='0' formatNumberScale='0' useRoundEdges='1'><set label='1月' value='462' /><set label='Feb' value='857' /><set label='Mar' value='671' /><set label='Apr' value='494' /><set label='May' value='761' link='javascript:myJS()'/><set label='Jun' value='960' link='n-DemoLinkPages/DemoLink1.html'/></chart>")
2、如果是FusionCharts Free版本的需要破解flash的源文件。可以使用sothink swf decompiler工具修改falsh的源代码,下载地址如下:
下载地址: http://www.swf-decompiler.com/
找到yAxisName的相关代码
Js代码if (this.Params.xAxisName != "") { createText(this.getLevel(), this.Params.xAxisName, this.Objects.Canvas.xPos + this.Objects.Canvas.width / 2, this.Objects.Canvas.height + this.Objects.xAxisName.yPos, this.Params.outCnvBaseFont, this.Params.outCnvBaseFontSize, this.Params.outCnvBaseFontColor, true, "center", "center", null, true); } // end if if (this.Params.yAxisName != "") { createText(this.getLevel(), this.Params.yAxisName, this.Objects.yAxisName.xPos, this.Objects.Canvas.yPos + this.Objects.Canvas.height / 2, "Verdana", Number(this.Params.outCnvBaseFontSize) + 1, this.Params.outCnvBaseFontColor, false, "center", "center", 270, true); } // end if if (this.Params.xAxisName != "") { createText(this.getLevel(), this.Params.xAxisName, this.Objects.Canvas.xPos + this.Objects.Canvas.width / 2, this.Objects.Canvas.height + this.Objects.xAxisName.yPos, this.Params.outCnvBaseFont, this.Params.outCnvBaseFontSize, this.Params.outCnvBaseFontColor, true, "center", "center", null, true); } // end if if(this.Params.yAxisName != "") { createText(this.getLevel(), this.Params.yAxisName, this.Objects.yAxisName.xPos, this.Objects.Canvas.yPos + this.Objects.Canvas.height / 2, "Verdana", Number(this.Params.outCnvBaseFontSize) + 1, this.Params.outCnvBaseFontColor, false, "center", "center", 270, true); } // end if
注意看倒数第五 和倒数第二个参数 输出x轴和y轴有什么不同,改成一样就可以了,编译好把flash替换了刷新页面 横向输出的y轴坐标已经出来了。还有点不完美的就是第一个字显示了一半被截掉了一样,看着不舒服,解决办法: 输出的xml根节点加上chartLeftMargin=‘30’属性。ok大功告成
修改后如下图所示:
- FusionCharts flash中文问题,X 轴正常,Y轴不能显示中文
- fusioncharts Y轴不显示中文的解决方法
- 如何解决ASP.NET中中文不能正常显示问题
- ntfs-3g不能正常显示中文文件名的小问题
- FusionCharts 如何显示中文
- Solaris中文不能正常显示的解决办法
- jsp参数不能正常显示中文
- FusionCharts中文乱码问题
- FusionCharts中文乱码问题
- FusionCharts Free X轴标签长重叠 Y轴标签不显示 乱码
- FusionCharts X轴显示方式
- Flash图表控件FusionCharts自定义图表y轴最大/最小值
- MySQL不能显示中文问题
- FusionCharts V3画图中文不显示或乱码的问题
- 解决JFreeChart无法正常显示中文问题
- 解决JFreeChart无法正常显示中文问题
- cocos2d-x中文显示问题
- cocos2d-x中文显示问题
- Visual Studio2005 Windows XP DDK DriverStudio3.2 安装的一些说明
- 用 ResourceBundle 读取Properties文件以及乱码处理
- calloc(), malloc(), realloc(), free(),alloca()
- eclipse js文件 报错解决办法
- 如何破解Word“取消文档保护”密码
- FusionCharts flash中文问题,X 轴正常,Y轴不能显示中文
- SecureCRT中sqlplus,使用Backspace删除时 ^H^H
- UPS电源外配电池的计算方法
- C++_友元函数
- record
- paip.IIS 7.5 应用程序池,应用程序以及虚拟目录的存储位置
- 服务中读取当前用户注册表HKEY_CURRENT_USER
- Linux Shell编程入门
- 伟大的程序员