refresh_chart = function() {
let svg = create_svg("svg_chart", height);
svg.selectAll("g")
.data(["terms", "labels", "axes"])
.enter()
.append("g")
.attr("id", d => "g_chart_" + d);
let tooltip = d3.select("#tooltip");
if (tooltip.size() == 0) {
add_mouse_elements(svg);
}
let date_range = get_date_range(data);
let data_tmp = d3.filter(data, d => (d.start_date <= date_range[1]) && (date_range[0] <= d.end_date));
let x = get_x(data_tmp, date_range);
let y = get_y(data_tmp, [height - margin.bottom, margin.top]);
add_axis(svg.select("#g_chart_axes"), {label: "top", y_pos: margin.top}, x);
add_axis(svg.select("#g_chart_axes"), {label: "bottom", y_pos: height - margin.bottom}, x);
add_terms(svg.select("#g_chart_terms"), data_tmp, x, y);
add_term_labels(svg.select("#g_chart_labels"), data_tmp, x, y);
return svg.node();
}