OFC2 modified version (fix problems in Chinese Y-axis)

2010-10-27  来源:本站原创  分类:Flash  人气:124 

OFC2 is a good use of Flash graphics library, which includes the curve: line, bar (3d, glass, etc.), area, radar, etc. using the open source FlashDevelop can compile and run, but in the Chinese support has several problems such as Y-axis can not display Chinese, etc. There are two ideas to solve:

  1. The Chinese characters, such as simsun.ttc to Flash projects, compiled into Flash files, so there will be a problem, because the font library foot 10M, so the compiled Flash file will become very large, enough to have 10M or so, therefore discarded.
  2. Another idea is to solve the Y-axis shows the rotation to remove, so you can display Chinese, and it compiled Flash file will be maintained at about 200K, and the user experience, are also relatively OK, so this idea of using this solution

Modify the source YLegendBase.as file build function after modified as follows:

private function build( text:String ): void {

                        var title:TextField = new TextField();
            title.x = 0;
                        title.y = 0;

                        this.text = text;

                        title.htmlText = this.text;

                        var fmt:TextFormat = new TextFormat();
                        fmt.color = this.css.color;

                        fmt.font = this.css.font_family?this.css.font_family:'Verdana';

                        if (fmt.font == "spArial") {
                                title.embedFonts = true;
                                title.antiAliasType = AntiAliasType.ADVANCED;
                                title.rotation = 270;
                                title.height = title.textHeight;
                        }

                        fmt.bold = this.css.font_weight == 'bold'?true:false;
                        fmt.size = this.css.font_size;
                        fmt.align = "center";

                        title.setTextFormat(fmt);
                        title.autoSize = "left";

                        this.addChild(title);
                }

Note: If the incoming font-family for the spArial, then the rotation and then, after recompilation changes will see the following results:

OFC2 modified version (fix problems in Chinese Y-axis)

, One can properly display the Chinese Y-axis, oh, just put it sideways, no rotating 270 °, and click the right side of the Legend will show hidden curves, the effect is good, oh, compiled Flash files can be downloaded in the Annex!

You can also here to see concrete results: http://code.faqee.com/chart2/index.jsp

