Skip to content

Commit

Permalink
Axis switching working
Browse files Browse the repository at this point in the history
  • Loading branch information
40thieves committed Feb 6, 2014
1 parent c12a4bd commit 42bef8d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,28 +84,28 @@

chart.draw();

// var xAxis = document.querySelector('#x-axis')
// , yAxis = document.querySelector('#y-axis')
// ;
var xAxis = document.querySelector('#x-axis')
, yAxis = document.querySelector('#y-axis')
;

// xAxis.addEventListener('change', function(e) {
// foo(e.target.value, yAxis.value);
// });
xAxis.addEventListener('change', function(e) {
changeAxis(e.target.value, yAxis.value);
});

// yAxis.addEventListener('change', function(e) {
// foo(xAxis.value, e.target.value);
// });
yAxis.addEventListener('change', function(e) {
changeAxis(xAxis.value, e.target.value);
});

// function foo(x, y) {
// chart.setConfig({
// dataSourceKeys: {
// x: x,
// y: y
// }
// });
function changeAxis(x, y) {
chart.setConfig({
dataSourceKeys: {
x: x,
y: y
}
});

// chart.draw();
// }
chart.draw();
}
</script>
</body>
</html>

0 comments on commit 42bef8d

Please sign in to comment.