Skip to content

How to draw a label on horizontal line on chart #704

Answered by dnjsgur0629
dnjsgur0629 asked this question in Q&A
Discussion options

You must be logged in to vote

This was possible by using the yAxisPad prop of the EdgeIndicator component.

        {orders.map((order) => {
          const { price, side, quantity } = order
          const color= side === 'buy' ? 'green' : 'red'
          return (
            <>
              <StraightLine
                yValue={price}
                lineDash={'ShortDash2'}
                strokeStyle={color}
              />
              <EdgeIndicator
                hideLine
                itemType={'first'}
                edgeAt={'left'}
                yAccessor={() => price}
                fill={'black'}
                stroke={color}
                textFill={color}
                displayFormat={() => `L…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dnjsgur0629
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