Results 1 to 2 of 2
  1. #1
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    408

    Change label on charts

    Hi, i want to change the label in a modern chart, you can see everything from the DB attached.
    Thanks



    EDITED the db
    Attached Files Attached Files

  2. #2
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    408
    FOUND IT!!

    Code:
    Private Sub Report_Open(Cancel As Integer)   Dim objchart As Chart
       Dim Values As String
       Dim CV As Object
       
     
       
       Set objchart = Me.StockGR
       Set DB = CurrentDb
       
       Set rs = DB.OpenRecordset("SELECT DISTINCT azienda FROM qryAssoreti_Stock")
    
    
       If rs.RecordCount > 0 Then rs.MoveFirst
          Do Until rs.EOF
             If Values = "" Then
                Values = Values & "[" & rs!Azienda & "]"
             Else
                Values = Values & ";[" & rs!Azienda & "]"
             End If
             rs.MoveNext
          Loop
       
    
    
       With objchart
         .ChartTitle = "Livelli di stock per trimestre"
         .RowSource = "qryAssoreti_StockXGrafico"
         .ChartAxis = "data"
         .ChartValues = Values '"[Azimut Consulenza Per Investimenti Sim Spa];[FIDEURAM - INTESA SANPAOLO PRIVATE BANKING SPA]"
         .PrimaryValuesAxisFormat = "currency"
         '.ChartLegend = "[Azimut Consulenza Per Investimenti Sim Spa]"
         .HasLegend = True
          'Set CV = .ChartValuesCollection
    
    
          Set CV = .ChartSeriesCollection
          For Each CV In .ChartSeriesCollection
          
             CV.DisplayName = Replace(CV.DisplayName, "SumOf", "")
            .HasLegend = True
    
    
         Next
    
    
       End With
       rs.Close
       Set rs = Nothing
       Set DB = Nothing
    
    
       
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. I need to change the caption in a label
    By UT227 in forum Reports
    Replies: 3
    Last Post: 05-01-2022, 10:34 AM
  2. Change Label on Form
    By jmitchelldueck in forum Programming
    Replies: 2
    Last Post: 08-24-2015, 07:28 AM
  3. Replies: 2
    Last Post: 05-17-2015, 04:05 PM
  4. Change size of Label
    By amerifax in forum Access
    Replies: 1
    Last Post: 10-17-2012, 06:18 PM
  5. Change of label size
    By Zoroxeus in forum Programming
    Replies: 0
    Last Post: 06-11-2007, 08:18 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
  •  
Other Forums: Microsoft Office Forums