PC Review


Reply
Thread Tools Rate Thread

How to change weight of line in XY chart

 
 
choi1chung1gm@gmail.com
Guest
Posts: n/a
 
      1st May 2007
Dear Experts

This macro works fine and plots the xy graph using four columns of
data in sheet1. How can I change the weight of the line for series (1)
from xlThin to xlThick ? I tried using the .SeriesCollection(1).Weight
= xlThick but it did not work. Please help.

thanks

Choi


Sub plotgraph()

'***********START graph plot***********
Sheets("sheet1").Activate
Cells(1, 1).Select
'Lastrow = Cells(Rows.Count, 1).End(xlUp).Row
Lastrow = 20000
StartRow = 10

With ActiveSheet.ChartObjects.Add _
(Left:=6, Width:=228, _
Top:=Cells(StartRow, 1).Top, Height:=240)
With .Chart
.ChartType = xlXYScatterSmoothNoMarkers
.SetSourceData Source:=Sheets("Sheet1") _
.Range(Cells(1, 1), Cells(Lastrow, 2)), PlotBy _
:=xlColumns
.HasLegend = True
.SeriesCollection(1).Name = "=""data1"""
.HasTitle = True
.ChartTitle.Characters.Text = "mydata"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "t(s)"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Pr(kPa)"
.Legend.Position = xlTop
.ChartArea.AutoScaleFont = False
.ChartArea.Font.Size = 8
.PlotArea.Interior.ColorIndex = xlNone
.SeriesCollection.NewSeries
.SeriesCollection(2).XValues = Sheets("Sheet1"). _
Range(Cells(1, 3), Cells(Lastrow, 3))
.SeriesCollection(2).Values = Sheets("Sheet1"). _
Range(Cells(1, 4), Cells(Lastrow, 4))
.SeriesCollection(2).Name = "=""data2"""
.PlotArea.Width = 220
.PlotArea.Height = 160
.PlotArea.Left = 16
.PlotArea.Top = 40
End With
End With

'***********END graph plot***********

End Sub

 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      1st May 2007
Hi Choi,

..SeriesCollection(1).Border.Weight = xlThick

Regards,
Peter T

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear Experts
>
> This macro works fine and plots the xy graph using four columns of
> data in sheet1. How can I change the weight of the line for series (1)
> from xlThin to xlThick ? I tried using the .SeriesCollection(1).Weight
> = xlThick but it did not work. Please help.
>
> thanks
>
> Choi
>



 
Reply With Quote
 
choi1chung1gm@gmail.com
Guest
Posts: n/a
 
      1st May 2007
thank you very much Peter. It worked !!

Choi

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      1st May 2007
Next time, do it yourself while recording a macro. That's probably what
Peter did, and what I would have done if he hadn't already answered.. You'll
get the syntax correct in two seconds.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> thank you very much Peter. It worked !!
>
> Choi
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Line weight of the chart? Al Campagna Microsoft Access Reports 0 15th Dec 2006 12:08 AM
Create excel chart from LotusScript, change xlLine line weight =?Utf-8?B?Um95IFJ1bWFuZXI=?= Microsoft Excel Programming 2 2nd Mar 2006 03:33 AM
Weight loss line chart to monitor weight loss progress =?Utf-8?B?UyBGb3g=?= Microsoft Excel Charting 6 8th Nov 2005 05:10 PM
How can i change the default line weight in an excel chart =?Utf-8?B?TlBH?= Microsoft Excel Charting 1 30th Mar 2005 03:57 AM
How can i change the default line weight in an excel chart =?Utf-8?B?TmlnZWw=?= Microsoft Excel Charting 0 30th Mar 2005 03:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:31 AM.