public class Sparkline
extends java.lang.Object
Example
Workbook book = new Workbook();
Worksheet sheet = book.getWorksheets().get(0);
sheet.getCells().get("A1").putValue(5);
sheet.getCells().get("B1").putValue(2);
sheet.getCells().get("C1").putValue(1);
sheet.getCells().get("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.getSparklineGroups().add(com.aspose.cells.SparklineType.LINE, sheet.getName() + "!A1:D1", false, ca);
SparklineGroup group = sheet.getSparklineGroups().get(idx);
idx = group.getSparklines().add(sheet.getName() + "!A1:D1", 0, 4);
Sparkline line = group.getSparklines().get(idx);
System.out.println("Saprkline data range: " + line.getDataRange() + ", row: " + line.getRow() + ", column: " + line.getColumn());
line.toImage("output.png", new ImageOrPrintOptions());
| Modifier and Type | Method and Description |
|---|---|
int |
getColumn()
Gets the column index of the sparkline.
|
java.lang.String |
getDataRange()
Represents the data range of the sparkline.
|
int |
getRow()
Gets the row index of the sparkline.
|
void |
setDataRange(java.lang.String value)
Represents the data range of the sparkline.
|
void |
toImage(java.io.OutputStream stream,
ImageOrPrintOptions options)
Converts a sparkline to an image.
|
void |
toImage(java.lang.String fileName,
ImageOrPrintOptions options)
Converts a sparkline to an image.
|
public java.lang.String getDataRange()
public void setDataRange(java.lang.String value)
public int getRow()
public int getColumn()
public void toImage(java.lang.String fileName,
ImageOrPrintOptions options)
fileName - The image file name.options - The image optionspublic void toImage(java.io.OutputStream stream,
ImageOrPrintOptions options)
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.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.