ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Chart (https://www.excelbanter.com/excel-programming/361877-chart.html)

m26498130

Chart
 

Hi all,

Is it possible to code for a chart comparing average value of
different fields in a sheet without adding a new field in that shee
for the sum/average values?

To draw the chart, currently I use this code:

Set shtRep3.Name = "Report3"

POPULATEDATA (\"REPORT3\"

shtRep3.Range("A1:B4").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets(strFruitName).Range("A1:B4")
PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Report3"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Completion Time"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Urgency"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).xlTitle.Characters.Text = "Sales"
End With
ActiveChart.Legend.Select
Selection Delete
End Sub

But stuck with the PopulateData procedure, as how to calculat
sum/average from the source sheet and use it in the chart.Please hel
me out!, thanks.


mann

--
m2649813
-----------------------------------------------------------------------
m26498130's Profile: http://www.excelforum.com/member.php...fo&userid=3389
View this thread: http://www.excelforum.com/showthread.php?threadid=54355



All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com