PDA

View Full Version : Problem with Charts



MarkB2908
03-31-2021, 03:07 PM
So I'm building a dashboard and am working with Charts. With one of these (Line & Column on 2 axis) I change the source data programmatically, make some changes to formatting and then make the chart visible to the user.

The issue that I have is that for an instant, after changing the source data and making the chart visible, the previously selected data (and the columns that represent the previous data) is momentarily visible before the chart refreshes with the new source data. It's like an after-effect or after-image and can result in a column jumping from say 10% to 70% (albeit very quickly). It looks very 'glitchy'

I've tried various ways to work around this. One idea was to generate a new chart each time (from scratch) programmatically, so that there was no previous data to carry over when the chart is revealed. This time however, after making the chart visible and for a split second I can see what looks like a grey placeholder (a picture or an image of some grey columns) before the chart refreshes with the real data and real columns. Again its very quick but it still looks very glitchy.

Has anyone come across this before and found a wau to avoid / work around ?

Any help would be appreciated.

Dave
03-31-2021, 04:03 PM
Maybe just...

Application.ScreenUpdating = False
before the update and then returning it to True after the update? HTH. Dave
edit: vba - Refresh all charts without blinking - Stack Overflow (https://stackoverflow.com/questions/28582897/refresh-all-charts-without-blinking)

MarkB2908
03-31-2021, 04:57 PM
Maybe just...

Application.ScreenUpdating = False
before the update and then returning it to True after the update? HTH. Dave
edit: vba - Refresh all charts without blinking - Stack Overflow (https://stackoverflow.com/questions/28582897/refresh-all-charts-without-blinking)

Thanks Dave, Ive tried numerous combinations of screenupdating =false and screenupdating = true in a variety of different locations. Ive even employed variations of the following

Sub UTILITIES_RedrawScreen()
Dim ScreenUpdating As Boolean
ScreenUpdating = Application.ScreenUpdating

Application.ScreenUpdating = True
Application.WindowState = Application.WindowState
DoEvents

Application.ScreenUpdating = ScreenUpdating
End Sub

Nothing seems to work.

Paul_Hossler
03-31-2021, 06:14 PM
Can you attach a small sample workbook that shows the issue?

Please include instructions also