Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a scatter graph with a few thousand points linked with a smoothed
line. To change the color, the width and the dash style to the points from Rini to Rfin-1 I wrote this loop: For r = Rini To Rfin - 1 With GRA.SeriesCollection(1).Points(r).Format.Line .ForeColor.RGB = colore .Weight = W .DashStyle = dash End With Next but it's terribly slow. Is there any way to speed it up? Thank you Cristiano |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Cristiano" wrote in message I have a scatter graph with a few thousand points linked with a smoothed line. To change the color, the width and the dash style to the points from Rini to Rfin-1 I wrote this loop: For r = Rini To Rfin - 1 With GRA.SeriesCollection(1).Points(r).Format.Line .ForeColor.RGB = colore .Weight = W .DashStyle = dash End With Next but it's terribly slow. Is there any way to speed it up? Apply the format for the greatest number of points in one go, something like Dim sr As Series Dim pts As Points Set sr = GRA.SeriesCollection(1) Set pts = sr.Points ' if Rini To Rfin -1 is most of the points With sr .ForeColor.RGB = colore .Weight = W .DashStyle = dash End With For i = 1 to pts.count if i < Rini or i Rfin Then With pts(i) ' apply the other format End With End If Next Peter T |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 26/08/2017 13:31, Peter T wrote:
Apply the format for the greatest number of points in one go, something like [...] ' if Rini To Rfin -1 is most of the points Unfortunately, it's not the case. For i = 1 to pts.count if i < Rini or i Rfin Then With pts(i) ' apply the other format End With End If Next It's not clear to me why you put the 'if' inside the 'for'. Cristiano |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Cristiano" wrote in message On 26/08/2017 13:31, Peter T wrote: Apply the format for the greatest number of points in one go, something like [...] ' if Rini To Rfin -1 is most of the points Unfortunately, it's not the case. In that case maybe even working with a direct reference to .Points as I suggested might help a bit With pts(r).Format.Line v With GRA.SeriesCollection(1).Points(r).Format.Line For i = 1 to pts.count if i < Rini or i Rfin Then With pts(i) ' apply the other format End With End If Next It's not clear to me why you put the 'if' inside the 'for'. The original idea was to apply formats to the entire SerisCollection first, then apply a different format (the original perhaps) to the smaller number of other points. So the 'If' was to exclude and not format points between Rini and Rfin in the loop of all points. If only to visually convey the data do you need to show 1000s of points, would say showing every 5th point show virtually the same. If there might be outliers between every 5th point could also include these. Just a thought. Peter T |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 26/08/2017 17:27, Peter T wrote:
"Cristiano" wrote in message On 26/08/2017 13:31, Peter T wrote: Apply the format for the greatest number of points in one go, something like [...] ' if Rini To Rfin -1 is most of the points Unfortunately, it's not the case. In that case maybe even working with a direct reference to .Points as I suggested might help a bit With pts(r).Format.Line v With GRA.SeriesCollection(1).Points(r).Format.Line Yes, it helped a bit, thank you. For i = 1 to pts.count if i < Rini or i Rfin Then With pts(i) ' apply the other format End With End If Next It's not clear to me why you put the 'if' inside the 'for'. The original idea was to apply formats to the entire SerisCollection first, then apply a different format (the original perhaps) to the smaller number of other points. So the 'If' was to exclude and not format points between Rini and Rfin in the loop of all points. If only to visually convey the data do you need to show 1000s of points, would say showing every 5th point show virtually the same. If there might be outliers between every 5th point could also include these. Just a thought. Step 5 is too much, but step 2 seems good. Thanks a lot Cristiano |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing line weight in plot | Charts and Charting in Excel | |||
Changes to Plot area color | Charts and Charting in Excel | |||
changing the x axis in a scatter plot | Charts and Charting in Excel | |||
Changing Plot Window | Charts and Charting in Excel | |||
Changing plot area under macro | Excel Programming |