This seems to be a duplicate. You just need to get the data and define the x axis as time periods.
var chart = c3.generate({
data: {
x: "time",
json: {
time: eq.properties.time,
data: eq.properties.mag
}
},
axis:{
x:{
type: "timeseries",
tick:{
format:"%Y-%m-%d %H:%M:%S"
}
}
}
});
html .
<div id="chart"></div>