我想使用图表和图形来可视化 data.Need 一些建议,因为我使用的 D3js 没有响应

I want to use charts and graphs for visualizing data.Need some recommendation as D3js that I am using is not responsive

是否有任何开源 框架来可视化大多数子弹 charts/Gantt 图表/条形图和折线图中的数据。我现在正在使用 d3.js,但它没有响应。是否有任何其他框架可以给我以上所有图表并且还需要响应,或者有什么方法可以使 D3 响应。

我知道使 D3 响应的两种方法:

1) 检查 window 调整大小事件。 基本上,当 window 调整大小时,您删除图表并根据新尺寸重新绘制它们。

d3.select(window).on("resize",resize);

        function resize() {
            /* resetting the entire visualisation, the svg's and other added elements */
            d3.selectAll("svg").remove();
            d3.selectAll(".graphline").remove();
            d3.select("#namerow").remove();

            *function to redraw everthing*
        }

在绘图函数中,您可以捕获 window 的宽度,如下所示:

var chartWidth = parseInt(divParentContainer.style("width"),10);
var chartHeight = chartWidth * 0.8; // 0.8 can be seen as width-height ratio

2) 检查 this page 上的答案。在我个人看来,这种方式是最简单的。