All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aspose.cells.Sparkline.html Maven / Gradle / Ivy






Sparkline




com.aspose.cells
Class Sparkline

java.lang.Object
    extended by com.aspose.cells.Sparkline

public class Sparkline 
extends java.lang.Object

A sparkline represents a tiny chart or graphic in a worksheet cell that provides a visual representation of data.

Example:

            [C#]
             Workbook book = new Workbook(); 
             Worksheet sheet = book.Worksheets[0];
            
             sheet.Cells["A1"].PutValue(5);
             sheet.Cells["B1"].PutValue(2);
             sheet.Cells["C1"].PutValue(1);
             sheet.Cells["D1"].PutValue(3);
             
             // Define the CellArea
             CellArea ca = new CellArea();
             ca.StartColumn = 4;
             ca.EndColumn = 4;
             ca.StartRow = 0;
             ca.EndRow = 0;
            
             int idx = sheet.SparklineGroupCollection.Add(Aspose.Cells.Charts.SparklineType.Line, sheet.Name + "!A1:D1", false, ca);
            
             SparklineGroup group = sheet.SparklineGroupCollection[idx];
             idx = group.SparklineCollection.Add(sheet.Name + "!A1:D1", 0, 4);
             Sparkline line = group.SparklineCollection[idx];
             Console.WriteLine($"Saprkline data range:{line.DataRange}, row:{line.Row}, column:{line.Column}");
             line.ToImage("output.png", new ImageOrPrintOptions());
            


Property Getters/Setters Summary
intgetColumn()
           Gets the column index of the sparkline.
java.lang.StringgetDataRange()
voidsetDataRange(java.lang.String)
           Represents the data range of the sparkline.
intgetRow()
           Gets the row index of the sparkline.
 
Method Summary
voidtoImage(java.io.OutputStream stream, ImageOrPrintOptions options)
           Converts a sparkline to an image.
voidtoImage(java.lang.String fileName, ImageOrPrintOptions options)
           Converts a sparkline to an image.
 

Property Getters/Setters Detail

getDataRange/setDataRange

public java.lang.String getDataRange() / public void setDataRange(java.lang.String value)
Represents the data range of the sparkline.

setDataRange

public void setDataRange(java.lang.String value)
Represents the data range of the sparkline.

getRow

public int getRow()
Gets the row index of the sparkline.

getColumn

public int getColumn()
Gets the column index of the sparkline.

Method Detail

toImage

public void toImage(java.lang.String fileName, ImageOrPrintOptions options)
            throws java.lang.Exception
Converts a sparkline to an image.
Parameters:
fileName - The image file name.
options - The image options

toImage

public void toImage(java.io.OutputStream stream, ImageOrPrintOptions options)
            throws java.lang.Exception
Converts a sparkline to an image.
Parameters:
stream - The image stream.
options - The image options.

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy