Last active
December 12, 2015 12:38
-
-
Save MRdNk/4773096 to your computer and use it in GitHub Desktop.
Example of using gRaphael for a simple graph
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function () { | |
| var r = Raphael("example"); | |
| var chart = r.g.linechart ( | |
| 10, 10, | |
| 490, 180, | |
| [ | |
| [1,2,3,4,5,6,7], | |
| [3.5,4.5,5.5,6.5,7,8] | |
| ], | |
| [ | |
| [12, 32, 23, 15, 17, 27, 22], // red line y-values | |
| [10, 20, 30, 25, 15, 28] // blue line y-values | |
| ], | |
| { | |
| nostroke: false, // lines between points are drawn | |
| axis: "0 0 1 1", // draw axes on the left and bottom | |
| symbol: "disc", // use a filled circle as the point symbol | |
| smooth: false, // curve the lines to smooth turns on the chart | |
| dash: "-", // draw the lines dashed | |
| colors: [ | |
| "#995555", // the first line is red | |
| "#555599" // the second line is blue | |
| ] | |
| } | |
| ) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment