Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ChartBars.GetBarIdxByX(chartControl, cursorPointX)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ChartBars.GetBarIdxByX(chartControl, cursorPointX)

    Hello,

    Something is strange. I did a for loop:

    Code:
    for(int barIndex = ChartBars.GetBarIdxByX(chartControl, cursorPointX); barIndex <= index1; barIndex++)
                    {
                    }
    When i click on the chart to know what bar is clicked i use
    Code:
      int clickedBarIndex = (ChartBars.GetBarIdxByX(chartControl, cursorPointX));
    and it return the right clicked bar. 4700

    But Printing barIndex in the for loop return the wrong bars. How is it possible?

    For exemple, clickedBarIndex = 4700 but the for loop return bars 4750 to 4800. 4800 is index1. It should return bars 4700 to 4800 ??

    Ty

    #2
    Hi frankduc, thanks for your question.

    You should try Printing the values from the for loop to make sure they are matching up with expectations. Print out the value of ChartBars.GetBarIdxByX(chartControl, cursorPointX) and that will confirm what the for loop is iterating on.

    I look forward to hearing from you.

    Comment


      #3
      my bad wrong variable at the wrong place

      Comment


        #4
        Just one thing bothering me.

        In
        Code:
        string textString = "BarsIndex:" + clickedBarIndex.ToString() + "\nTime:" + timeValue.ToString("H:mm:ss") + "\nclist:" + clist[c].ToString("N4");
        I can get in the chart the clist but color red is flashing turning pale red to bold red from time to time. Any idea why?

        Comment


          #5
          Hello frankduc, thanks for your reply.

          I apologize, I must ask for more context. What is clist and what component of the chart is turning different colors unexpectedly?

          I look forward to hearing from you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X