Skip to content

I want to divide the upper and lower colors into plus and minus, starting from 0. #1713

Closed Answered by KAJI-JAPAN
KAJI-JAPAN asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to solve this problem by setting 0 to y0 in Threshold

 <Threshold
              id={"1"}
              data={data}
              x={(d) => timeScale(d.date)}
              y0={profitScale(0)}
              y1={(d) => positiveScale(Math.max(0, d.value))}
              clipAboveTo={0}
              clipBelowTo={yMax + 100}
              curve={curveBasis}
              belowAreaProps={{
                fill: "red",
                fillOpacity: 0.4,
              }}
              aboveAreaProps={{
                fill: "blue",
                fillOpacity: 0.4,
              }}
            />

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KAJI-JAPAN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant