Method AddColorScale
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
AddColorScale(XlsxCellRange, params XlsxThresholdPoint[])
Adds a colour scale. With no points, Excel's own: two colours from the lowest value to the highest, or three with the 50th percentile between.
public XlsxConditionalFormat AddColorScale(XlsxCellRange range, params XlsxThresholdPoint[] points)
Parameters
rangeXlsxCellRangeThe cells.
pointsXlsxThresholdPoint[]Two or three points, each with its colour; none for Excel's three-colour scale.
Returns
- XlsxConditionalFormat
The rule.
Exceptions
- ArgumentException
There are not two or three points, or a point has no colour or a value it needs.
- InvalidOperationException
The sheet is not a worksheet.