Phppchart Chinese display-php Tutorial

Source: Internet
Author: User
Phppchart shows Chinese problems $ MyData = new pData ();
$ MyData-> addPoints (array (25, 10, 25, 10, 25, 10, 25, 10, 25, 10), "Temperature ");
$ MyData-> addPoints (array (2, 4, 6, 4, 5, 6, 4, 5, 8, 6, 1), "Pressure ");
$ MyData-> setSerieDrawable ("Pressure", FALSE );
$ MyData-> setAxisName (0, "total order amount ");
$ MyData-> addPoints (iconv_arr (array ("may January", "May February", "May March", "May April", "May", "May June", "May July ", "August", "August"), "Labels ");
$ MyData-> setSerieDescription ("Labels", "Months ");
$ MyData-> setAbscissa ("Labels ");

Pchart is used in PHP, but the label does not display Chinese characters or Chinese characters are garbled. how can this problem be solved?


Reply to discussion (solution)

Pchart is based on GD, while GD can only draw UTF-8-encoded Chinese characters
Please check whether the requirements are met

Pchart is based on GD, while GD can only draw UTF-8-encoded Chinese characters
Please check whether the requirements are met


Header ("content-type: text/html; charset = utf-8 ");
$ Font = "c :\\ windows \ fonts \ simkai. ttf ";
$ MyPicture-> setFontProperties (array ("FontName" => $ font, "FontSize" => 11 ));
$ MyPicture-> drawText (, "analysis graph", array ("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE ));
My title can display Chinese characters, because the drawText parameter can use "FontName" => $ font, but the label does not know how to get it.

Pchart is based on GD, while GD can only draw UTF-8-encoded Chinese characters
Please check whether the requirements are met



The question above is how the label displays Chinese, and the title can now be displayed as Chinese

Then you can check whether the font settings are correct.

Then you can check whether the font settings are correct.

Master, add QQ to help me see Bei 412906819


Pchart is based on GD, while GD can only draw UTF-8-encoded Chinese characters
Please check whether the requirements are met



The question above is how the label displays Chinese, and the title can now be displayed as Chinese



Amount. The problem is solved. I still don't understand pchar. Thank you



Pchart is based on GD, while GD can only draw UTF-8-encoded Chinese characters
Please check whether the requirements are met



The question above is how the label displays Chinese, and the title can now be displayed as Chinese



Amount. The problem is solved. I still don't understand pchar. Thank you



Is swelling solved?

Now I have encountered the same problem. I beg for help.

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.