1

i have dc.js chart with marker cluster all are linked together but my reset option(which i used to redraw the whole values again) is not working and there it is also not showing any console error.i am doing silly mistake here because my code is working properly,any one can suggest me what i am doing wrong here??

dataCount
            .dimension(ndx)
            .group(all);
//data table
        dataTable
            .dimension(allDim)
            .group(function (d) { return 'dc.js insists on putting a row here so I remove it using js'; })
            .size(100)
        marker
              .dimension(facilities)
              .group(facilitiesGroup)
              .width(600)
              .height(400)            
              .fitOnRender(true)
              .fitOnRedraw(true)
              .popupOnHover(true)
              .cluster(true);

        dc.renderAll(groupname);
          return {marker: marker};
d3.selectAll('a#year').on('click', function() {
            yearChart.filterAll();
            dc.redrawAll();
        });
d3.selectAll('a#all').on('click', function() {
            dc.filterAll();
            dc.renderAll();
            });

d3.selectAll('a#month').on('click', function() {
    monthChart.filterAll();
    dc.redrawAll();
  });
 dc.renderAll();
  • Hard to say without looking at a running example. The above looks correct to me (except that it looks like it got slightly mangled in copy/paste and there's a return statement before it installs any click handlers). Are your `a#` selectors correct, etc? – Gordon Apr 12 '17 at 14:40
  • btw you can use [`dataTable.showGroups(false)`](http://dc-js.github.io/dc.js/docs/html/dc.dataTable.html#showGroups__anchor) to get rid of the unwanted group rows. – Gordon Apr 12 '17 at 14:41
  • yes my a# selector is correct it was working well before.but when i added marker return statement ,the redraw option is not working now i am in trouble where to place this return statement??because when i placed it after redraw function then i losses the connectivity between map cluster and pie chart,so what should i do?? – user7843669 Apr 13 '17 at 04:40
  • I don't know what the rest of your code does, but a return statement is a hard stop. Nothing after it in the function will get executed. – Gordon Apr 13 '17 at 04:43
  • redraw function works when i have to reset all values of pie chart again,all modules of my code is working but when i click on this reset link(for this i used redraw function) which is not working.understand what i want to explain?? – user7843669 Apr 13 '17 at 04:47
  • you definitely need to move that return statement because nothing after it will execute. – Gordon Apr 13 '17 at 04:49
  • so where i have to placed it for linking my map with pie chart and also for redraw,please suggest?? – user7843669 Apr 13 '17 at 04:51
  • I dunno, you usually return at the end of a function. You've only posted part of your code so it's hard to tell. Can you create a fiddle? – Gordon Apr 13 '17 at 04:52
  • i added my code in fiddle,please check on https://jsfiddle.net/shivani_badodiya/ompusxez/ – user7843669 Apr 13 '17 at 05:54
  • I tried to remove return() from marker, the output is same as previous,but still redraw is not working. – user7843669 Apr 13 '17 at 06:31
  • Thanks for posting a fiddle! It's not working well enough for me to help you, since it doesn't load any libraries and the data is missing. Here is [a good way to include data in a fiddle](http://stackoverflow.com/a/22896088/676195) and you can get the External Resources you need from [this fiddle](http://jsfiddle.net/gordonwoodhull/u57bfje8/). I can already tell that the return statement is not needed - I don't know where you got that from, but in this case the function is just being passed to `d3.json`, and `d3.json` doesn't care what you return. – Gordon Apr 13 '17 at 14:57

0 Answers0