Giter VIP home page Giter VIP logo

docsify-charty's Introduction

docsify-charty

by Mark Battistella


Installation

Update index.html file

  1. Add the following script and stylesheet to your index.html via either CDN or downloading it and using it locally:

    unpkg.com

    <script src="//unpkg.com/@markbattistella/docsify-charty@latest/dist/docsify-charty.min.js"></script>
    <link rel="stylesheet" href="//unpkg.com/@markbattistella/docsify-charty@latest/dist/docsify-charty.min.css">

    jsDelivr.com

    <script src="//cdn.jsdelivr.net/npm/@markbattistella/docsify-charty@latest"></script>
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@markbattistella/docsify-charty@latest/dist/docsify-charty.min.css">

    locally

    <script src="docsify-charty.min.js"></script>
    <link rel="stylesheet" href="docsify-charty.min.css">
  2. In docsify setup configure the plugin (see configuration for setup). These are the global settings and affect all charts:

window.$docsify = {
  charty: {
    "theme": String,
    "mode":  String,
    "debug": Boolean
  }
};

npm install

Or if you're using npm to manage your dependencies:

npm i @markbattistella/docsify-charty

Configuration

Global settings

Example: index.html

Name Type Example Description
theme String "#EE5599" Global theme for chart colours in HEX
mode String "light" Accepts "dark" or "light"
debug Boolean false Console logs if charts aren't loading

Per chart settings

Name Accepts Description
title String The title of the chart, displayed at the top. Leave blank if you want to hide it
caption String The sub-text of the chart, displayed under the title. Leave blank to hide it
type String The type of charty you want to display
options.theme String Set an individual theme to this chart. It will override the global theme
options.legend Boolean Show the legend. Default true
options.labels Boolean Show the chart labels. Default true
options.numbers Boolean Show the chart numbers. Default true
data.label String Graphed data point label
data.value Int / Array Graphed value that puts it on the render
data.colour String Override the global and theme with a specific colour

Markdown code

```charty
{
  "title":   '',
  "caption": '',
  "type":    '',
  "options": {
    "theme":   '',
    "legend":  '',
    "labels":  '',
    "numbers": ''
  },
  "data": [
    {
      "label": '',
      "value": '',
      "colour": ''
    }
  ]
}
// close the code block
// can't show it here

Types of charts

Circular

pie

docsify-charty: pie

donut / doughnut

docsify-charty: donut

section / sectional

docsify-charty: section

rings

docsify-charty: rings

Area

radar

docsify-charty: radar

area

docsify-charty: area

Plot

scatter

docsify-charty: scatter

bubble

docsify-charty: bubble

line

docsify-charty: line
docsify-charty: line

Bar / Column

bar / bar-stack

docsify-charty: line
docsify-charty: line

column / column-stack

docsify-charty: line
docsify-charty: line

Rating

docsify-charty: line

Contributing

  1. Clone the repo:

    git clone https://github.com/markbattistella/docsify-charty.git

  2. Create your feature branch:

    git checkout -b my-feature

  3. Commit your changes:

    git commit -am 'Add some feature'

  4. Push to the branch:

    git push origin my-new-feature

  5. Submit the pull request

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.