如何关闭 dc.js 图表的交互性?
How do I turn the interactivity off with dc.js charts?
鉴于此 fiddle
如何关闭 dc.js 图表的交互性?
例如,当单击图表上的任何位置时,我不希望发生任何事情。
我想让 on:hover 选项继续工作,即当您将鼠标悬停在图表上时,会出现一个带有基础值的标签
我已经尝试过 .turnOnControls(true)
但没有任何乐趣 .brushOn :
yearRingChart
.width(200).height(200)
.dimension(yearDim)
.group(spendPerYear)
.turnOnControls(true)
.innerRadius(50);
注意 我似乎不太擅长阅读 documentation 所以任何指点都将不胜感激。
编辑1
我已经尝试 .brushOn(false)
但我在控制台中得到 .brushOn is not a function
。可能是我用的不对?
yearRingChart
.width(200).height(200)
.dimension(yearDim)
.group(spendPerYear)
.brushOn(false)
.innerRadius(50);
编辑2
这就是答案fiddle, basically had to add this per chart yearRingChart.filter = function() {};
taken from this duplicate question
yearRingChart
.width(200).height(200)
.dimension(yearDim)
.group(spendPerYear)
.innerRadius(50);
yearRingChart.filter = function() {};
spenderRowChart
.width(250).height(200)
.dimension(nameDim)
.group(spendPerName)
.elasticX(true);
dc.renderAll();
spenderRowChart.filter = function() {};
编辑2
这就是答案fiddle, basically had to add this per chart yearRingChart.filter = function() {};
taken from this duplicate question
yearRingChart
.width(200).height(200)
.dimension(yearDim)
.group(spendPerYear)
.innerRadius(50);
yearRingChart.filter = function() {};
spenderRowChart
.width(250).height(200)
.dimension(nameDim)
.group(spendPerName)
.elasticX(true);
dc.renderAll();
spenderRowChart.filter = function() {};
鉴于此 fiddle
如何关闭 dc.js 图表的交互性? 例如,当单击图表上的任何位置时,我不希望发生任何事情。
我想让 on:hover 选项继续工作,即当您将鼠标悬停在图表上时,会出现一个带有基础值的标签
我已经尝试过 .turnOnControls(true)
但没有任何乐趣 .brushOn :
yearRingChart
.width(200).height(200)
.dimension(yearDim)
.group(spendPerYear)
.turnOnControls(true)
.innerRadius(50);
注意 我似乎不太擅长阅读 documentation 所以任何指点都将不胜感激。
编辑1
我已经尝试 .brushOn(false)
但我在控制台中得到 .brushOn is not a function
。可能是我用的不对?
yearRingChart
.width(200).height(200)
.dimension(yearDim)
.group(spendPerYear)
.brushOn(false)
.innerRadius(50);
编辑2
这就是答案fiddle, basically had to add this per chart yearRingChart.filter = function() {};
taken from this duplicate question
yearRingChart
.width(200).height(200)
.dimension(yearDim)
.group(spendPerYear)
.innerRadius(50);
yearRingChart.filter = function() {};
spenderRowChart
.width(250).height(200)
.dimension(nameDim)
.group(spendPerName)
.elasticX(true);
dc.renderAll();
spenderRowChart.filter = function() {};
编辑2
这就是答案fiddle, basically had to add this per chart yearRingChart.filter = function() {};
taken from this duplicate question
yearRingChart
.width(200).height(200)
.dimension(yearDim)
.group(spendPerYear)
.innerRadius(50);
yearRingChart.filter = function() {};
spenderRowChart
.width(250).height(200)
.dimension(nameDim)
.group(spendPerName)
.elasticX(true);
dc.renderAll();
spenderRowChart.filter = function() {};