On the problem of garbled characters in images generated by csdrawgraph

Source: Internet
Author: User
Tags character set

Many people say that Csdrawgraph does not support Chinese characters, which is actually wrong.


First we need to define the character set of the page number in the Picture Generation page

<%
	Response.ContentType = "text/html; charset=gb2312 "
%>

Then define the relevant font when the chart is generated

<% Set Chart

	= Server.CreateObject ("Csdrawgraph.draw") ' Chart object

	chart.legendfont = ' Arial '	sets the font
	of the project control bar Chart.legendtextsize = 9	' Sets the font size of the project control bar

	chart.title = "Histogram" The	text content of the picture title
	Chart.titlefont = "Arial"	Set the font of the title of the picture
	chart.titlesize =	"Set the font size of the title of the picture

	' Of course there are other tags of the font, you can try it yourself
	' Chart.labelfont =
	' Chart.titlesize = 
	' Chart.linegraphtextfont =

%>

The following figure is a chart image generated from the above code, where the x-axis is not set font, the default Arial font, the label and the control bar are set to the song body;



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.