Skip to content
Boyi C edited this page Dec 24, 2018 · 4 revisions

Welcome to the chartjs-chart-timeline wiki!

options.colorFunction(data) Return Color() object using input data. options.showText When true, the chart will draw text on the timeline bar.

Example

https://jsfiddle.net/fanthos/8vrme4bt/

Usage

"type": "timeline",
"options": {
    "colorFunction": function() {
        return Color('black');
    },
    "showText": true,
},
"data": {
    "labels": [
        "Cool Graph",
        "heater1"
    ],
    "datasets": [
        {
            "data": [
                [
                    "2018-01-22T16:00:00.000Z",
                    "2018-01-23T05:40:44.626Z",
                    "Unknown"
                ]
            ]
        },
        {
            "data": [
                [
                    "2018-01-22T16:00:00.000Z",
                    "2018-01-23T04:57:43.736Z",
                    "On"
                ],
                [
                    "2018-01-23T04:57:43.736Z",
                    "2018-01-23T04:57:55.437Z",
                    "Off"
                ],
                [
                    "2018-01-23T04:57:55.437Z",
                    "2018-01-23T05:40:44.626Z",
                    "On"
                ]
            ]
        }
    ]
},
Clone this wiki locally