Al crear un gráfico de área en D3.js, cuando solo tiene un valor único, el gráfico no se representa.
Para fines de demostración, modifiqué el siguiente ejemplo: https://d3-graph-gallery.com/graph/area_basic.html para ilustrar el problema.
<script> // set the dimensions and margins of the graph var margin = {top: 10, right: 30, bottom: 30, left: 50}, width = 460 - margin.left - margin.right, height = 400 - margin.top - margin.bottom; // append the svg object to the body of the page var svg = d3.select("#my_dataviz") .append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); //Read the data d3.csv("https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/3_TwoNumOrdered_comma.csv", // When reading the csv, I must format variables: function(d){ return { date : d3.timeParse("%Y-%m-%d")(d.date), value : d.value } }, // Now I can use this dataset: function(data) { data = [data[0]] // Add X axis --> it is a date format var x = d3.scaleTime() .domain(d3.extent(data, function(d) { return d.date; })) .range([ 0, width ]); svg.append("g") .attr("transform", "translate(0," + height + ")") .call(d3.axisBottom(x)); // Add Y axis var y = d3.scaleLinear() .domain([0, d3.max(data, function(d) { return +d.value; })]) .range([ height, 0 ]); svg.append("g") .call(d3.axisLeft(y)); // Add the area svg.append("path") .datum(data) .attr("fill", "#cce5df") .attr("stroke", "#69b3a2") .attr("stroke-width", 1.5) .attr("d", d3.area() .x(function(d) { return x(d.date) }) .y0(y(0)) .y1(function(d) { return y(d.value) }) ) }) </script>Esperaría que el gráfico se viera algo como:
Si inspecciona el elemento, el elemento de ruta puede ver que se está representando, solo 0 ancho/alto: