task done
This commit is contained in:
@@ -129,22 +129,9 @@ const ChartDraw = (props) => {
|
||||
};
|
||||
|
||||
// вычисляем ширину и высоту области для вывода графиков
|
||||
const boundsWidth = width - margin.left - margin.right;
|
||||
const boundsHeight = height - margin.top - margin.bottom;
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if(boundsWidth<0||boundsHeight<0){
|
||||
return;
|
||||
}
|
||||
const svg = d3.select(chartRef.current);
|
||||
// выводим прямоугольник,
|
||||
svg
|
||||
.append("rect")
|
||||
.attr("x", margin.left)
|
||||
.attr("y", margin.top)
|
||||
.attr("width", boundsWidth)
|
||||
.attr("height", boundsHeight)
|
||||
.style("fill", "lightgrey");
|
||||
// console.log(props)
|
||||
drawGraph(props.data,props.ox,props.minMax[0],props.minMax[1],Number(props.graphType))
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user