Closed nemi83 closed 3 years ago
How to implement the line_change_data graph to be suitable for a bar chart to change data?
` // Create a update selection: bind to the new data var u = svg.selectAll(".lineTest") .data([data], function(d){ return d.ser1 });
// Updata the line u .enter() .append("path") .attr("class","lineTest") .merge(u) .transition() .duration(3000) .attr("d", d3.line() .x(function(d) { return x(d.ser1); }) .y(function(d) { return y(d.ser2); })) .attr("fill", "none") .attr("stroke", "steelblue") .attr("stroke-width", 2.5)`
How to implement the line_change_data graph to be suitable for a bar chart to change data?
` // Create a update selection: bind to the new data var u = svg.selectAll(".lineTest") .data([data], function(d){ return d.ser1 });
// Updata the line u .enter() .append("path") .attr("class","lineTest") .merge(u) .transition() .duration(3000) .attr("d", d3.line() .x(function(d) { return x(d.ser1); }) .y(function(d) { return y(d.ser2); })) .attr("fill", "none") .attr("stroke", "steelblue") .attr("stroke-width", 2.5)`