protected Brush GetStrokeBySlice(PieSliceVal slice) { Color c = this.predefinedColors.Length > slice.Index ? predefinedColors[slice.Index] : Colors.Black; return(new SolidColorBrush { Color = c }); }
protected ArcSegment GetArc(double radius, double angle, PieSliceVal slice, SweepDirection direction = SweepDirection.Clockwise) { var arcSegment = new ArcSegment(); var endOfArc = ToPoint(angle, radius); arcSegment.IsLargeArc = slice.Value >= 180.0; arcSegment.Point = endOfArc; arcSegment.Size = new Size(radius, radius); arcSegment.SweepDirection = direction; arcSegment.IsSmoothJoin = true; return(arcSegment); }
protected void SetStyle(Path path, PieSliceVal slice) { var style = GetStyle(slice, path); if (style != null) { path.Style = style; } else { path.Stroke = GetStrokeBySlice(slice); path.Fill = GetFillBySlice(slice); } }
private Brush GetStrokeBySlice(PieSliceVal slice) { if (this.sliceStrokes.Length > slice.Index) { return(this.sliceStrokes[slice.Index]); } if (SliceStroke != null) { return(SliceStroke); } Color c = this.predefinedColors.Length > slice.Index ? predefinedColors[slice.Index] : Colors.Black; return(new SolidColorBrush { Color = c }); }
private Style GetStyle(PieSliceVal slice, Path path) { return(SliceStyleSelector?.SelectStyle(slice.Index, path)); }
private string GetToolTip(PieSliceVal slice) { return(!string.IsNullOrEmpty(ToolTipFormattingString) ? string.Format(ToolTipFormattingString, CalcPercentage(slice.Value)) : CalcPercentage(slice.Value).ToString(CultureInfo.InvariantCulture)); }