GithubHelp home page GithubHelp logo

35niavlys / dokuwiki-plugin-amcharts Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.93 MB

DokuWiki plugin for inserting interactive charts powered by amcharts.js

PHP 0.22% JavaScript 94.53% HTML 4.16% CSS 1.09%

dokuwiki-plugin-amcharts's Introduction

#AmCharts Plugin for DokuWiki#

The amcharts plugin for DokuWiki makes it easy to insert interactive data charts rendered by amcharts.js.

This plugin accepts the same JavaScript object that AmCharts takes to generate a chart. Any chart describable by a static JavaScript object is supported. All types of charts natively supported by AmCharts can be rendered.

Installation

The latest ZIP package of this plugin can be downloaded here.

If you install this plugin manually, make sure it is installed in lib/plugins/amcharts/ - if the folder is called different it may not work.

Please refer to the DokuWiki document for additional info on how to install plugins in DokuWiki.

Usage

This plugin accepts the same JavaScript object that the makeChart() function of amcharts.js takes to render a chart. To include a chart in your DokuWiki page, simply wrap such a JavaScript object with a <amchart> tag.

To render a pie chart for exemple:

<amchart>
{
  "type": "pie",
  "dataProvider": [ {
    "country": "Lithuania",
    "litres": 501.9
  }, {
    "country": "Czech Republic",
    "litres": 301.9
  }, {
    "country": "Ireland",
    "litres": 201.1
  }, {
    "country": "Germany",
    "litres": 165.8
  }, {
    "country": "Australia",
    "litres": 139.9
  }, {
    "country": "Austria",
    "litres": 128.3
  }, {
    "country": "UK",
    "litres": 99
  }, {
    "country": "Belgium",
    "litres": 60
  }, {
    "country": "The Netherlands",
    "litres": 50
  } ],
  "valueField": "litres",
  "titleField": "country",
   "balloon":{
   "fixedPosition":true
  }
}
</amchart>

Also note that you can include comments in the snippet, both styles (// and /* */) are supported.

The major restriction is that the JavaScript object must be static, i.e. it cannot include function calls or function expressions, for security reasons.

Options

The <amchart> tag can carry optional attributes to customize the appearance of the chart. The attributes are separated by spaces, each specified in the format of name=value. Valid attributes are:

Name Description
width Width of the chart, specified in CSS format, e.g. 50% or 320px.
height Height of the chart, in the same format as width.
align Chart alignment, can be left, right or center.

For instance to make your chart occupying half width of its container and floated to the right:

<amchart align="right" width=50% >
  {
    ...
  }
</amchart>

Thanks

This plugin is based on dokuwiki-plugin-c3chart created by @jasonxxu, thanks to him.

License

Copyright (C) Sylvain Menu

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See the COPYING file in your DokuWiki folder for details

dokuwiki-plugin-amcharts's People

Contributors

35niavlys avatar splitbrain avatar

Stargazers

 avatar

Watchers

 avatar  avatar

dokuwiki-plugin-amcharts's Issues

gantt charts don't render

Hi,

Are gantt charts supposed to work? I tried the two examples from amcharts but they don't seem to work. I was wandering if this is the same for everyone or just for me (i.e. I am doing something wrong).

This is what I am talking about:

https://www.amcharts.com/demos/gantt-chart/
https://www.amcharts.com/demos/gantt-chart-dates/

and this is a very basic simple example that should but doesn't work:

<amchart> { "type": "gantt", "categoryField": "category", "segmentsField": "segments", "colorField": "color", "startDateField": "start", "endDateField": "end", "dataProvider": [ { "category": "Module #1", "segments": [ { "start": "2016-01-01", "end": "2016-01-14", "color": "#b9783f", "task": "Gathering requirements" } ] } ] } </amchart>

amcharts plugin

DW latest version, plugin doesn't render any charts, just blank page

Sample charts

Hi there,

Thanks for your plugin !

Would you update your doc with some samples such as xy or steps charts pls ?

It would be aweome.

Cheers

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.