Propiedad Chart.SeriesNameLevel (Excel)

Devuelve una constante XlSeriesNameLevel que hace referencia al nivel de origen de los nombres de serie. Valor Entero de lectura y escritura.

Sintaxis

expresión. SeriesNameLevel

expresión Una variable que representa un objeto Chart.

Comentarios

Si hay una jerarquía, 0 hace referencia al nivel primario, 1 hace referencia a sus elementos secundarios, etc. Por lo tanto, 0 es igual al primer nivel, 1 es igual al segundo nivel, 2 es igual al tercer nivel, etc.

Valor de propiedad

XLSERIESNAMELEVEL

Ejemplo:

En el código de ejemplo siguiente se usa la propiedad SeriesNameLevel para establecer los nombres de serie de gráfico de las columnas creadas anteriormente.

    Sheets(1).Range("C1:E1").Value2 = "Sample_Row1"
    Sheets(1).Range("C2:E2").Value2 = "Sample_Row2"
    Sheets(1).Range("A3:A5").Value2 = "Sample_ColA"
    Sheets(1).Range("B3:B5").Value2 = "Sample_ColB"
    Sheets(1).Range("C3:E5").Formula = "=row()"
    Dim crt As Chart
    Set crt = Sheets(1).ChartObjects.Add(0, 0, 500, 200).Chart
    crt.SetSourceData Sheets(1).Range("A1:E5")
    ' Set the series names to only use column B
    crt.SeriesNameLevel = 1
    ' Use columns A and B for the series names
    crt.SeriesNameLevel = xlSeriesNameLevelAll
    ' Use row 1 for the category labels
    crt.CategoryLabelLevel = 0
    ' Use rows 1 and 2 for the category labels
    crt.CategoryLabelLevel = xlCategoryLabelLevelAll

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.