Javascript library for drawing hindu astrological charts. You can look at demo of charts drawn using astrochartjs at demo page
###Html File
- astrochartjs uses snapsvg for rendering
svg. So download snapsvg and includesnap.svg.jsfile fromdistfolder in your html. Eg.
<script src="../lib/snapsvg/snap.svg.js"></script>- Download astrochartjs and include
astrochart.jsfromdistdir in your html. Eg
<script src="../dist/astrochart.js"></script>- Add a
svgelement to your html file with unique id. Eg:
<svg id="chart" />###Javascript
- Create instance of
AstroChartby passingidofsvgelement in html.
var astroChart = new AstroChart("#chart");- Call draw method with chart data and options to draw chart. Eg:
var options = {
'title': ['Rasi', '11/04/2014 07:00AM', 'Erode, Tamil Nadu, India'],
'width': 600,
'height': 400
};
var astroChart = new AstroChart("#chart");
astroChart.draw({
1: ["Su", "Ke"],
3: ["Ju"],
6: ["Ma", "Asc"],
7: ["Mo", "Sa", "Ra"],
11: ["Ve"],
12: ["Me"]
}, options);draw() method parameters
| Name | Type | Description |
|---|---|---|
| data | Object | Map of chart data with house number (1 to 12) as key and array of planets in that house as value. In above example first house contains "Su" and "Ke", second house contains "Ju" etc.. |
| options | Object | Map of key/value pair of options |
Supported options
| Name | Type | Description |
|---|---|---|
| width | int | Width of the chart |
| height | int | Height of the chart |
| styleSheet | url string | Url of custom stylesheet to use |
| showHouseNumbers | boolean | Show house number on each house of the chart |
| startHouseNumbersFrom | int(1-12) | Starting house number when showHouseNumbers is true. Useful if you want to begin numbering from Ascendant. |