Download libchart
From: http://blog.csdn.net/dj0379/article/details/7451946
Libchart charts are really easy to use. The only pity is that they do not support Chinese characters and are garbled in charts. After pondering, I used the experience of modifying Chinese garbled characters in the dotproject and changed Libchart. Now I have successfully supported Chinese fonts.
The procedure is simple:
1. Write your own PHP file that generates charts using the Libchart library and save it in UTF-8 encoding.
2. Find several Chinese character libraries, such as 文 and, and copy them to the libchart/fonts directory.
3. Modify the text. php file in the libchart \ classes directory.
Rows 47th and 48
$ This-> fontCondensed = dirname (_ FILE _). "/../fonts/DejaVuSansCondensed. ttf ";
$ This-> fontCondensedBold = dirname (_ FILE _). "/../fonts/DejaVuSansCondensed-Bold.ttf ";
Change
$ This-> fontCondensed = dirname (_ FILE _). "/../fonts/Chinese font you have found ";
$ This-> fontCondensedBold = dirname (_ FILE _). "/../fonts/Chinese font you have found ";
Now, the chart now displays Chinese characters.
From: http://blog.csdn.net/dj0379/article/details/7451946
Libchart charts are really easy to use. The only pity is that they do not support Chinese characters and are garbled in charts. After pondering, I used the experience of modifying Chinese garbled characters in the dotproject and changed Libchart. Now I have successfully supported Chinese fonts.
The procedure is simple:
1. Write your own PHP file that generates charts using the Libchart library and save it in UTF-8 encoding.
2. Find several Chinese character libraries, such as 文 and, and copy them to the libchart/fonts directory.
3. Modify the text. php file in the libchart \ classes directory.
Rows 47th and 48
$ This-> fontCondensed = dirname (_ FILE _). "/../fonts/DejaVuSansCondensed. ttf ";
$ This-> fontCondensedBold = dirname (_ FILE _). "/../fonts/DejaVuSansCondensed-Bold.ttf ";
Change
$ This-> fontCondensed = dirname (_ FILE _). "/../fonts/Chinese font you have found ";
$ This-> fontCondensedBold = dirname (_ FILE _). "/../fonts/Chinese font you have found ";
Now, the chart now displays Chinese characters.