Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Nov 2015
    Posts
    17
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Regression label position

    I'm using a spinner control to select and plot various datasets in a scatterplot. The plot also displays a regression line. The label (blue, equation and R^2 values) moves as the data changes. Is it possible to lock the position of the label in fixed position?
    hole 6 position.pnghole 8 position.png

  2. #2
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,643
    Thanks
    115
    Thanked 652 Times in 594 Posts
    Zeno,

    If this is a chart sheet with the data coming from a table on another sheet, then in the Chart Sheet's module, paste the following code. Change the index of the series and the top/left position values. The code will keep the trendline label in the postion that you set when the chart updates.

    Code:
    Private Sub Chart_Calculate()
    With ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel
        .Left = 50 'ADJUST
        .Top = 50 'ADJUST
    End With
    End Sub
    HTH,
    Maud

  3. The Following User Says Thank You to Maudibe For This Useful Post:

    _Zeno_ (2016-11-22)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •