Set font properties for the specified object.
#Include <ExcelChart.au3>
_XLChart_FontSet($oObject[, $sName = Default[, $iSize = Default[, $bBold = Default[, $bItalic = Default[, $bUnderline = Default[, $iColor = Default,[$bThemeColor = False]]]]]]])
Parameters
$oObject | Object for which the font properties should be set (ChartTitle, AxisTitle, Legend ...) |
$sName | Optional: Font name like "Courier New" or "Arial" (default = Default) |
$iSize | Optional: Size of the font in points (default = Default) |
$bBold | Optional: If True the font will be displayed bold (default = Default) |
$bItalic | Optional: If True the font will be displayed italic (default = Default) |
$bUnderline | Optional: If True the font will be displayed underlined (default = Default) |
$iColor | Optional: Color of the font (default = Default) You can set colors to an explicit red-green-blue value (e.g. 0xFF00FF) or to a color in the color scheme (negative numbers -1 to -56) |
$bThemeColor | Optional: True specifies that $iColor is interpreted as theme color (default = False). If set to True the $iColor value has to be one of the MsoThemeColorIndex enumeration |
Return Value
Success: Returns 1
Remarks
Color 0 (white) has to be specified as RGB value or use color 2 which has the same RGB value of 0xFFFFFF
Related
Example
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y
#include-once
#include <ExcelChart.au3>
; *****************************************************************************
; Create example environment
; *****************************************************************************
Global $aExcel = _XLChart_Example(True, 0, 0, -1, -1)
If @error = 2 Then Exit MsgBox(16, "Excel Chart Example Script", "The installed Excel version is not supported by this UDF!" & @CRLF & "Version must be >= 12 (Excel 2007).")
If @error <> 0 Then Exit MsgBox(16, "Excel Chart Example Script", "Error " & @error & " returned by _XLChart_Example on line " & @ScriptLineNumber)
; *****************************************************************************
; Example 1
; Change title of Chart 1: Arial, 24, bold, italic, underline, magenta
; *****************************************************************************
MsgBox(64, "Excel Chart Example Script", "Now changing chart 1 ..." & @CRLF & "Chart title: Arial, 24, bold, italic, underline, magenta")
_XLChart_FontSet($aExcel[1].ChartTitle, "Arial", 24, True, True, True, 0xFF99CC)
If @error Then MsgBox(64, "Excel Chart Example Script", "Error " & @error & " returned by function '_XLChart_FontSet' on line " & @ScriptLineNumber)
; *****************************************************************************
; Example 2
; Change x-Axis title of chart 2: Courier New, 36, bold, color 5 (blue)
; *****************************************************************************
MsgBox(64, "Excel Chart Example Script", "Now changing chart 2 ..." & @CRLF & "X-Axis title: Courier New, 36, bold, color 5 (blue)")
_XLChart_FontSet($aExcel[2].Axes($xlCategory).AxisTitle, "Courier New", 36, True, False, False, -5)
If @error Then MsgBox(64, "Excel Chart Example Script", "Error " & @error & " returned by function '_XLChart_FontSet' on line " & @ScriptLineNumber)