Jump to content
We have recently updated our Privacy Statement, available here ×

Time in graph


norbert palkovic

Recommended Posts

Good day, please help you with the program I am not doing welI display time in graph. Respectfully how does the man save the time so I can see it properly thank you for your reply. Norbert

 

/*

* Parse the data and create a graph with the data.

*/

function parseData(createGraph) {

Papa.parse("data/spanish-silver.csv", {

download: true,

complete: function(results) {

createGraph(results.data);

}

});

}

function createGraph(data) {

var Time = [];

var silverMinted = ["Silver Minted2"];

var situadosPaid = ["situadosPaid"];

 

for (var i = 1; i < data.length; i++) {

Time.push(data[0]);

silverMinted.push(data[2]);

situadosPaid.push(data[1]);

 

}

console.log(Time

console.log(silverMinted);

console.log(situadosPaid);

var chart = c3.generate({

bindto: '#chart',

data: {

columns: [

silverMinted,

situadosPaid

],

axes: {

data2: 'y2' // ADD

}

},

axis: {

y2: {

show: true // ADD

},

 

x: {

type: 'category',

categories: Time,

max: 10,

tick: {

format: '%Y-%m-%d %H:%M:%S',

multiline: false,

 

}

 

 

}

}

});

}

parseData(createGraph);

Link to comment
Share on other sites

×
×
  • Create New...