Skip to content

Commit

Permalink
Generalized rolling graph properties to allow more flexible customiza…
Browse files Browse the repository at this point in the history
…tion.
  • Loading branch information
glopesdev committed Oct 1, 2019
1 parent a622165 commit b58c56d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Bonsai.Design.Visualizers/RollingGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class RollingGraph : GraphControl
int capacity;
int numSeries;
bool autoScale;
float lineWidth;
SymbolType symbolType;
RollingPointPairList[] series;
const int DefaultCapacity = 640;
const int DefaultNumSeries = 1;
Expand All @@ -22,6 +24,20 @@ public RollingGraph()
IsShowContextMenu = false;
capacity = DefaultCapacity;
numSeries = DefaultNumSeries;
symbolType = SymbolType.None;
lineWidth = 1;
}

public SymbolType SymbolType
{
get { return symbolType; }
set { symbolType = value; }
}

public float LineWidth
{
get { return lineWidth; }
set { lineWidth = value; }
}

public int NumSeries
Expand Down Expand Up @@ -95,7 +111,7 @@ private void EnsureSeries()
GraphPane.CurveList.Clear();
for (int i = 0; i < series.Length; i++)
{
var curve = new LineItem(string.Empty, series[i], GetNextColor(), SymbolType.None);
var curve = new LineItem(string.Empty, series[i], GetNextColor(), symbolType, lineWidth);
curve.Line.IsAntiAlias = true;
curve.Line.IsOptimizedDraw = true;
curve.Label.IsVisible = false;
Expand Down

0 comments on commit b58c56d

Please sign in to comment.