Home Forums WinForms controls Xceed Chart for WinForms X-Y Scatter Chart Data Labels Subset

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19213 |

    screen capture

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Can you tell me how the DataLabels.Subset() is supposed to work?

     If the image above works correctly… I have 50 data points of live data moving in the direction of the arrow.

    When setting my DataLabels to visible, the LAST data point gets the label and not the first.

    My code for enabling the Data Labels is pasted into the image.

    How do I need to do this in order to have the FIRST data point get the label?

    Imported from legacy forums. Posted by James (had 1876 views)

    User (Old forums)
    Member
    Post count: 23064

    This was emailed – the image didn’t post.

    Imported from legacy forums. Posted by James (had 392 views)

    Xceed Support
    Member
    Post count: 5658

    Hi James, 

    The Subset contains the indexes in which labels will be displayed. 

    You can simply change the index on which you want the datalabel to be displayed. 

    You can find an example in the Char explorer samples, check the “Series Attributes” / “Data Labels” sample. Choose “Subset” from the combobox on the right under “mode” and click on “Show at min value” and “Show at max value” to see how the labels get added.

    the code behind was something like this:

        private void ShowAtMinValue_Click(object sender, System.EventArgs e)

        {

          m_Bar.DataLabels.Subset.AddIndex(m_Bar.Values.FindMinValue());    

          m_ChartControl.Refresh();

        }

        private void ShowAtMaxValue_Click(object sender, System.EventArgs e)

        {

          m_Bar.DataLabels.Subset.AddIndex(m_Bar.Values.FindMaxValue());

          m_ChartControl.Refresh();

        }

     

    Imported from legacy forums. Posted by Michel [Xceed] (had 196 views)

    User (Old forums)
    Member
    Post count: 23064

    Looking at the example, I don’t think your response is what I am trying to do.

    I don’t care what the minimum or maximum values are. I want a data label on the first data point that gets displayed, regardless of the value. Right now, I am getting a data label on the last data point.

    On the example, if I select every and set the interval to the amount of data points, it gives the appearance I want. Is this going to be my solution?

     tks

    Jim Mahaffey

    Imported from legacy forums. Posted by James (had 340 views)

    Xceed Support
    Member
    Post count: 5658

    Yes, 

    I would guess it is. You need to set the correct index, and since zero is giving you the first point, then the count of the data points you have should do the opposite.

    If that doesn’t solve your issue, we would need to see your sample application  to investigate in more detail. 

    Imported from legacy forums. Posted by Michel [Xceed] (had 180 views)

    User (Old forums)
    Member
    Post count: 23064

    Using Subset, I pass the queue size -1. It now gives me the data label on the lead data point.

    [:D] 

    Imported from legacy forums. Posted by James (had 3034 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.