/** * Manually tweak row chart's properties using the dc.js API directly. * DC.js API docs can be found here: http://dc-js.github.io/dc.js/docs/html/dc.rowChart.html * 2017-0303 Piotr Szrajber <piotr.szrajber@hexagongeospatial.com> */functionsetRowChartProperties(){// wait until thw widgets are renderedif(!document.querySelector(".bi-widget .widget-chart svg")){setTimeout(setRowChartProperties,500);}// gsp.ready("v1.0", function(gsp) { /* uncomment if using in browser's javascript console */// find all row chartsgsp.bi.stage.findWidgets({descriptors:[{chartM:{chart:"row"}}]},function(widgets){varfirstRowChart=widgets[0].chart;// prevent xAxis from dynamical rescalingfirstRowChart.elasticX(false);// manually set x Axis propertiesfirstRowChart.x(d3.scale.linear().range([0,100]).domain([0,100]));firstRowChart.xAxis().scale(firstRowChart.x());// manually set ticksfirstRowChart.xAxis().ticks(4);firstRowChart.redraw();});}setRowChartProperties();
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.