--
You received this message because you are subscribed to the Google Groups "dc-js user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/25e111b2-6ad9-4dd6-a83d-af0350e1544d%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/CF5F0FCF-B17A-4010-8E5D-BAB1BA9E7DA1%40woodhull.com.
--
You received this message because you are subscribed to the Google Groups "dc-js user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/636BF8C6-203A-4AB0-A789-C429C7778D15%40gmail.com.
On 22May, 2015, at 8:26 PM, Gordon Woodhull <gor...@woodhull.com> wrote:It's true, I didn't really address the general case. I think you are best off just defining a function which applies these overrides, and then calling the function for each chart. Since dc.js does not use prototypes, there is no way that I can think of to change the base behavior for all charts without changing the dc.js code. dc.override really only helps change a method in a way that the original is still accessible, so it probably isn't relevant here after all.
Your solution looks about as good as I would expect. You can probably replace [0][0] with .node() though.
Another possible approach so you don't need to do all this, is to add your header to the same div you pass to dc, since dc just appends an svg to the div. (Thinking inside the box, heh.)
--
You received this message because you are subscribed to the Google Groups "dc-js user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/D346CE26-F299-4257-9AD4-787ED9835794%40gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-us...@googlegroups.com.
On May 5, 2020, at 11:46 PM, Chris Wolcott <wooly...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/841595bb-691d-40bf-a379-78d736d2faba%40googlegroups.com.
class PieChartOV extends dc.PieChart {
// Override behavior of turn(On|Off)Controls
// By default the RESET and FILTER controls have to be placed in the CHART DIV.
// Because we are using KEEN Dashboards and BOOTSTRAP they look better in the
// TITLE DIV and thus we had to change the logic of where to find the controls.
// See https://groups.google.com/forum/#!topic/dc-js-user-group/h7cRqozt_Mc
// The original overrides were against dc.js v2 and also worked for v3
// dc.js v4 changed the architecture.
turnOnControls () {
if (this._root) {
const grandparent = this._root.node().parentNode.parentNode;
const attribute = this.controlsUseVisibility() ? 'visibility' : 'display';
d3.select(grandparent).selectAll('.reset').style(attribute, null);
d3.select(grandparent).selectAll('.filter').text(this._filterPrinter(this.filters())).style(attribute, null);
}
return this;
}
turnOffControls () {
if (this._root) {
const grandparent = this._root.node().parentNode.parentNode;
const attribute = this.controlsUseVisibility() ? 'visibility' : 'display';
const value = this.controlsUseVisibility() ? 'hidden' : 'none';
d3.select(grandparent).selectAll('.reset').style(attribute, value);
d3.select(grandparent).selectAll('.filter').style(attribute, value).text(this.filter());
}
return this;
}
}
var categoryPieChart = new PieChartOV('#chart_category');
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/841595bb-691d-40bf-a379-78d736d2faba%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/4b2aa001-490e-464e-8248-b9f18901681d%40googlegroups.com.
On May 6, 2020, at 10:22 PM, Chris Wolcott <wooly...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/2d58ec00-0156-4787-8b3b-fc3ce686bd80%40googlegroups.com.