返回列表 上一主題 發帖

[發問] 請問這種階梯圖有辦法用EXCLE畫出來嗎?

回復 4# maxchou


    看了一下你的資料檔,有幾點問題:
1. 您是要將F1:F23的資料當成X座標嗎? (如果不是,那資料來源就應該改一下)
2. 您想畫出的圖型看起來比較像是直條圖 (如果是這樣,那圖表類型就不應選xy散佈圖)
3. 若要直條圖是相連的,可在『資料數列格式』的『選項』頁籤將類別間距改成0

TOP

回復 6# maxchou

請問您要的結果是這樣的圖嗎?
   

TOP

回復 8# maxchou


   
要畫成這樣有點小複雜哦!! 要一個個資料設定.

TOP

回復 10# maxchou


    可以把你最後的檔案上傳嗎? 我再找空檔想想怎麼幫你,因你目前還無權限下載檔案.

TOP

回復 12# maxchou


我用的方式還是太累要一個個設(我試的時候很耗時間),可能無法幫到你.
試試參考下列網址吧!
"XY圖本可選資料範圍就可以完成,但A欄資料會變成X軸資料,就算將全部資料轉置(選轉90度)依然如此(2003版),因此每組XY需一組一組設定。如圖形需常增加資料組數,可以用巨集方式處理,先錄製一段巨集,再增加迴圈指令就可以自動增加資料,不用每次由頭重設..."
[轉貼] from http://www.dolamo.com/problem/software/1/27340

TOP

本帖最後由 infoverdad 於 2011-9-6 00:11 編輯

回復 4# maxchou


用您的資料改了這個巨集,請試試吧!
(不過資料要先整理過 如附件) Draw-stair.rar (50.49 KB)
畫出之圖形:
  1. Sub DrawRangeCol()

  2.     Dim myRange As Range
  3.     Dim i As Integer

  4.     Set myRange = Sheets("test").Range("N1:X102")
  5.    
  6.     Charts.Add
  7.     ActiveChart.ChartType = xlColumnClustered
  8.     ActiveChart.SetSourceData Source:=myRange, PlotBy:=xlColumns
  9.    
  10.     i = 1
  11.     For i = 1 To myRange.Columns.Count
  12.    
  13.         ActiveChart.SeriesCollection(i).Values = "=test!R2C" & i + 13 & ":R102C" & i + 13
  14.         ActiveChart.SeriesCollection(i).Name = "=test!R1C" & i + 13
  15.    
  16.         ActiveChart.Axes(xlCategory).Select
  17.         ActiveChart.SeriesCollection(i).Select
  18.         With Selection.Border
  19.             .Weight = xlThin
  20.             .LineStyle = xlNone
  21.         End With
  22.         Selection.Shadow = False
  23.         Selection.InvertIfNegative = False
  24.         Selection.Interior.ColorIndex = xlAutomatic
  25.       
  26.     Next
  27.       
  28.     ActiveChart.ChartArea.Select
  29.     ActiveChart.HasLegend = True
  30.     ActiveChart.Legend.Select
  31.     Selection.Position = xlBottom
  32.    
  33.     ActiveChart.PlotArea.Select
  34.     With ActiveChart.ChartGroups(1)
  35.         .Overlap = 100
  36.         .GapWidth = 0
  37.         .HasSeriesLines = False
  38.     End With
  39.    
  40. End Sub
複製代碼

TOP

本帖最後由 infoverdad 於 2011-9-6 13:34 編輯

回復 16# maxchou


    我試試,但你的資料有小數點,是最大的麻煩處.

N2 =IF(AND(ROW()>=$K$2,ROW()<=$L$2),$B$2,0)
O2 =IF(AND(ROW()>=$K$3,ROW()<=$L$3),$B$3,0)
...
X2 =IF(AND(ROW()>=$K$12,ROW()<=$L$12),$B$12,0)


TOP

回復 16# maxchou


    你也可以去下面的網址下載一個zip檔入附件(funchart5_brickyard.zip)
funchart5_brickyard.zip (11.05 KB)

http://peltiertech.com/Excel/Charts/Brickyard.html

原理是一樣的 但您可已看看它的解說與實例

TOP

本帖最後由 infoverdad 於 2011-9-6 18:48 編輯

回復 19# maxchou


1. L2=K2+J2-1  
2. yes

TOP

回復 21# maxchou


雖然如此,還是可以做的,之前提的網址所下載的那個funchart5_brickyard.zip 把rngBlank從來源資料移除,就可以做到(如附件)
brickyard-R1.rar (14.94 KB)
,其中有一段說明如下:
"All of the hard work in this file is done using defined names.  These names create a series of 100 bars, then work out which plant is associated with each bar, and what the 'value' of the bar should be.  The 100 bars are plotted on the chart and then formatted such that they appear to be a single column.  To improve the accuracy, change the rngBins defined name to use up to 4,000 points (instead of the two 100's there already). "

rngVol        =OFFSET(Sheet1!$B$5,0,0,COUNTA(Sheet1!$B:$B)-1,1)                               
rngVCum        =OFFSET(rngVol,0,1)                               
rngCost        =OFFSET(rngVol,0,2)                               
rngBins        =TRANSPOSE(SUM(rngVol)*ROW(Sheet1!$1:$100)/100)                               
rngPlant        =MATCH(rngBins,rngVCum,1)                               
rngSer1        =IF(rngPlant=1,INDEX(rngCost,1),0)                               
rngSer2        =IF(rngPlant=2,INDEX(rngCost,2),0)                               
rngSer3        =IF(rngPlant=3,INDEX(rngCost,3),0)                               
rngSer4        =IF(rngPlant=4,INDEX(rngCost,4),0)       

TOP

        靜思自在 : 脾氣嘴巴不好,心地再好也不能算是好人。
返回列表 上一主題