Code Monkey home page Code Monkey logo

astrochartjs's Introduction

astrochartjs

Javascript library for drawing hindu astrological charts. You can look at demo of charts drawn using astrochartjs at demo page

Usage

###Html File

  • astrochartjs uses snapsvg for rendering svg . So download snapsvg and include snap.svg.js file from dist folder in your html. Eg.
<script src="../lib/snapsvg/snap.svg.js"></script>
<script src="../dist/astrochart.js"></script>
  • Add a svg element to your html file with unique id. Eg:
<svg id="chart" />

###Javascript

  • Create instance of AstroChart by passing id of svg element 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.

astrochartjs's People

Contributors

erajasekar avatar

Watchers

Shikhar Dubey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.