Pre loader

Display numbers in the graphic bars

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hello,

I’m trying to display the value of the bars in the Market Profile chart. I was trying to add a text for each bar created but I don’t know where to find the surface position to instantiate the text.

This is the part of the code where the bars are created.

for (int i = 0; i < ticksPerCandle; i++)
            {
                _index++;

                volume = _random.Next(100);
                bidOrAsk = _random.Next(2) == 0 ? BidOrAsk.Bid : BidOrAsk.Ask;

                //date = date;
                var newTick = _data[_index];
                var open = _dataSeries0.OpenValues[_candleCount - 1];
                high = _dataSeries0.HighValues[_candleCount - 1];
                high = high > newTick ? high : newTick;

                low = _dataSeries0.LowValues[_candleCount - 1];
                low = low < newTick ? low : newTick;

                var meta = (CandlestickMetaData)_dataSeries0.Metadata[_candleCount - 1];

                meta.AddTick(new CandleTick
                {
                    BidOrAsk = bidOrAsk,
                    Price = newTick,
                    Volume = volume,
                    TimeStamp = date
                });

This is how it should look like

Version
v6
  • You must to post comments
0
0

Hi! I did some research and I thought some options.
Is there any way to add an annotation in the CandlestickMetaData?

The horizontal bars are generated with the AddTick() function of the CandlestickMetaData. I couldn’t find any property to grab the exact X and Y coordinates to instantiate a text or annotation.

This is how the horizontal bars are created

var meta = (CandlestickMetaData)_dataSeries0.Metadata[_candleCount - 1];
 meta.AddTick(new CandleTick
                {
                    BidOrAsk = bidOrAsk,
                    Price = newTick,
                    Volume = volume,
                    TimeStamp = date
                });

Also, I don’t know if annotations are the best way to approach this problem. So maybe it’s possible to add a text block but I have the same problem to find the XY coordinates.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies