private void _flexPie_SliceRendering(object sender, RenderSliceEventArgs e)
        {
            int   sliceOrderedIndex = Array.IndexOf(orderedData, _dataSource[e.Index]) + 1;
            Color sliceColor        = ColorFrom(Color.White, Color.LightSeaGreen, sliceOrderedIndex, orderedData.Length);

            e.Engine.SetFill(sliceColor.ToArgb());
            e.Engine.SetStroke(ControlPaint.Dark(sliceColor));
        }
Ejemplo n.º 2
0
 private void FormattablePieChart_SliceRendered(object sender, RenderSliceEventArgs e)
 {
     if (style != null)
     {
         var icon = style.Icon;
         if (icon != null)
         {
             var a2 = e.Angle + e.Sweep / 2f;
             var x  = e.CenterX + (Math.Cos(a2) * (e.InnerRadius + e.Radius) - icon.Width) * 0.5;
             var y  = e.CenterY + (Math.Sin(a2) * (e.InnerRadius + e.Radius) - icon.Height) * 0.5;
             e.Engine.DrawImage(icon, x, y, icon.Width, icon.Height);
         }
     }
 }
Ejemplo n.º 3
0
        private void FormattablePieChart_SliceRendering(object sender, RenderSliceEventArgs e)
        {
            var pie  = (IPieChart)this;
            var args = new ItemFormattingEventArgs(e.Index, Binding);

            ItemFormatting?.Invoke(this, args);

            style = args.Style;
            if (style != null)
            {
                var backColor = style.BackColor;
                if (!backColor.IsEmpty)
                {
                    e.Engine.SetFill(backColor.ToArgb());
                }

                var borderColor = args.Style.BorderColor;
                if (!borderColor.IsEmpty)
                {
                    e.Engine.SetStroke(borderColor.ToArgb());
                }
            }
        }