ChartMultilevelValue
Contenuti
[
Nascondere
]ChartMultilevelValue class
Rappresenta un valore per i grafici che visualizzano dati multilivello.
public class ChartMultilevelValue
Costruttori
Nome | Descrizione |
---|---|
ChartMultilevelValue(string) | Inizializza una nuova istanza di questa classe che rappresenta un valore a livello singolo. |
ChartMultilevelValue(string, string) | Inizializza una nuova istanza di questa classe che rappresenta un valore a due livelli. |
ChartMultilevelValue(string, string, string) | Inizializza una nuova istanza di questa classe che rappresenta un valore a tre livelli. |
Proprietà
Nome | Descrizione |
---|---|
Level1 { get; } | Ottiene il nome del livello superiore del grafico a cui fa riferimento questo valore. |
Level2 { get; } | Ottiene il nome del livello intermedio del grafico a cui si riferisce questo valore. |
Level3 { get; } | Ottiene il nome del livello inferiore del grafico a cui fa riferimento questo valore. |
Metodi
Nome | Descrizione |
---|---|
override Equals(object) | Ottiene un flag che indica se l’oggetto specificato è uguale all’oggetto dati multilivello corrente. |
override GetHashCode() | Ottiene un codice hash per l’oggetto dati multilivello corrente. |
Esempi
Mostra come creare un grafico ad albero.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Inserisci un grafico Treemap.
Shape shape = builder.InsertChart(ChartType.Treemap, 450, 280);
Chart chart = shape.Chart;
chart.Title.Text = "World Population";
// Elimina la serie generata di default.
chart.Series.Clear();
// Aggiungi una serie.
ChartSeries series = chart.Series.Add(
"Population by Region",
new ChartMultilevelValue[]
{
new ChartMultilevelValue("Asia", "China"),
new ChartMultilevelValue("Asia", "India"),
new ChartMultilevelValue("Asia", "Indonesia"),
new ChartMultilevelValue("Asia", "Pakistan"),
new ChartMultilevelValue("Asia", "Bangladesh"),
new ChartMultilevelValue("Asia", "Japan"),
new ChartMultilevelValue("Asia", "Philippines"),
new ChartMultilevelValue("Asia", "Other"),
new ChartMultilevelValue("Africa", "Nigeria"),
new ChartMultilevelValue("Africa", "Ethiopia"),
new ChartMultilevelValue("Africa", "Egypt"),
new ChartMultilevelValue("Africa", "Other"),
new ChartMultilevelValue("Europe", "Russia"),
new ChartMultilevelValue("Europe", "Germany"),
new ChartMultilevelValue("Europe", "Other"),
new ChartMultilevelValue("Latin America", "Brazil"),
new ChartMultilevelValue("Latin America", "Mexico"),
new ChartMultilevelValue("Latin America", "Other"),
new ChartMultilevelValue("Northern America", "United States", "Other"),
new ChartMultilevelValue("Northern America", "Other"),
new ChartMultilevelValue("Oceania")
},
new double[]
{
1409670000, 1400744000, 279118866, 241499431, 169828911, 123930000, 112892781, 764000000,
223800000, 107334000, 105914499, 903000000,
146150789, 84607016, 516000000,
203080756, 129713690, 310000000,
335893238, 35000000,
42000000
});
// Mostra le etichette dei dati.
series.HasDataLabels = true;
series.DataLabels.ShowValue = true;
series.DataLabels.ShowCategoryName = true;
string thousandSeparator = CultureInfo.CurrentCulture.NumberFormat.CurrencyGroupSeparator;
series.DataLabels.NumberFormat.FormatCode = $"#{thousandSeparator}0";
doc.Save(ArtifactsDir + "Charts.Treemap.docx");
Guarda anche
- spazio dei nomi Aspose.Words.Drawing.Charts
- assemblea Aspose.Words