|
-
Apr 8th, 2008, 11:45 AM
#1
Excel Line Color??
Yes, yet another thread on Excel 2007/VS 2008/VSTO. I simply cannot change the line color on my charts. The below changes all work except the forecolor and backcolor properties. It loops through the series collection, setting the series line properties. What am I doing wrong??
Code:
MySeriesColl = MyChart.SeriesCollection 'required or else second series overwrites first one?
For Each MySeries As Excel.Series In MySeriesColl
MySeries.Format.Line.DashStyle = Microsoft.Office.Core.MsoLineDashStyle.msoLineSolid
MySeries.Format.Line.Weight = "1"
MySeries.Format.Line.Style = Microsoft.Office.Core.MsoLineStyle.msoLineSingle
MySeries.Format.Line.ForeColor.RGB = Drawing.Color.Black.ToArgb
MySeries.Format.Line.BackColor.RGB = Drawing.Color.Black.ToArgb
Next
P.S. Should these threads be moved to the .NET forum? Or keep them here...
-
Apr 8th, 2008, 11:52 AM
#2
Re: Excel Line Color??
Does this help?
'Please change values in the bracket for the resp color
MySeries.Format.Line.ForeColor.RGB = RGB(255, 127, 0)
Same for the backcolor...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Apr 8th, 2008, 01:03 PM
#3
Re: Excel Line Color??
No, that still has no effect. No matter what I try, that property doesn't seem to do anything.
-
Apr 8th, 2008, 01:28 PM
#4
Re: Excel Line Color??
Try This in your code in this sequence
MySeries.Border.Color = RGB(255, 127, 0)
MySeries.Format.Line.ForeColor.RGB = RGB(255, 127, 0)
Last edited by Siddharth Rout; Apr 8th, 2008 at 01:32 PM.
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Apr 8th, 2008, 02:27 PM
#5
Re: Excel Line Color??
There is no Border property of the Excel.Series interop object in .NET
-
Apr 8th, 2008, 02:44 PM
#6
Re: Excel Line Color??
 Originally Posted by gigemboy
There is no Border property of the Excel.Series interop object in .NET
Strange?
http://technet.microsoft.com/en-us/l.../cc179160.aspx
Border property has to be there for charts be it excel 97 or 2003 or 2007. (i could be wrong)
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Mar 24th, 2014, 09:25 AM
#7
Addicted Member
Re: Excel Line Color??
An old thread, but this has just worked for me - I'm looping through all the series and setting the colour depending on which series:
Code:
Select Case .SeriesCollection.count
Case 1
.SeriesCollection(.SeriesCollection.count).border.color = Microsoft.Office.Interop.Excel.XlRgbColor.rgbRed
Case 2
.SeriesCollection(.SeriesCollection.count).border.color = Microsoft.Office.Interop.Excel.XlRgbColor.rgbBlack
Case 3
.SeriesCollection(.SeriesCollection.count).border.color = Microsoft.Office.Interop.Excel.XlRgbColor.rgbGreen
Case 4
.SeriesCollection(.SeriesCollection.count).border.color = Microsoft.Office.Interop.Excel.XlRgbColor.rgbBlue
End Select
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|