score:1
Accepted answer
Use the unload()
method to get rid of data by it's ID.
var data1=[['data1', 35, 205, 150, 100, 100, 200], ['data2', 130, 120, 130, 190, 100, 40]];
var chart = c3.generate({
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 130, 100, 140, 200, 150, 50]
],
type: 'bar',
labels:true
},
type: 'bar',
bar: {
width: {
ratio: 0.5 // this makes bar width 50% of length between ticks
}
},
axis: {
rotated: true
}
});
setTimeout(function () {
chart.unload({
ids: ['data2']
});
}, 1000);
Source: stackoverflow.com
Related Query
- Transition for grouped bar chart in d3 when updating the data values
- d3 bar chart labels not getting updated on updating the chart with the new data
- updating the data of bar chart in c3.js
- Dimple.js - Add data labels to each bar of the bar chart
- I want to update the data on this d3.js bar chart by clicking a button. (onclick)
- Create a bar chart with local storage data (drawing the bars doesn't work)
- Sorting the bars and getting the group data in a grouped bar chart
- How to keep circles inside the svg when updating data in bubble chart
- Add data values to D3.js bar chart in the middle or above
- Updating d3 bar chart labels with new data of variable length
- D3 - stacked bar chart shows wrong data in the chart
- Bar Chart Part 1 D3 why does it skip data that is the same value?
- updating d3 chart with new data, the old data points not removed
- d3 Plus bar chart how to force fixed max y axis range independent of the max data value
- D3 updating bar chart with new data set cause update issue
- How to implement hierarchical X-axis Bar chart in my angular JS application. The Bar should have +/- to open/close the hierarchical data like below
- How do I make the height of a horizontal bar chart flexible in order to be resized when new data has been added in?
- d3.js bar chart resize after changing the data
- D3.js - Updating Bar Chart Data with buttons
- Display original and updated data of the bar chart
- Using an ordinal scale ('d3.scale.ordinal') for the x-axis in a bar chart
- How to update d3.js bar chart with new data
- d3 accessing nested data in grouped bar chart
- Make simple bar chart using C3 with separate columns on the x axis
- d3.js - group 2 data values in a stacked bar chart
- Reduce the size of a large data set by sampling/interpolation to improve chart performance
- Updating the data of a pack layout from JSON call and redrawing
- D3 update dataset on click and redraw the bar chart
- Adding a filter in dc.js / Crossfilter not updating the chart
- Looping through data attributes to create 4 separate bar charts... why are there "phantom" data elements being bound to the xAxis?
More Query from same tag
- Is there a way to get a subset/section of a path in d3.js?
- dc.js Composite Graph - Plot New Line for Each Person
- Building a train movement graph
- Access y value of a d3.line after interpolation
- Need to shift link of child node to parent once parent collapsed in d3 graph
- padding top in bar chart
- Order graph nodes d3js
- Responsive d3 brushing
- How to fill an image inside my svg circles in d3.js
- labels on x axis in scale time d3.js
- d3 Sankey assign fixed x,y position
- How to remove unwanted lines in Axis scale of a graph when using D3.js?
- React and D3: Cannot read property 'X' of undefined
- chart.xAxis .tickFormat formatting is not working
- Selecting element at coordinates in SVG
- Load SVG shapes over multiple lines in D3
- How to update reusable d3.js graph when data updates?
- Changing the xAxis to say Months instead of Numbers
- how to check whether you need to parse or not need to parse?
- How to open D3.js Context Menu with right click
- D3 histogram with a time scale
- Distinguishing click and double-click in D3 Version 4
- Line chart angles smoother using D3
- C3 - Timeseries chart with JSON and categories
- DimpleJS. Y axis values in percentages
- Google chart sankey-- "Cycle found in rows" error
- Using or converting Lambert coordinates in D3
- dimple.js or d3.js - Draw chart's legend at bottom of svg element
- How to get maximum value from an array of objects to use in d3.scale.linear().domain()
- Resize my chart based on my xAxis text with d3.js