Namespace: GlobFX.SwiffChartGenerator
Assembly: GlobFX.SwiffChartGenerator (in GlobFX.SwiffChartGenerator.dll)
Specifies the color for a series defined by its index in a chart.
Public Sub SetSeriesValueColor( index As Integer, valueindex As Integer, color As String ) Public Sub SetSeriesValueColor( index As Integer, valueindex As Integer, color As System.Drawing.Color )
public void SetSeriesValueColor( int index, int valueindex, string color ); public void SetSeriesValueColor( int index, int valueindex, System.Drawing.Color color );
By default, a new data series added to a chart takes its colors from the chart style.
If the index argument refers to a series that does not exist in the chart object, the series is created.
The color string argument can be specified:
As a named color.
Example: "orange"
For a complete reference of predefined named colors, consult
the Predefined Colors Reference.
Named colors are always opaque.
As a hexadecimal value "#RRGGBB", where RR, GG and BB represent the
hexadecimal values of the red, green and blue components.
Example: "#FFA500" represents an orange color.
An optional alpha component can be added at the end of the string: "#RRGGBBAA".
Example: "#FFA50080" represents a semi-transparent orange color,
"#FFA500FF" represents an opaque orange color,
"#FFA50000" represents an fully transparent (invisible) orange color.
When generating several charts using a single chart object, the ClearAll method can be used between each generated charts.
The following code illustrates use of the SetSeriesValueColor method.
Dim values(4) As Double ' Define the series #0 values(0) = 10.5 values(1) = 12.4 values(2) = 15.9 values(3) = 17.1 values(4) = 18.2 chart.SetSeriesValuesFromArray(0, values) chart.LoadStyle("column/Honolulu") ' Set the color of the 3rd value of series #0 chart.SetSeriesValueColor(0, 2, "limegreen")
double[] values= new double[5]; // Define the series #0 values[0] = 10.5; values[1] = 12.4; values[2] = 15.9; values[3] = 17.1; values[4] = 18.2; chart.SetSeriesValuesFromArray(0, values); chart.LoadStyle("column/Honolulu"); // Set the color of the 3rd value of series #0 chart.SetSeriesValueColor(0, 2, "limegreen");
SetSeriesColor Method | ClearAll Method | Predefined Colors Reference
Applies To: Chart Object