Compartir por


Método Chart.ApplyCustomType (Project)

Aplica un tipo de gráfico personalizado a un gráfico.

Sintaxis

expresión. ApplyCustomType (ChartType,TypeName)

expresión Una variable que representa un objeto Chart.

Parameters

Nombre Obligatorio/opcional Tipo de datos Descripción
ChartType Obligatorio Office.XlChartType Tipo de gráfico.
TypeName Opcional Variant Nombre del tipo de gráfico.
ChartType Obligatorio XLCHARTTYPE
TypeName Opcional Variant

Valor devuelto

Nothing

Ejemplo

En el ejemplo siguiente se cambia el tipo de gráfico a un gráfico de barras 3D agrupado.

Sub SetChartType()
    Dim chartShape As Shape
    Dim reportName As String
    
    reportName = "Simple scalar chart"
    Set chartShape = ActiveProject.Reports(reportName).Shapes(1)
    
    Debug.Print "Chart type before: " & chartShape.Chart.ChartType
    chartShape.Chart.ApplyCustomType (xl3DBarClustered)
    Debug.Print "Chart type after: " & chartShape.Chart.ChartType
End Sub

Vea también

Objeto Chart

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.