Enum SparklinePresetStyleType

SparklinePresetStyleType enumeration

Represents the preset style types for sparkline.

public enum SparklinePresetStyleType

Values

NameValueDescription
Style10Style 1
Style21Style 2
Style32Style 3
Style43Style 4
Style54Style 5
Style65Style 6
Style76Style 7
Style87Style 8
Style98Style 9
Style109Style 10
Style1110Style 11
Style1211Style 12
Style1312Style 13
Style1413Style 14
Style1514Style 15
Style1615Style 16
Style1716Style 17
Style1817Style 18
Style1918Style 19
Style2019Style 20
Style2120Style 21
Style2221Style 22
Style2322Style 23
Style2423Style 24
Style2524Style 25
Style2625Style 26
Style2726Style 27
Style2827Style 28
Style2928Style 29
Style3029Style 30
Style3130Style 31
Style3231Style 32
Style3332Style 33
Style3433Style 34
Style3534Style 35
Style3635Style 36
Custom36No preset style.

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using Aspose.Cells.Charts;
    using System;

    public class SparklinePresetStyleTypeDemo
    {
        public static void SparklinePresetStyleTypeExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Add sample data for sparklines
            worksheet.Cells["A1"].PutValue(1);
            worksheet.Cells["B1"].PutValue(2);
            worksheet.Cells["C1"].PutValue(3);
            worksheet.Cells["D1"].PutValue(4);
            worksheet.Cells["E1"].PutValue(5);
            worksheet.Cells["A2"].PutValue(5);
            worksheet.Cells["B2"].PutValue(4);
            worksheet.Cells["C2"].PutValue(3);
            worksheet.Cells["D2"].PutValue(2);
            worksheet.Cells["E2"].PutValue(1);

            // Define the CellArea for the sparklines
            CellArea ca = new CellArea();
            ca.StartRow = 0;
            ca.EndRow = 1;
            ca.StartColumn = 5;
            ca.EndColumn = 5;

            // Add sparklines to the worksheet
            int idx = worksheet.SparklineGroups.Add(SparklineType.Line, "A1:E2", false, ca);
            SparklineGroup group = worksheet.SparklineGroups[idx];
            group.Sparklines.Add("A1:E1", 0, 5);
            group.Sparklines.Add("A2:E2", 1, 5);

            // Set the preset style type of the sparkline group
            group.PresetStyle = SparklinePresetStyleType.Style5;

            // Save the workbook
            workbook.Save("SparklinePresetStyleTypeExample.xlsx");

            return;
        }
    }
}

See Also