public class SparklineGroup
extends java.lang.Object
Sparkline is organized into sparkline group. A SparklineGroup contains a variable number of sparkline items.
A sparkline group specifies the type, display settings and axis settings for the sparklines.
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, "A1:D1", false, ca);
SparklineGroup group = sheet.getSparklineGroups().get(idx);
group.getSparklines().add(sheet.getName() + "!A1:D1", 0, 4);
// Create CellsColor
CellsColor clr = book.createCellsColor();
clr.setColor(Color.getOrange());
group.setSeriesColor(clr);
// set the high points are colored green and the low points are colored red
group.setShowHighPoint(true);
group.setShowLowPoint(true);
group.getHighPointColor().setColor(Color.getGreen());
group.getLowPointColor().setColor(Color.getRed());
// set line weight
group.setLineWeight(1.0);
book.save("output.xlsx", SaveFormat.XLSX);
| Modifier and Type | Method and Description |
|---|---|
boolean |
getDisplayHidden()
Indicates whether to show data in hidden rows and columns.
|
CellsColor |
getFirstPointColor()
Gets the color of the first point of data in the sparkline group.
|
CellsColor |
getHighPointColor()
Gets the color of the highest points of data in the sparkline group.
|
CellsColor |
getHorizontalAxisColor()
Gets the color of the horizontal axis in the sparkline group.
|
java.lang.String |
getHorizontalAxisDateRange()
Represents the range that contains the date values for the sparkline data.
|
CellsColor |
getLastPointColor()
Gets the color of the last point of data in the sparkline group.
|
double |
getLineWeight()
Gets the line weight in each line sparkline in the sparkline group, in the unit of points.
|
CellsColor |
getLowPointColor()
Gets the color of the lowest points of data in the sparkline group.
|
CellsColor |
getMarkersColor()
Gets the color of points in each line sparkline in the sparkline group.
|
CellsColor |
getNegativePointsColor()
Gets the color of the negative values on the sparkline group.
|
int |
getPlotEmptyCellsType()
Indicates how to plot empty cells.
|
boolean |
getPlotRightToLeft()
Indicates whether the plot data is right to left.
|
int |
getPresetStyle()
Gets the preset style type of the sparkline group.
|
CellsColor |
getSeriesColor()
Gets the color of the sparklines in the sparkline group.
|
boolean |
getShowFirstPoint()
Indicates whether to highlight the first point of data in the sparkline group.
|
boolean |
getShowHighPoint()
Indicates whether to highlight the highest points of data in the sparkline group.
|
boolean |
getShowHorizontalAxis()
Indicates whether to show the sparkline horizontal axis.
|
boolean |
getShowLastPoint()
Indicates whether to highlight the last point of data in the sparkline group.
|
boolean |
getShowLowPoint()
Indicates whether to highlight the lowest points of data in the sparkline group.
|
boolean |
getShowMarkers()
Indicates whether to highlight each point in each line sparkline in the sparkline group.
|
boolean |
getShowNegativePoints()
Indicates whether to highlight the negative values on the sparkline group with a different color or marker.
|
SparklineCollection |
getSparklineCollection()
Deprecated.
Use SparklineGroup.Sparklines property instead.
|
SparklineCollection |
getSparklines()
Gets the collection of
Sparkline object. |
int |
getType()
Indicates the sparkline type of the sparkline group.
|
double |
getVerticalAxisMaxValue()
Gets the custom maximum value for the vertical axis.
|
int |
getVerticalAxisMaxValueType()
Represents the vertical axis maximum value type.
|
double |
getVerticalAxisMinValue()
Gets the custom minimum value for the vertical axis.
|
int |
getVerticalAxisMinValueType()
Represents the vertical axis minimum value type.
|
void |
resetRanges(java.lang.String dataRange,
boolean isVertical,
CellArea locationRange)
Resets the data range and location range of the sparkline group.
|
void |
setDisplayHidden(boolean value)
Indicates whether to show data in hidden rows and columns.
|
void |
setFirstPointColor(CellsColor value)
Sets the color of the first point of data in the sparkline group.
|
void |
setHighPointColor(CellsColor value)
Sets the color of the highest points of data in the sparkline group.
|
void |
setHorizontalAxisColor(CellsColor value)
Sets the color of the horizontal axis in the sparkline group.
|
void |
setHorizontalAxisDateRange(java.lang.String value)
Represents the range that contains the date values for the sparkline data.
|
void |
setLastPointColor(CellsColor value)
Sets the color of the last point of data in the sparkline group.
|
void |
setLineWeight(double value)
Sets the line weight in each line sparkline in the sparkline group, in the unit of points.
|
void |
setLowPointColor(CellsColor value)
Sets the color of the lowest points of data in the sparkline group.
|
void |
setMarkersColor(CellsColor value)
Sets the color of points in each line sparkline in the sparkline group.
|
void |
setNegativePointsColor(CellsColor value)
Sets the color of the negative values on the sparkline group.
|
void |
setPlotEmptyCellsType(int value)
Indicates how to plot empty cells.
|
void |
setPlotRightToLeft(boolean value)
Indicates whether the plot data is right to left.
|
void |
setPresetStyle(int value)
Sets the preset style type of the sparkline group.
|
void |
setSeriesColor(CellsColor value)
Sets the color of the sparklines in the sparkline group.
|
void |
setShowFirstPoint(boolean value)
Indicates whether to highlight the first point of data in the sparkline group.
|
void |
setShowHighPoint(boolean value)
Indicates whether to highlight the highest points of data in the sparkline group.
|
void |
setShowHorizontalAxis(boolean value)
Indicates whether to show the sparkline horizontal axis.
|
void |
setShowLastPoint(boolean value)
Indicates whether to highlight the last point of data in the sparkline group.
|
void |
setShowLowPoint(boolean value)
Indicates whether to highlight the lowest points of data in the sparkline group.
|
void |
setShowMarkers(boolean value)
Indicates whether to highlight each point in each line sparkline in the sparkline group.
|
void |
setShowNegativePoints(boolean value)
Indicates whether to highlight the negative values on the sparkline group with a different color or marker.
|
void |
setType(int value)
Indicates the sparkline type of the sparkline group.
|
void |
setVerticalAxisMaxValue(double value)
Sets the custom maximum value for the vertical axis.
|
void |
setVerticalAxisMaxValueType(int value)
Represents the vertical axis maximum value type.
|
void |
setVerticalAxisMinValue(double value)
Sets the custom minimum value for the vertical axis.
|
void |
setVerticalAxisMinValueType(int value)
Represents the vertical axis minimum value type.
|
public void resetRanges(java.lang.String dataRange,
boolean isVertical,
CellArea locationRange)
dataRange - Specifies the new data range of the sparkline group.isVertical - Specifies whether to plot the sparklines from the new data range by row or by column.locationRange - Specifies where the sparklines to be placed.public int getPresetStyle()
public void setPresetStyle(int value)
public SparklineCollection getSparklineCollection()
Sparkline object.
Remarks
NOTE: This member is now obsolete. Instead, please use SparklineGroup.Sparklines property. This property will be removed 12 months later since November 2022. Aspose apologizes for any inconvenience you may have experienced.public SparklineCollection getSparklines()
Sparkline object.public int getType()
See SparklineType.
public void setType(int value)
See SparklineType.
public int getPlotEmptyCellsType()
See PlotEmptyCellsType.
public void setPlotEmptyCellsType(int value)
See PlotEmptyCellsType.
public boolean getDisplayHidden()
public void setDisplayHidden(boolean value)
public boolean getShowHighPoint()
public void setShowHighPoint(boolean value)
public CellsColor getHighPointColor()
public void setHighPointColor(CellsColor value)
public boolean getShowLowPoint()
public void setShowLowPoint(boolean value)
public CellsColor getLowPointColor()
public void setLowPointColor(CellsColor value)
public boolean getShowNegativePoints()
public void setShowNegativePoints(boolean value)
public CellsColor getNegativePointsColor()
public void setNegativePointsColor(CellsColor value)
public boolean getShowFirstPoint()
public void setShowFirstPoint(boolean value)
public CellsColor getFirstPointColor()
public void setFirstPointColor(CellsColor value)
public boolean getShowLastPoint()
public void setShowLastPoint(boolean value)
public CellsColor getLastPointColor()
public void setLastPointColor(CellsColor value)
public boolean getShowMarkers()
public void setShowMarkers(boolean value)
public CellsColor getMarkersColor()
public void setMarkersColor(CellsColor value)
public CellsColor getSeriesColor()
public void setSeriesColor(CellsColor value)
public boolean getPlotRightToLeft()
public void setPlotRightToLeft(boolean value)
public double getLineWeight()
public void setLineWeight(double value)
public CellsColor getHorizontalAxisColor()
public void setHorizontalAxisColor(CellsColor value)
public boolean getShowHorizontalAxis()
public void setShowHorizontalAxis(boolean value)
public java.lang.String getHorizontalAxisDateRange()
public void setHorizontalAxisDateRange(java.lang.String value)
public int getVerticalAxisMaxValueType()
public void setVerticalAxisMaxValueType(int value)
public double getVerticalAxisMaxValue()
public void setVerticalAxisMaxValue(double value)
public int getVerticalAxisMinValueType()
public void setVerticalAxisMinValueType(int value)
public double getVerticalAxisMinValue()
public void setVerticalAxisMinValue(double value)
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.