Tài liệu HotXLS

Phương thức AddCondFormatColorScale3

Thêm quy tắc định dạng có điều kiện Color Scale 3 điểm dừng theo Excel 2007+ lên một vùng ô, trả về đối tượng TCondFormatRule mới. Các ô nhận tô chuyển sắc nội suy giữa ba điểm dừng màu: min, mid (mặc định ở phân vị thứ 50) và max. (Có từ v2.34.0.)

Cú pháp

function AddCondFormatColorScale3(const ARange: WideString;
  AMinColor, AMidColor, AMaxColor: LongWord;
  AMinKind: TXLSCfValueKind = cfvMinOfRange; const AMinValue: WideString = '';
  AMidKind: TXLSCfValueKind = cfvPercentile; const AMidValue: WideString = '50';
  AMaxKind: TXLSCfValueKind = cfvMaxOfRange; const AMaxValue: WideString = ''): TCondFormatRule;
ARange WideString. Sqref String, e.g. 'A1:A10'
AMinColor / AMidColor / AMaxColor LongWord. Three gradient anchor colors in Delphi BGR định dạng
AMinKind / AMidKind / AMaxKind TXLSCfValueKind. Threshold types. Mid defaults to cfvPercentile / '50' — the classic "Red–Yellow–Green" Excel preset
AMinValue / AMidValue / AMaxValue WideString. Threshold literal text. AMidValue defaults to '50' to pair with cfvPercentile

Ví dụ

Ví dụ này tô màu A1:A10 với thang màu Đỏ-Vàng-Xanh cổ điển

Sheet.AddCondFormatColorScale3('A1:A10',
  $000000FF, $0000FFFF, $0000FF00);

Xem thêm