Class GPALChart
A GPAL chart instantiated with GPAL.Chart for use on GPAL forms.
Callback EventHandler is invoked on the GPALChart.WindowsControl.Clicked event.
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: GenerallyPositive.GPALForm
Assembly: GPAL.dll
Syntax
public class GPALChart : GPALControl, IAllowControlSettingsAndFontSettings, IAllowFontSettings, IAllowControlSettingsAndChartSettings, IAllowControlSettings, IAllowChartSettings
Examples
static GPALChart gPalChart = (GPALChart)GPAL.Chart
.WithPalette(ChartColorPalette.Bright)
.WithCallback(ChartHandler) // invoked when chart gets clicked
.WithName("Chart 1");
GPALForm myForm = (GPALForm)GPAL.Form
.WithTitle("Simple Form Test")
.WithFormControl(gPalChart)
.ShowDialog();
private static void GenerateBarSeries()
{
string[] seriesArray = { "Cat", "Dog", "Bird", "Monkey" };
int[] pointsArray = { 2, 1, 7, 5 };
gPalChart.Titles.Add("Animals");
// Add series
for (int i = 0; i < seriesArray.Length; i++)
{
Series series = gPalChart.Series.Add(seriesArray[i]);
// series.ChartType = SeriesChartType.Bar;
series.Points.Add(pointsArray[i]);
Legend legend = new Legend(seriesArray[i]);
// legend.Alignment = StringAlignment.Near;
gPalChart.Legends.Add(legend);
}
}
Properties
Legends
Underlying Windows chart Legends collection
Declaration
public LegendCollection Legends { get; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Forms.DataVisualization.Charting.LegendCollection |
Series
Underlying Windows chart Series collection
Declaration
public SeriesCollection Series { get; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Forms.DataVisualization.Charting.SeriesCollection |
Titles
Underlying Windows chart Titles collection
Declaration
public TitleCollection Titles { get; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Forms.DataVisualization.Charting.TitleCollection |
Methods
WithPalette(ChartColorPalette)
Set the color palette of the chart bars.
Declaration
public IAllowControlSettingsAndChartSettings WithPalette(ChartColorPalette colorPalette)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.DataVisualization.Charting.ChartColorPalette | colorPalette | Enum of possible choices |
Returns
| Type | Description |
|---|---|
| IAllowControlSettingsAndChartSettings | Fluent interface to define more chart settings |
WithSeries(Series)
Sets the series to plot in the chart.
Declaration
public IAllowControlSettingsAndChartSettings WithSeries(Series series)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.DataVisualization.Charting.Series | series | The name of the series |
Returns
| Type | Description |
|---|---|
| IAllowControlSettingsAndChartSettings | Fluent interface to define more chart settings |
WithTitle(String)
The title to display at the top of the chart.
Declaration
public IAllowControlSettingsAndChartSettings WithTitle(string title)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | title | The title text |
Returns
| Type | Description |
|---|---|
| IAllowControlSettingsAndChartSettings | Fluent interface to define more chart settings |