Siticone ZB Line Chart
The SiticoneZBLineChart is a high-performance, multi-series charting control.
It distinguishes itself with over 50 unique line styles (including Heartbeat, Morse Code, and Circuit Board patterns), interactive zooming, and advanced data binding capabilities.
Data Binding
This control supports robust data binding options, including standard DataSource binding, manual point collection management, and a specialized string-based pivot binding.
| Property / Method | Type | Description & Usage Example |
|---|---|---|
DataSource |
object |
chart.DataSource = myDataTable;
Binds to DataTable, DataSet, DataView, or IEnumerable.
|
BindStringDataTable() |
void | chart.BindStringDataTable(dt, "Date", "Value", "Category"); Automatically creates series based on unique values in the "Category" column. Useful for pivoting data. |
BindToDataTable() |
void | chart.BindToDataTable(dt, "XColumn", new[]{"Series1", "Series2"}); Maps specific columns to separate series. |
Series |
Collection | chart.Series[0].Points.Add(new DataPoint(1, 10)); Direct access to the series collection for manual data manipulation. |
Appearance & Styling
Customize the visual presentation, including the unique line styles that set this chart apart.
| Property | Type | Description & Usage Example |
|---|---|---|
DefaultSiticoneZBLineChatLineStyle |
Enum |
chart.DefaultSiticoneZBLineChatLineStyle = SiticoneZBLineChatLineStyle.HeartBeat;
Sets the default pattern for lines. Options include Solid, Dash, CircuitBoard, SoundWave, etc.
|
DefaultUseCurvedLines |
bool | chart.DefaultUseCurvedLines = true; Renders lines as smooth Bézier curves instead of straight segments. |
UseGradientBackground |
bool | chart.UseGradientBackground = true; Enables a gradient fill for the main control background. |
PlotAreaBackColor |
Color | chart.PlotAreaBackColor = Color.WhiteSmoke; The background color specific to the data plotting area. |
RoundedCorners |
bool | chart.RoundedCorners = true; Applies rounded edges to the plot area and legend box. |
ShadowDepth |
float | chart.ShadowDepth = 3f; Adds a drop shadow behind the plot area for depth. |
Interaction & Zooming
Features that allow users to explore the data dynamically.
| Property | Type | Description & Usage Example |
|---|---|---|
EnableZooming |
bool |
chart.EnableZooming = true;
Allows programmatic zooming via ZoomTo().
|
EnablePointHighlight |
bool | chart.EnablePointHighlight = true; Draws a marker over the data point closest to the mouse cursor. |
ShowAdvancedToolTip |
bool | chart.ShowAdvancedToolTip = true; Displays a rich tooltip containing values for all series at the specific X-coordinate hovered. |
Methods
// Adds a new series to the chart programmatically.
// Returns the created DataSeries object.
var series = chart.AddSeries(
"Pulse",
Color.SeaGreen,
SiticoneZBLineChatLineStyle.HeartBeat,
true // Use curved lines
);
series.Points.Add(new DataPoint(1, 75));
series.Points.Add(new DataPoint(2, 82));
// Zooms the viewport to a specific range.
// Parameters: xMin, xMax, yMin, yMax
chart.ZoomTo(10, 20, 0, 100);
// Restores the view to show all data points.
chart.ResetZoom();
Events
Respond to user actions and internal state changes.
// 1. DataPointClick Event
// Fires when a specific data point marker is clicked.
chart.DataPointClick += (s, e) =>
{
MessageBox.Show($"Series: {e.Series.Name}\nValue: {e.DataPoint.YValue}");
};
// 2. ZoomChanged Event
// Fires when the zoom level is modified.
chart.ZoomChanged += (s, e) =>
{
Debug.WriteLine($"Zoomed to X: {e.CurrentXRange.Minimum} - {e.CurrentXRange.Maximum}");
};
// 3. AxisRangeChanged Event
// Fires when axes are automatically scaled or manually adjusted.
chart.AxisRangeChanged += (s, e) =>
{
Debug.WriteLine($"Axis {e.Axis.Title} updated.");
};
Detailed Usage Examples
Example 1: Multi-Series String Binding
This powerful feature allows you to pivot a "Category" column into separate lines automatically.
private void LoadCategorizedData()
{
DataTable dt = new DataTable();
dt.Columns.Add("Date", typeof(DateTime));
dt.Columns.Add("Value", typeof(double));
dt.Columns.Add("Category", typeof(string));
// Data for "Server A"
dt.Rows.Add(DateTime.Today, 45, "Server A");
dt.Rows.Add(DateTime.Today.AddDays(1), 50, "Server A");
// Data for "Server B"
dt.Rows.Add(DateTime.Today, 30, "Server B");
dt.Rows.Add(DateTime.Today.AddDays(1), 35, "Server B");
// One line of code creates two series ("Server A" and "Server B")
// X-Axis: Date, Y-Axis: Value, Group By: Category
chart.BindStringDataTable(dt, "Date", "Value", "Category");
chart.DefaultUseCurvedLines = true;
chart.XAxis.IsDateTimeAxis = true;
}
Example 2: Using Advanced Line Styles
Demonstrating the unique line styles available in ZB Line Chart.
private void ApplySpecialStyles()
{
chart.ClearSeries();
// Series 1: HeartBeat Style
var s1 = chart.AddSeries("Vitals", Color.Red, SiticoneZBLineChatLineStyle.HeartBeat, false);
s1.Points.Add(new DataPoint(1, 60));
s1.Points.Add(new DataPoint(2, 120)); // Spike
s1.Points.Add(new DataPoint(3, 60));
// Series 2: CircuitBoard Style
var s2 = chart.AddSeries("Logic", Color.LimeGreen, SiticoneZBLineChatLineStyle.CircuitBoard, false);
s2.Points.Add(new DataPoint(1, 10));
s2.Points.Add(new DataPoint(2, 10));
s2.Points.Add(new DataPoint(3, 50)); // Step up
chart.BackColor = Color.Black;
chart.PlotAreaBackColor = Color.FromArgb(20, 20, 20);
chart.XAxis.GridColor = Color.DarkGray;
chart.YAxis.GridColor = Color.DarkGray;
}
Enumerations
public enum SiticoneZBLineChatLineStyle
{
Solid, Dash, Dot, DashDot,
// Advanced Styles:
HeartBeat,
CircuitBoard,
SoundWave,
RailroadTrack,
Morse,
Barcode,
ZigZag,
// ... 50+ styles available
}