Reputation: 73
I'm using echarts-for-react to display a candle stick chart and sometimes when the interval is too small. I'm getting candle sticks that are too small. I try to set the yAxis min and max value but it didn't work.
any help?
here's my code
const option = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
},
},
axisPointer: {
link: [{ xAxisIndex: "all" }],
},
xAxis: {
data: state?.times?.map?.(i => new Date(i)).map(a => new Intl.DateTimeFormat().format(a)),
splitLine: { show: false },
axisLine: { show: false },
axisTick: { show: false },
},
yAxis: {
splitLine: {
show: false,
min: min || 0,
max: max || 0,
},
},
grid: {
left: 0,
},
dataZoom: [
{
type: "inside",
minValueSpan: 10,
},
],
series: [
{
type: "candlestick",
data: state?.prices,
},
],
};
<EChartsReact
option={option}
className="react-charts-custom"
style={{ height: "600px" }}
/>
Upvotes: 0
Views: 157
Reputation: 73
As @Matthais Mertens mentioned in the comments seting scale: true
solves the issue
Upvotes: 0