Click or drag to resize

IChartInterior SwapColorsOnNegative Property

Foreground and background are swapped when the data value is negative.
Examples
The following code illustrates the use of SwapColorsOnNegative property:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create chart and set range</para><para>IChart chart = worksheet.Charts.Add();</para><para>chart.DataRange = worksheet.Range["B2:C6"];</para><para>//Set chart type</para><para>chart.ChartType = ExcelChartType.Cone3DClustered;</para><para>//True if foreground and background colors are swapped when the data value is negative</para><para>chart.Series[0].Format.Interior.SwapColorsOnNegative = true;</para><para>//Save to file</para><para>workbook.SaveToFile("Chart.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
bool SwapColorsOnNegative { get; set; }

Property Value

Type: Boolean
See Also