Graph 」标签的归档

Excel 2010 Chart Types

業界對於Office給出的預設圖樣一直爭論不休, Jon  Peltier 簡要給出他認為合適使用的圖形模板.

update: Jon留言,提到3D line給意外地遺忘了,而留在模板中,新修改中已將其移去.

適用模板

image thumb 3 Excel 2010 Chart Types

article clipper remember Excel 2010 Chart Types
 

Automatically Label First and Last Chart Points

據標籤對於dashboard來說,是一項重要的內容,它會令到讀者之後數據點的大小. 然而,dashboard有一個重要的特點是,在狹小的空間內,容納眾多的內容.於是,假若為圖上的每一個點都加上數據標籤,就會造成數據的混亂.此時最好的做法,就是僅為首尾數據點設置數據標籤.

wp1 Automatically Label First and Last Chart Points
wp2 Automatically Label First and Last Chart Points

BaconBits提供了一個VBA code,以便快捷地僅為首尾數據點設置數據標籤.

Function FirstAndLastLables()
Dim oChart As ChartObject
Dim MySeries As Series

For Each oChart In ActiveSheet.ChartObjects
    For Each MySeries In oChart.Chart.SeriesCollection
   
        'Clear ExistingData Labels
           MySeries.ApplyDataLabels (xlDataLabelsShowNone)
           
        'Apply Labels to First and Last Point
           MySeries.Points(1).ApplyDataLabels
            MySeries.Points(MySeries.Points.Count).ApplyDataLabels
            MySeries.DataLabels.Font.Bold = True
       
        'Make sure label ends up in an appropriate position
       MySeries.DataLabels.Position = xlLabelPositionBestFit
   
    Next MySeries
Next oChart

End Function
article clipper remember Automatically Label First and Last Chart Points
 

Square Cells or Create Graph Cells with VBA

The grid cells in Excel appears to be rectangular by default. In case you would like to convert them into squares as we have graph cells(See image below) then you need to write a macro for that. Column default width is 8.43 points spanning 64 pixels and Row height is 15 points spanning 20 pixels.

The height and width may appear weird to you as Row height is less than Column width but value is almost double.  Let’s get clear on this first.
Fact 01: One unit of column width is equal to the width of one character in the Normal style.
Fact 02: For proportional fonts, the width of the character 0 (zero) is used.
Fact 03: If all columns in the range have the same width, the ColumnWidth property returns the width.
Fact 04: If columns in the range have different widths, this property returns Null.
article clipper remember Square Cells or Create Graph Cells with VBA