score:0
Currently your best bet is to create a fake group. Really the .data
method on the charts is supposed to do this, but it doesn't work for charts that derive from the stack mixin.
https://github.com/dc-js/dc.js/wiki/FAQ#filter-the-data-before-its-charted
score:2
I believe you are asking a few questions here. I will try to answer the main question: how do you add data to a dc chart.
I created an example here: http://jsfiddle.net/djmartin_umich/qBr7y/
In this example I simply add random data to the crossfilter, though this could easily be adapted to pull data from the server:
function AddData(){
var q = Math.floor(Math.random() * 6) + 1;
currDate = currDate.add('month', 1);
cf.add( [{date: currDate.clone().toDate(), quantity: q}]);
$("#log").append(q + ", ");
}
I call this method once a second. Once it completes, I reset the x domain and redraw the chart.
window.setInterval(function(){
AddData();
lineChart.x(d3.time.scale().domain([startDate, currDate]));
dc.redrawAll();
}, 1000);
I recommend trying to get this working in isolation before trying to add the complexity of multiple y-axis scales.
Source: stackoverflow.com
Related Query
- Simple way to add raw data to dc.js composite chart via Ajax
- how to add multiple x axes to d3 chart via data join?
- D3 - To add Data Labels to a simple bar chart
- dc.js add class to data points in multiple charts based on criteria from first chart
- nvd3.js chart ajax data redraw - missing hovereffect + former yAxis scale
- d3js stack chart with simple data
- Is there a way to add different shapes depending on different data to my force-directed graph?
- Is there a way to add a highlight to pie chart in d3?
- Dimple.js - Add data labels to each bar of the bar chart
- NVD3 Line Chart doesn't display when data passed using ajax - data.map is not a function
- add data to chart using c3.js
- Simple D3.js line chart with data that are values collect every hours
- Is there a way to add horizontal scroll bar for a bar chart made using dimplejs?
- How to add live data to stacked bar chart
- How do you add multiple lines to a D3JS line chart where the depedent variable data sources start at different positions along the range?
- Generating a simple bar chart with d3.js and an array of form data
- How to add a second tooltip, with data, from a data driven d3 chart
- D3 add data into array element inside setInterval() to draw grouped bar chart
- What's the best way to expose this data via JSON/Web Service?
- Simple d3.js bar chart is inverted when I add in .text()
- Add data values to D3.js bar chart in the middle or above
- D3 horizontal stacked bar chart add and remove data
- D3 Horizontal Bar Chart X-Axis Range shorter than in Data via AngularJs
- Add data in pie chart using D3
- d3 data selection for creating a simple chart
- Updating data in a simple reusable D3 chart
- In D3 Bubble Layout, Is there a way to listen to the name of a bubble and add interaction via jQuery?
- Best way to arrange data in a csv for multiline chart in d3 that has categories
- Effective way to display the data in the chart
- d3js - How to update an existing svg path in a simple d3 line chart with new data flowing through?
More Query from same tag
- D3 - Separate tooltip values for 2 line charts - using AngularJS
- Placement of .transition for lines in d3?
- Hiding one line on a D3 plot
- turning Strings into Text in Haskell
- Problem with label position with more than one nvd3 graph on one site
- d3.js v4: How to display an image after mouse click on a node
- D3.js ignores duplicate values
- D3: Multiple force layouts in one SVG?
- Pan UI to location of node in D3.js
- "export 'mouse' (imported as 'd3') was not found in 'd3'
- NVD3 example chart not showing
- dc.js / crossfilter dimensions (year / week)
- how to fix link transition for d3 tree
- Present same D3 Charts multiple times on a same html page
- D3 tooltip barely visible when using intro.js
- d3 graph in a div section
- How to display percentage to the d3.js piechart
- How do append a <text> for every element of the data in a D3 svg
- Non-hierarchical (without gaps between groups) bundle layout in D3
- How can I scale an SVG so that the content drawn in it to fit the container size?
- Conditionally appending based on nested data with D3
- d3v4 inverse bubble chart with animation/screen size adaptation
- Does Vega-Lite provide all the features that Vega provides?
- NVD3 Multibar default preselect certain bars
- Draw a path out gradually from the middle
- Trying to apply choropleth on Indian map
- Nearest-neighbor interpolation in canvas (internet explorer 9)
- Tooltip background color in d3 is only filling half
- d3 custom time interval
- How to adjust event.pageY to my new modal dialog?