I am trying to load in data into a dimple.js line chart, but I am new to JavaScript and I am having trouble plotting a basic line chart. I have a column for Watts and a column for Time. How do I plot this in dimple.js?
My file contains a column for Time and a column for Watts.
I think there may be an issue on my line with: data = dimple.filterData(data, "Watts", []);?
<html>
<div id="chartContainer">
<script src="dimple/js/d3.v3.min.js"></script>
<script src="dimple/js/dimple.v2.1.6.min.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.csv("TESTFILE.txt", function (data) {
var myChart = new dimple.chart(svg, data);
data = dimple.filterData(data, "Watts", []);
myChart.setBounds(60, 30, 505, 305);
var x = myChart.addCategoryAxis("x", "Time");
myChart.addMeasureAxis("y", "Watts");
var s = myChart.addSeries(null, dimple.plot.line);
myChart.draw();
});
</script>
</div>
</html>