Back

Two Data Sources

Sample where two different data sources are used

Documentation Open in JSFiddle
Start Free Trial Purchase

HTML

HTML
<script src="https://cdn.zoomcharts-cloud.com/1/nightly/zoomcharts.js"></script>

<div id="demo"></div>

CSS

CSS
//No CSS for this example 

JavaScript

JavaScript

    var t = new TimeChart({
        data: [
            {
                id: "bitcoin",
                units: ["h"],
                url: "/dvsl/data/time-chart/bitcoin-h.json",
                timestampInSeconds: true
            },
            {
                id: "temperature",
                units: ["h"],
                url: "/dvsl/data/time-chart/temperature-kuldiga-h.json"
            }
        ],
        currentTime:{enabled:false},
        valueAxis:{
            "currency":{
                side:"left"
            },
            "temp":{
                side:"right",
                zeroLine:"center"
            }
        },
        series:[
            {
                type:"line",
                valueAxis:"temp",
                data:{ index:1, source: "temperature"},
                style:{fillColor: "rgba(255,0,0,0.6)", smoothing:true}
            },
            {
                type:"columns",
                valueAxis:"currency",
                data:{ index:1, source: "bitcoin"}
            }
        ],
        container: document.getElementById("demo")
    });

Data

Data
//No separate data for this example