private void HighlightBar(Bar bar) { foreach (Bar b in Pieces) { if (b.Equals(bar)) { if (!b.IsHighlighted) { b.Highlight(); } } else b.Unhighlight(); } }
private void InitGraph(IDictionary dict) { _Camera = new PerspectiveCamera(); foreach (object key in dict.Keys) { try { double val = 0d; val = Convert.ToDouble(dict[key]); Bar bar = new Bar(key, dict[key]); bar.BarColor = _BarColor; bar.HighlightColor = _HighlightColor; bar.HighlightDuration = _HighlightDuration; Pieces.Add(bar); ToolTip3D tt = new ToolTip3D(_Camera, "key: " + key.ToString() + "\nvalue: " + dict[key].ToString()); _Tooltips.Add(key, tt); tt.Visible = false; tt.WidthSizeFactor = 100d; tt.HeightSizeFactor = 100d; tt.BackColor = Colors.BlanchedAlmond; tt.DrawBackground = true; } catch { } } CalculateValues(); }
private void HandleAction(BarGraphUserActions action, Bar bar) { switch (action) { case BarGraphUserActions.Highlight: HighlightBar(bar); break; case BarGraphUserActions.Tooltip: ShowToolTip(bar.Key); break; } }