Solve the Problem of displaying Chinese Characters in ChartDirectorLinux

Source: Internet
Author: User
Article Title: solves the problem of displaying Chinese Characters in ChartDirectorLinux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

When ChartDirector is used to create a chart to display Chinese characters, it can be displayed normally in Windows. In Linux, it is displayed as a [Box]. The solution is as follows:
 
Program
 

// Create a XYChart object of size 700x450 pixelsXYChart c = new XYChart (700,450); // Set the plotarea at (30, 20) and of size 200x200 pixelsc. setPlotArea (120, 70,520,270); // Add a line chart layer using the given datac. addLineLayer (data,-1, "XXXX trend chart"); // Display 1 out of 3 labels on the x-axis.c.xAxis (). setLabelStep (1); c. setBackground (0xFFFF80, 0x0, 1); c. setPlotArea (120, 70,520,270, 0 xFFFFFF,-1,-1, 0xC0C0C0,-1); c. addLegend (400, 35, false, "simsun. ttc ", 10 ). setBackground (0xFFFF80 );



Simsun. ttc is the Chinese font name used in this program.

Cause:

In Linux, the [simsun. ttc] font file does not exist.

Solution:

Copy the [simsun. ttc] file from the Windows system to JavaSource of the project, repackage it, release it again, and restart the Server.

Or copy the simsun. ttc file from Windows to the project directory/WEB-INF/classes to restart the Server.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.