Click here to Skip to main content
15,884,099 members
Articles / Web Development / HTML5
Tip/Trick

Chart in HTML in 1 Minute

Rate me:
Please Sign up or sign in to vote.
4.33/5 (2 votes)
25 Sep 2013CPOL 23.6K   12   7
Chart in HTML in 1 minute

To add a chart to your page, you will need exactly one minute. We will use AWeb library. Let's connect the library to the project:

HTML
<!DOCTYPE HTML>
<html>
<head>
   <title>Sample project</title>
   
   <!-- Styles -->
   <link rel="stylesheet" type="text/css" href="http://a-web.me/styles/default/a-web.css" >
   
   <!-- Scripts -->
   <script type="text/javascript" src="http://a-web.me/scripts/a-web.js"></script>
</head>
<body>
</body>
</html>

Chart is created by tag "a:chart", chart properties are specified in the tag attributes. The x-axis will display the values from 1 to 3, scale 1. The y-axis will display the values from 1 to 10, scale 5. Chart passes through: (1,0) (2,8) (3,0).

Our example will look like this:

HTML
<!DOCTYPE HTML>
<html>
<head>
   <title>Sample project</title>
   
   <!-- Styles -->
   <link rel="stylesheet" type="text/css" href="http://a-web.me/styles/default/a-web.css" >
   
   <!-- Scripts -->
   <script type="text/javascript" src="http://a-web.me/scripts/a-web.js"></script>
</head>
<body>
   <!-- Chart -->
   <a:chart a:type="UI/Chart"
            a:axis-x="1..3/1"
            a:axis-y="0..10/5"
            a:points-1="1 0, 2 8, 3 0"
   >
   </a:chart>
</body>
</html>

The chart is created on the client side in the browser without connecting to the server. Enjoy!

Other Articles About the Library

I decided to link the articles, because there is not much information about the library on the internet:

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO student
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionUnrecognized namespace 'a' Pin
kayay18-Sep-13 1:53
kayay18-Sep-13 1:53 
Am getting error :: Unrecognized namespace 'a'

Resolved: Instead of a tag have used asp, working fine.

Thanks!
QuestionNo scream shot? Pin
B. Clay Shannon17-Sep-13 5:58
professionalB. Clay Shannon17-Sep-13 5:58 
QuestionJavaScript runtime error: 'Event' is undefined Pin
Antariksh Verma16-Sep-13 20:39
professionalAntariksh Verma16-Sep-13 20:39 
AnswerRe: JavaScript runtime error: 'Event' is undefined Pin
Member 1027778017-Sep-13 1:43
Member 1027778017-Sep-13 1:43 
GeneralRe: JavaScript runtime error: 'Event' is undefined Pin
Antariksh Verma23-Sep-13 22:48
professionalAntariksh Verma23-Sep-13 22:48 
QuestionAmazing Question... Pin
Dewey16-Sep-13 16:56
Dewey16-Sep-13 16:56 
AnswerRe: Amazing Question... Pin
Ranjan.D16-Sep-13 17:16
professionalRanjan.D16-Sep-13 17:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.