LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to change weight of line in XY chart

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Box Line Weight - Excel 2007 RAH[_2_] Excel Discussion (Misc queries) 2 July 14th 07 12:46 AM
Create excel chart from LotusScript, change xlLine line weight Roy Rumaner Excel Programming 2 March 2nd 06 03:33 AM
Weight loss line chart to monitor weight loss progress S Fox Charts and Charting in Excel 6 November 8th 05 05:10 PM
How can i change the default line weight in an excel chart NPG Charts and Charting in Excel 1 March 30th 05 03:57 AM
How can i change the default line weight in an excel chart Nigel Charts and Charting in Excel 0 March 30th 05 03:38 AM


All times are GMT +1. The time now is 06:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"