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

    Sorting and color of charts

    Hi, can i sort the legendt? values are not sorted
    Click image for larger version. 

Name:	1.png 
Views:	18 
Size:	31.8 KB 
ID:	50794

    ps can i change colors with vba?



    ---------------------------
    in the following bar chart, values are not sorted as in the query

    Code:
    SELECT count(Cliente) AS [N° clienti], Sum(totale) AS [Totale portafoglio], trasferibile, switch([trasferibile]="negativo",1,[trasferibile]="improbabile",2,[trasferibile]="possibile",3,[trasferibile]="probabile",4,[trasferibile]="sicuro",5) AS TrasferibileNumFROM qryportafoglio
    GROUP BY trasferibile
    ORDER BY switch([trasferibile]="negativo",0,[trasferibile]="improbabile",2,[trasferibile]="possibile",3,[trasferibile]="probabile",4,[trasferibile]="sicuro",5) DESC;
    i made a numeric custom field cause i want to give a specific order and not an alphabetical one. "Negativo" should be the last

    Click image for larger version. 

Name:	2.png 
Views:	16 
Size:	12.1 KB 
ID:	50793
    thanks
    Attached Thumbnails Attached Thumbnails 1.png  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I doubt it.

    I would probably build a legend "graphic" with textboxes and labels or a graphic app like Paint.

    Should be able to change colors - at least I have played with that using classic MSGraph https://www.accessforums.net/showthread.php?t=29178. If you are using Modern Chart, I have no idea.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    ok thanks.
    If i figure out how to achieve that i'll show my results

  4. #4
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    Click image for larger version. 

Name:	Immagine 2023-09-21 005009.png 
Views:	10 
Size:	24.0 KB 
ID:	50798

    I used the initial letter to sort the legend. It's already ok but i'm wondering, is it possible to use HTML format to make the first letter transparent?
    with something like that: <p style="background-color:Tomato;">"1 <100" </p>? for every values? cause this is the part of the query i set those values

    Code:
     Switch([totale]<100000,"<100k",[totale] Between 100000 And 299999,"100k-300k",[totale] Between 300000 And 499999,"300k-500k",[totale] Between 500000 And 699999,"500k-700k",[totale] Between 700000 And 1000000,"700k-1mln",[totale] Between 1000000 And 1999999,"1mln-2mln",[totale] Between 2000000 And 4999999,"2mln-5mln",[totale] Between 5000000 And 9999999,"5mln-10mln",[totale]>=10000000,">=10ml") AS [Taglio cliente]



  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I should have said "I doubt it without modifying data".

    Now I have to say No - Access can only process HTML in a Rich Text textbox and WebBrowser control.

    The posted code does not show letter prefixes.
    Last edited by June7; 09-20-2023 at 10:12 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    ok you're right.

    yes, i posted the old sql, actually is just with the letter before the label.
    Ok, i think it's enough for me this solution
    thanks

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

Similar Threads

  1. Replies: 3
    Last Post: 03-06-2023, 12:31 PM
  2. Replies: 3
    Last Post: 07-01-2020, 03:29 AM
  3. Replies: 3
    Last Post: 02-23-2019, 06:10 PM
  4. Change Text color and/or background color
    By Thompyt in forum Reports
    Replies: 2
    Last Post: 02-23-2017, 07:08 PM
  5. Replies: 2
    Last Post: 05-17-2015, 04:05 PM

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