-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDualLineChart.cs
More file actions
43 lines (37 loc) · 1.25 KB
/
Copy pathDualLineChart.cs
File metadata and controls
43 lines (37 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
namespace TUIKit.Example
{
using System;
using TUIKit;
using TUIKit.Widgets;
/// <summary>
/// Renders two independently-colored line-chart series into the same region by drawing one
/// <see cref="LineChart"/> over another. Used by the tour to show two waves at once.
/// </summary>
internal sealed class DualLineChart : IWidget
{
private readonly LineChart _First;
private readonly LineChart _Second;
internal DualLineChart(double[] first, Color firstColor, double[] second, Color secondColor)
{
if (first == null)
throw new ArgumentNullException(nameof(first));
if (second == null)
throw new ArgumentNullException(nameof(second));
_First = new LineChart(first);
_First.Color = firstColor;
_Second = new LineChart(second);
_Second.Color = secondColor;
}
public Size Measure(Size available)
{
return available;
}
public void Render(ISurface surface)
{
if (surface == null)
throw new ArgumentNullException(nameof(surface));
_First.Render(surface);
_Second.Render(surface);
}
}
}