相关文章
  • OFC2 modified version (fix problems in Chinese Y-axis) 2010-10-27

    OFC2 is a good use of Flash graphics library, which includes the curve: line, bar (3d, glass, etc.), area, radar, etc. using the open source FlashDevelop can compile and run, but in the Chinese support has several problems such as Y-axis can not disp

  • Software development version control problems 2009-12-08

    / / Software version control problems, the concept of software development from the beginning there is a problem. With the massive increase in team development, version management and control issues become urgent and important. Therefore, software ve

  • Java problems in Chinese mysql, oracle, servlet, jsp 2009-10-06

    [url] http://blog.csdn.net/arielxp/archive/2004/06/23/23874.aspx [/ url] Java problems in Chinese mysql, oracle, servlet, jsp Copyright: CSDN is Blog hosting service provider. In this paper, such as copyright issues involved, CSDN not bear the releva

  • jsView 2.0.5 modified version support FireFox3.6 2010-04-09

    jsView 2.0.5 modified version support FireFox3.6

  • modified version of mac os 2010-10-30

    As Old Joe's paranoia and ego, developed under his leadership the same stuff with his bad temper, iPhone SDK have to identify the operating system to the version number, version number does not meet the requirements would not allow installation. In m

  • flex linechart draw dotted lines, some lines connected to the Y axis maximum value of problem-solving (the original) 2011-09-20

    The use of flex linechart, we often encounter strange problems. Of course, is the result after the user-defined. Problem now is the last mentioned, is drawing some lines while dotted lines connected to the Y axis maximum value of. And is a solid, puz

  • Extjs grid export from Excel table. Back to C # (absolute ease of use) (a modified version of their own needs) 2010-04-23

    Recently generated Excel form, get a little bit of new experience, is hereby updated version of their development time. Development Tools: VS2005 Database: oracle10.1 Browser: firefox3.5.9 The first step, web layer aspx files need to be included in t

  • java coding problems in Chinese sentiment 2008-12-18

    String newStr = new String (oldStr.getBytes (), "UTF-8"); java's String class is conducted in accordance with unicode encoding, when using the String (byte [] bytes, String encoding) constructor string, encoding refers to the bytes of the data i

  • Modified version of the database character set oracle10g express 2010-12-09

    Oracle Oracle 10g EXPress Edition is designed for small users of the free version. Oracle XE is very small, simple installation, available for a smaller third-party software developers to deploy applications. However, the current beta2 Oracle XE defa

  • vs2010 Simplified Chinese version download link (including Chinese msdn) 2010-08-03

    http://blog.csdn.net/wjhuangjin/archive/2010/05/29/5632593.aspx Yesterday, friends said vs2010 Chinese version can be downloaded, and he started not believe that, just on weekends, so try to download the install really is the Chinese version, was ori

  • ROR + mysql problems in Chinese 2010-08-24

    Environment: os: ubuntu 10.04 ruby: 1.9.2 rails: rails3 server: webrick / nginx + passenger Brought before the procedure to run when I discover there are Chinese in ruby ah! In theory, the character encoding is UTF-8 and should not be a problem, at l

  • Mysql query on the problems in Chinese 2010-09-28

    Symptoms : Enter the query in the database select * from table where name=' Chinese ', there is a result set . But the same query using java to a statement result set is empty . Thorough investigation to be attributed to the character set will only b

  • About MySQL problems in the Y and ~ 2010-11-09

    Speaking recently in jars, Y and ~ also see the problem, do not know the official mysql bugs when there arrangements to resolve this bug. Here describe, explain why. 1 Description of the problem mysql> create table t (c char (32)) engine = innodb; Qu

  • Modified version of Linux the default jdk 2011-09-23

    When you have successfully installed the jdk1.6 to / usr / java, and configure the system environment variables Executive # java-version when it was shown jdk1.4.2, is because your linux system default jdk; Execution 1. # Cd / usr / bin # Ln-s-f / us

  • Serv-U FTP server solutions to the problems of Chinese garbage 2010-04-11

    Many people set up complete with the Serv-U FTP server, using tools such as connected FlashXP encountered FTP server file name every time which contain Chinese appear garbled because Serv-U is used by default UTF-8 code reasons, set the encoding as l

  • gentoo emerge under the default installation of modified version of the software and removing cover off 2010-04-20

    # Emerge installation branch of the official document: http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml? part = 3 & chap = 3 # doc_chap2 # Such as the following one: # See if the installed version can be installed and emerge - pretend - verb

  • jQuery version mismatch problems with jsTree 2010-04-23

    Today, a demo instance of the debug jsTree, back with the servlet successfully returned json data (line jsTree of the json data format requirements), but the front jsTree not display the tree. Source code by viewing jsTree plug and found the ajax met

  • JSP and MySQL to solve interaction problems of Chinese garbled 2010-07-14

    First implemented a StringConvert bean (GBtoISO () and ISOtoGB () two methods), resolved when interacting with the MySQL database, part of Chinese garbage problem: MySQL in the JSP program to read the Chinese-language content using these two methods

  • Modified version of the above in the JSP template MyEclipse7.5 2010-10-18

    This modification is only for MyEclipse7.0 or later, the following changes for the 7.0, not the same. Online there are tutorials. To modify the template JSP MyEclipse7.0 above, the following steps: (mine is 8.5) The process of amending the proposed o

  • ajax parameters transmit path distortion problems handling Chinese 2010-10-22

    ajax email program, send the path parameters are Chinese, the server receives the parameter value is garbled deal? To convert url encoding twice, which encodeURI (encodeURI (url)), Then in the background to get to the parameters of a decoder, such as