You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for(var i in data){
result[i]=data[i].Executiondate;
}
var sorted = result.sort(result);
var minDate = sorted[0];
var maxDate = sorted[sorted.length-1];
//console.log(maxDate);
//console.log(minDate);
data.forEach(function (d) {
d["days"] = d["Executiondate"].substring(d["Executiondate"]);
d["TimeofDay"] =d["Time"].substring(d["Time"]);
});
// Create the chart as usual
var myChart = new dimple.chart(svg, data);
myChart.setBounds(70, 40, 590, 420)
var x = myChart.addTimeAxis("x", "days","%Y-%m-%d","%Y-%m-%d");
var y = myChart.addTimeAxis("y", "TimeofDay",
"%H:%M:%S", "%H:%M:%S");
x.overrideMin = new Date(minDate);
x.overrideMax = new Date(maxDate);
var s = myChart.addSeries("Total", dimple.plot.bar);
y.showGridlines = true;
//s.lineMarkers = true;
myChart.assignColor("Total", "blue");
myChart.draw();
x.shapes.selectAll("text").attr("transform", "rotate(15)");
</script>
The text was updated successfully, but these errors were encountered:
i am new to dimple js,i want to plot a bar chart where x axis represent date(yyyy-mm-dd) and y axis represent time(hh:mm:ss).here is my code
CAM Sweep
<script src="https://d3js.org/d3.v4.min.js"></script> <script src="http://dimplejs.org/dist/dimple.v2.3.0.min.js"></script> <script type="text/javascript">var data = [
{ "Executiondate":"2010-07-12","Time":"10:00:25"},
{ "Executiondate":"2010-07-20","Time":"10:20:28"},
{ "Executiondate":"2010-08-01","Time":"10:40:22"},
{ "Executiondate":"2010-08-08","Time":"10:10:56"},
{ "Executiondate":"2010-08-20","Time":"11:00:41"},
{ "Executiondate":"2010-09-07","Time":"09:50:55"},
{ "Executiondate":"2010-09-13","Time":"10:10:49"},
{ "Executiondate":"2010-10-01","Time":"12:00:33"},
{ "Executiondate":"2010-10-09","Time":"10:10:31"},
{ "Executiondate":"2010-10-29","Time":"11:40:00"},
{ "Executiondate":"2010-10-23","Time":"10:30:23"},
{ "Executiondate":"2010-11-01","Time":"09:30:12"},
{ "Executiondate":"2010-11-09","Time":"10:50:36"},
{ "Executiondate":"2010-11-20","Time":"10:10:39"},
{ "Executiondate":"2010-12-01","Time":"10:50:05"},
{ "Executiondate":"2010-12-23","Time":"12:20:01"},
{ "Executiondate":"2010-12-02","Time":"10:10:06"},
{ "Executiondate":"2010-12-13","Time":"10:00:17"},
{ "Executiondate":"2010-07-11","Time":"16:00:02"},
{ "Executiondate":"2010-07-30","Time":"17:30:59"},
{ "Executiondate":"2010-08-11","Time":"15:40:36"},
{ "Executiondate":"2010-08-13","Time":"13:10:25"},
{ "Executiondate":"2010-09-21","Time":"15:00:13"},
{ "Executiondate":"2010-08-07","Time":"15:50:45"},
{ "Executiondate":"2010-08-13","Time":"14:10:56"},
{ "Executiondate":"2010-08-30","Time":"13:00:17"},
{ "Executiondate":"2010-09-11","Time":"15:50:19"},
{ "Executiondate":"2010-09-23","Time":"15:10:28"},
{ "Executiondate":"2010-12-11","Time":"15:50:36"},
{ "Executiondate":"2010-12-01","Time":"15:20:27"},
{ "Executiondate":"2010-03-11","Time":"15:10:10"},
{ "Executiondate":"2010-09-11","Time":"08:20:00"}
];
The text was updated successfully, but these errors were encountered: