Consulting

Results 1 to 9 of 9

Thread: Solved: Position show values on chart

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location

    Solved: Position show values on chart

    Hi everyone,

    I have 2 line charts and I update it on a weekly bases. I choose to show the values on the line charts. But when I update the chart the values gets shifted. If possible when I enter the
    values in the cells it will position the values just above the data point. But here is the kicker if the values is less than the previous data point then it will position just under the data point. Is that possible?

    I have attach the sample file below.

     
    Private Sub Chart_Calculate() 
        Dim intSeries As Integer 
        Dim intPoint As Integer    
        With ActiveChart 
           For intSeries = 1 To .SeriesCollection.Count 
               With .SeriesCollection(intSeries) 
                   Select Case intSeries ' may need to extend cases 
                   Case 1 
                       .Interior.ColorIndex = 41 
                   End Select 
                   .ApplyDataLabels 
                   .DataLabels.Position = xlLabelPositionInsideEnd 
                   .DataLabels.Font.Bold = True 
                   For intPoint = 1 To .Points.Count 
                       End Select 
                       .DataLabels(intPoint).Top = .DataLabels(intPoint).Top - 20 
                   Next 
               End With 
           Next 
        End With 
    End Sub
    Last edited by Shazam; 03-17-2006 at 08:17 AM.

Posting Permissions

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