GithubHelp home page GithubHelp logo

pkdevboxy / js-diagram-chart Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antuane/js-diagram-chart

0.0 2.0 0.0 1.08 MB

Javascript Diagram Chart

Home Page: http://antuane.com

JavaScript 91.83% HTML 8.17%

js-diagram-chart's Introduction

AntuaneChart

It is a simple diagram chart based on hierarchy, developed in Javascript!

Example

How to use

  1. Import antuane-chart.js in your html page.
  2. Create element canvas with an id.

Example:

```bash
<canvas id="mycanvas" width="640" height="480">
  Canvas not supported! :(
</canvas>
```
  1. Call AntuaneChart function after canvas element and use JSON to data

Example:

```bash
<script type="text/javascript">
  var dataExample = {
    diagrams: [
    {id: 1, text: "DIAGRAM 01", color: "#999999", bgColor: "#330000"},
    {id: 2, text: "DIAGRAM 02", color: "#999999", bgColor: "#003300"},
    {id: 3, text: "DIAGRAM 03", color: "#999999", bgColor: "#000033"},
    {id: 4, text: "DIAGRAM 04", color: "#999999", bgColor: "#333300"},
    {id: 5, text: "DIAGRAM 05", color: "#999999", bgColor: "#003333"},
    {id: 6, text: "DIAGRAM 06", color: "#999999", bgColor: "#330033"},
    {id: 7, text: "DIAGRAM 07", color: "#999999", bgColor: "#000000"},
    {id: 8, text: "DIAGRAM 08", color: "#999999", bgColor: "#000000"},
    {id: 9, text: "DIAGRAM 09", color: "#999999", bgColor: "#000000"},
    {id: 10, text: "DIAGRAM 10", color: "#999999", bgColor: "#333333"}
    ],
    links: [
    { source: 2, parent:1  },
    { source: 3, parent:1  },
    { source: 4, parent:3  },
    { source: 5, parent:3  },
    { source: 6, parent:2  },
    { source: 9, parent:9  },
    { source: 9, parent:6  }
    ],
    config:{
      element: "mycanvas",
      margin: 30,
      padding: 10,
      width: 100,
      height: 50,
      radius: 3,
      hiddenBg: false,
      arrowWidth: 8,
      lineWidth: 2,
      lineDiff: true,
      //lineColor: "#000000", // OPTIONAL
      //hiddenBg: true, // OPTIONAL
      fontFamily: "Arial",
      fontSize: 12,
      autoSize : true,
      mouseEvents:true
    }
  };

  var chart = new AntuaneChart(dataExample);

  //OTHERS METHODS 

  //chart.addZoom(-5);
  //chart.resetZoom();
  //chart.update(dataExample);

</script>
```

Live Example

Click here to live example by JSFiddle.

Problems & Bugs?

Make sure that you have a functional jsfiddle exemplifying your problem and open an issue for us. Don't know how to do it? Use this fiddle example.

Thanks!

_

js-diagram-chart's People

Contributors

antuane avatar

Watchers

 avatar  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.