Text and alignment of the Raphael

Source: Internet
Author: User

Text and alignment of the Raphael

<%@ Page Language="Java"ContentType="text/html; Charset=utf-8"pageencoding="UTF-8"%><%    StringPath=Request.getcontextpath (); StringBasePath=Request.getscheme ()+ "://" +Request.getservername ()+ ":" +Request.getserverport ()+Path+ "/";%><!DOCTYPE HTML><HTML><Head><Basehref= "<%=basePath%>"><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Title</title><Scripttype= "Text/javascript"src= "Js/jquery-1.11.1.js"></Script><Scripttype= "Text/javascript"src= "Js/raphael.js"></Script><Scripttype= "Text/javascript"src= "Js/index006.js"></Script></Head><Body><DivID= "Container"></Div></Body></HTML>

$(function() {Initraphael ();});functionInitraphael (e) {//This will find the object based on the ID of container .    varpaper = Raphael (' container ', 500, 500); varT = Paper.text (+, ' abc '). attr (' font-size ', 16); varRec = Paper.rect (200, 40, 100, 5). attr ({fill:' #ccf ',        ' Stroke-width ': 0    }); varT2 = Paper.text (200,60, ' def ')). attr ({//horizontal left alignment;' Text-anchor ': ' Start ',        ' Font-size ': 16,        ' font-family ': ' Courier New '    }); //The vertical distance can be adjusted to view the generated SVG <text> object, which has a <tspan> object with the DY attribute, which controls the alignment of the vertical direction;    varL = Paper.path (' m200,20h100m-100,0v100m200,60h100 '); //gets the attribute;Console.log (t2.attr (' Text-anchor ')));}

Text and alignment of the Raphael

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.