.domain([0,d3.max(data2,d=>d.Horaminuto)])// requiere un dominio 0 -> max(cantidad)
.range([margin2.left,width-margin2.right])// y un rango en la gráfica: márgenes laterales
d3.max(data2,d=>d.Horaminuto)
y2=d3.scaleBand()// Escala por bandas
.domain(data.map(d=>d.Location))// requiere un dominio (nombres de frutas)
.range([margin2.top,height2-margin2.bottom])// y un rango en la gráfica: márgenes sup/inf
//.padding(0.1)
radio=d3.scaleLinear()// Escala lineal
.domain([d3.min(data2,d=>d.Compras),d3.max(data2,d=>d.Compras)])// requiere un dominio 0 -> max(cantidad)
.range([2,10])// y un rango en la gráfica: márgenes laterales
height2=570
margin2=({top:15,right:0,bottom:30,left:140})
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.