this should work and is simple to implement. without it being a coded method I would suggest:
remove the permission from list A.
so its visible to all.
on the list click on site actions and edit. This will edit the page for the current default list view called allitems.aspx
you should see the list as a webpart. top right of the webpart click on the drop down to edit the webpart properties -> to the right of the page on the webpart properties click on the advanced tab and expand -> where it says target audience put in the restricted sharepoint group that you want to give access.
once done click ok and save/checkin page
allitems.aspx now has a restricted view of the list that is only visible to a specific sharepoint group like before.
create a custom view on list A. my example I will call it lvA. show what you want like on list B but do it for list A. Set the count like you did for list B but on list A instead.
click ok when finished to create the view. it will redirect you back to the list but this time showing you the new custom list view - look at the url it should say the list view name and has a prefix of .aspx
once your on that page edit the page -> site actions -> edit.
on the webpart for that view edit its properties -> top right of webpart click the drop down and edit properties -> right side you should see its properties -> under advanced tab you can set the audience targeting to the default site viewers group that should have read only -> make sure everyone is in that group or create a new security group that contains all users. click ok and save/check in page.
so you now have two list views for list A. one of them is lvA that gives a view to all users to read from the list and the other is allItems which is the default view that is restricted to a specific group.
now within your chart you can use your new view in my case lvA that should display what ever I want from list A.
hope I make sense, seems like a lot but its not. let me know how you get on.