Chart

Gitbook 插件:使用 C3.js 或者 Highcharts 绘制图形。

[!TIP|style:flat|iconVisibility:hidden|labelVisibility:hidden] npm install gitbook-plugin-chart

https://github.com/csbun/gitbook-plugin-chart

  • C3.js:https://github.com/c3js/c3

  • highcharts:https://github.com/highcharts/highcharts

{
    "plugins": [ "chart" ],
    "pluginsConfig": {
        "chart": {
            "type": "c3"
        }
    }
}

type 可以是 c3 或者 highcharts, 默认是 c3.

举几个例子

JSON 格式的数据
{
    "data": {
        "type": "bar",
        "columns": [
            ["data1", 30, 200, 100, 400, 150, 250],
            ["data2", 50, 20, 10, 40, 15, 25]
        ],
        "axes": {
            "data2": "y2"
        }
    },
    "axis": {
        "y2": {
            "show": true
        }
    }
}
书写规范

Chart

效果如下所示:

YAML 格式的数据
data:
    columns:
        - [data1, 30, 200, 100, 400, 150, 250]
        - [data2, 50, 20, 10, 40, 15, 25]
    axes:
        data2: y2
axis:
    y2:
        show: true
书写规范

Chart

效果如下所示:

results matching ""

    No results matching ""