Completed
Last Updated: 21 Mar 2016 09:12 by ADMIN
When trying to drill down PieChart on RadChartView the code throws exception.

Workaround: private void radChartView_Drill(object sender, DrillEventArgs e){    e.View.Parent = this.radChartViewUsers.ChartElement.Wrapper;    e.View.AreaType = ChartAreaType.Pie;    //do drill logic}
Completed
Last Updated: 10 Feb 2016 14:29 by ADMIN
To reproduce:
public RadForm1()
{
    InitializeComponent();
    this.radChartView1.AreaType = ChartAreaType.Pie;
    PieSeries series = new PieSeries();
    series.DataPoints.Add(new PieDataPoint(50, "Germany"));
    series.DataPoints.Add(new PieDataPoint(70, "United States"));
    series.DataPoints.Add(new PieDataPoint(40, "France"));
    series.DataPoints.Add(new PieDataPoint(25, "United Kingdom"));
    series.ShowLabels = true;
    this.radChartView1.Series.Add(series);

    radChartView1.ShowLegend = true;
}
Random rnd = new Random();
private void radButton1_Click(object sender, EventArgs e)
{
     this.radChartView1.Series[0].DataPoints.RemoveAt(0);
     this.radChartView1.Series[0].DataPoints.Add(new PieDataPoint(rnd.Next(100), rnd.Next(100).ToString()));
}

Workaround:

private void radButton1_Click(object sender, EventArgs e)
{
    this.radChartView1.Series[0].DataPoints.RemoveAt(0);
    this.radChartView1.Series[0].DataPoints.Add(new PieDataPoint(50, rnd.Next(100).ToString()));

    this.radChartView1.ChartElement.LegendElement.Items.Clear();

    foreach (PieSeries series in radChartView1.Series)
    {
        for (int i = 0; i < series.DataPoints.Count; i++)
        {
            var dataPoint = series.DataPoints[i] as PieDataPoint;
            var element = series.Children[i] as PiePointElement;

            var legendItem = new LegendItem(element);
            legendItem.Title = dataPoint.LegendTitle;
          
            this.radChartView1.ChartElement.LegendElement.Items.Add(legendItem);
        }
        
    }
}
Completed
Last Updated: 11 Nov 2015 12:34 by ADMIN
To reproduce:
this.radChartView1.AreaType = Telerik.WinControls.UI.ChartAreaType.Polar;
RadarLineSeries series = new RadarLineSeries(new SizeF(8f, 8f));
series.DataPoints.Add(new CategoricalDataPoint(0.0, "Coding"));
series.LegendTitle = String.Format("Coding");
series.BorderWidth = 2;
radChartView1.Series.Add(series);
series.PolarAxis.Minimum = 0d;
series.PolarAxis.Maximum = 0.0;
series.PolarAxis.TickLength = 4;


Completed
Last Updated: 01 Sep 2015 10:40 by ADMIN
Workaround: 
public Form1()
        {
            InitializeComponent();
         
           StringFormat.GenericTypographic.Alignment = StringAlignment.Near;
        }
Completed
Last Updated: 23 Jul 2015 12:59 by ADMIN
Workaround: create a custom BarSeriesDrawPart  and override the Draw method

public class CustomBarSeriesDrawPart : BarSeriesDrawPart
{
    public CustomBarSeriesDrawPart(BarSeries series, IChartRenderer renderer)
        : base(series, renderer)
    { }

    public override void Draw()
    {
        bool shouldDraw = IsElementValid();
        if (shouldDraw)
        {
            Graphics graphics = this.Renderer.Surface as Graphics;
            GraphicsState state = graphics.Save();
            Region clipRegion = graphics.Clip;

            CartesianSeries cartesianSeries = this.Element as CartesianSeries;
           

            if (cartesianSeries != null)
            {
                FieldInfo fi = cartesianSeries.GetType().GetField("area", BindingFlags.NonPublic | BindingFlags.Instance);
                CartesianArea  area = fi.GetValue(cartesianSeries) as CartesianArea;
                MethodInfo mi = area.GetType().GetMethod("GetCartesianClipRect", BindingFlags.NonPublic | BindingFlags.Instance);
                mi.Invoke(area, null);

                RectangleF clipRect = (RectangleF)mi.Invoke(area, null); 
                graphics.Clip = new Region(clipRect);
            }

            DrawSeriesParts();

            graphics.Clip = clipRegion;
            graphics.Restore(state);
        }
    }
}
Completed
Last Updated: 22 Jul 2015 06:43 by ADMIN
RadChartView Control: corrupts legend when set Series IsVisibleInLegend = False in Properties at design time

Simply added a few extra series , and then tried to turn them off in the legend 

screen shot shows too many legent items for the series in the properties window

Completed
Last Updated: 14 Jul 2015 09:59 by ADMIN
Completed
Last Updated: 10 Jul 2015 13:01 by ADMIN
How to reproduce: 
public Form1()
        {
            InitializeComponent();

            DataTable source = new DataTable();
            source.Columns.Add("PreviousGoal", typeof(decimal));
            source.Columns.Add("CurrentCategory", typeof(System.DateTime));

            source.LoadDataRow(new object[] { null, "6/1/15" }, true);
            source.LoadDataRow(new object[] { null, "6/2/15" }, true);
            source.LoadDataRow(new object[] { null, "6/3/15" }, true);
            source.LoadDataRow(new object[] { null, "6/4/15" }, true);
            source.LoadDataRow(new object[] { null, "6/5/15" }, true);

            this.radChartView1.DataSource = source;

            SteplineSeries previousGoalSeries = new SteplineSeries();
            previousGoalSeries.DataSource = source;
            previousGoalSeries.ValueMember = "PreviousGoal";
            this.radChartView1.Series.Add(previousGoalSeries);

            SteplineSeries previousGoalSeries1 = new SteplineSeries();
            previousGoalSeries1.DataSource = source;
            previousGoalSeries1.ValueMember = "CurrentCategory";
            this.radChartView1.Series.Add(previousGoalSeries1);

            this.radChartView1.ShowTrackBall = true;

        }

Workaround: add the series with null values last
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        DataTable source = new DataTable();
        source.Columns.Add("PreviousGoal", typeof(decimal));
        source.Columns.Add("CurrentCategory", typeof(System.DateTime));

        source.LoadDataRow(new object[] { null, "6/1/15" }, true);
        source.LoadDataRow(new object[] { null, "6/2/15" }, true);
        source.LoadDataRow(new object[] { null, "6/3/15" }, true);
        source.LoadDataRow(new object[] { null, "6/4/15" }, true);
        source.LoadDataRow(new object[] { null, "6/5/15" }, true);

        this.radChartView1.DataSource = source;
        SteplineSeries previousGoalSeries1 = new SteplineSeries();
        previousGoalSeries1.DataSource = source;
        previousGoalSeries1.ValueMember = "CurrentCategory";
        this.radChartView1.Series.Add(previousGoalSeries1);

        SteplineSeries previousGoalSeries = new SteplineSeries();
        previousGoalSeries.DataSource = source;
        previousGoalSeries.ValueMember = "PreviousGoal";
        this.radChartView1.Series.Add(previousGoalSeries);

        this.radChartView1.ShowTrackBall = true;
    }
}
Declined
Last Updated: 08 Jul 2015 13:29 by ADMIN
Having issues withVS2013 & 2015 Q1 Winforms RadChartView control

1. WYSIWYG in design time does not refresh properly after changing axis collection parameters, unless close and reopen the parent winform or custom control
2. by changing an axis collection parameter , seem to end up with multiple extra axes series (originally had axisX, AxisY, and after a minor param change ended up with axis 0 thru 5 (6 in total) and all series where now using axis4 & axis5 not my original axis?
3. I can't see to toggle display on/off of series in winforms via the legend, yet in wpf web it is possible? will this feature be added later?

attached is example of WYSIWYG not working

improvement Suggestions:
I would love to have a major and minor grid (similar to ref: http://thumbs.dreamstime.com/z/screen-digital-oscilloscope-two-types-signal-33269502.jpg)  as most of my work is measurement and scientific in nature. 

I would like to ensure the ratio of X-Y is fixed so that on resize of the control the grid does not skew or stretch  and I loose 1:1 aspect ratio

I look forward to your feedback ;)


Completed
Last Updated: 07 Jul 2015 12:30 by ADMIN
How to reproduce: 
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radChartView1.AreaType = ChartAreaType.Pie;
        PieSeries series = new PieSeries();
        series.DataPoints.Add(new PieDataPoint(0, "Germany"));
        series.DataPoints.Add(new PieDataPoint(0, "United States"));
        series.DataPoints.Add(new PieDataPoint(0, "France"));
        series.DataPoints.Add(new PieDataPoint(0, "United Kingdom"));
        series.ShowLabels = true;
        this.radChartView1.Series.Add(series);
        this.radChartView1.ShowSmartLabels = true;
    }
}

Workaround: 
this.radChartView1.ShowSmartLabels = false;
Completed
Last Updated: 07 Jul 2015 12:22 by Ian
By making IsVisibleInLegend = false at design time, get exception during compile (see attached) and also exceptions at run time

Aim:
I need to be able to hide certain chart text from legend

 
Completed
Last Updated: 26 Jun 2015 07:45 by ADMIN
To reproduce:
- Add line series with large point size and null points.
- Hover a near a point which is close to null point (the line break).

Workaround:
public class MyChartTooltipController : ChartTooltipController
{
    protected override ActionResult OnMouseMove(MouseEventArgs e)
    {
        for (int i = 0; i < this.Area.Series.Count; i++)
        {
            DataPoint point = this.Area.Series[i].HitTest(e.X, e.Y);
            DataPoint hoveredPoint = typeof(ChartTooltipController).GetField("hoveredPoint", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(this) as DataPoint;
            ToolTip toolTip = typeof(ChartTooltipController).GetField("toolTip", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(this) as ToolTip;
            if (point != null && hoveredPoint != point)
            {
                hoveredPoint = point;
                var result = typeof(CategoricalDataPoint).GetMethod("GetTooltipValue", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).Invoke(hoveredPoint, null);
                
                if (result == null)
                {
                    return new ChartRefreshResult();
                }
            }
        }
        return base.OnMouseMove(e);
    }
}



 
Completed
Last Updated: 26 Jun 2015 07:34 by ADMIN
To reproduce:

Create a RadChartView with LineSeries. Subscribe to the CreatePointElement event and use the following code:

void Chart_CreatePointElement(object sender, ChartViewCreatePointElementEventArgs e)
{
    e.DataPointElement = new DataPointElement(e.DataPoint);
    e.DataPointElement.GradientStyle = GradientStyles.Solid;
    e.DataPointElement.GradientAngle = 270;
    e.DataPointElement.Shape = new DiamondShape();
    e.DataPointElement.BackColor = Color.Red;
    e.DataPointElement.BackColor2 = Color.Blue;
    e.DataPointElement.BackColor3 = Color.Blue;
    e.DataPointElement.BackColor4 = Color.Blue;
}

The elements paint when you use ChamferedRectShape.

Workaround 
class MyDiamondShape : ElementShape
{
    public override GraphicsPath CreatePath(Rectangle bounds)
    {
        GraphicsPath path = new GraphicsPath();
        
        path.AddPolygon(new PointF[]
        {
            new PointF(bounds.X + 0.5f * bounds.Width, bounds.Top),
            new PointF(bounds.Right, bounds.Y + 0.5f * bounds.Height),
            new PointF(bounds.X + 0.5f * bounds.Width, bounds.Bottom),
            new PointF(bounds.Left, bounds.Y + 0.5f * bounds.Height)
        });
    
        return path;
    }
}

class MyStarShape : ElementShape
{
    private int arms;
    private float innerRadiusRatio;
    
    public MyStarShape()
    {
        this.arms = 8;
        this.innerRadiusRatio = 0.2f;
    }
    
    /// <summary>
    /// Creates Star like shape. Overrides CreatePath method in the base class
    /// ElementShape.
    /// </summary>
    public override GraphicsPath CreatePath(Rectangle bounds)
    {
        GraphicsPath path = new GraphicsPath();
        
        double angle = Math.PI / arms;
        double offset = Math.PI / 2d;
        PointF center = new PointF(bounds.X + bounds.Width / 2f, bounds.Y + bounds.Height / 2f);
        PointF[] points = new PointF[arms * 2];
        
        for (int i = 0; i < 2 * arms; i++)
        {
            float r = (i & 1) == 0 ? bounds.Width / 2f : bounds.Width / 2f * innerRadiusRatio;
            
            float currX = center.X + (float)Math.Cos(i * angle - offset) * r;
            float currY = center.Y + (float)Math.Sin(i * angle - offset) * r;
        
            points[i] = new PointF(currX, currY);
        }
        
        path.AddPolygon(points);
        return path;
    }
}

class MyHeartShape : ElementShape
{
    public override GraphicsPath CreatePath(Rectangle bounds)
    {
        GraphicsPath path = new GraphicsPath();
        
        path.AddArc(new Rectangle(bounds.X, bounds.Y, bounds.Width / 2, bounds.Height / 2), 150, 210);
        path.AddArc(new Rectangle(bounds.X + bounds.Width / 2, bounds.Y, bounds.Width / 2, bounds.Height / 2), 180, 210);
        path.AddLine(path.GetLastPoint(), new Point(bounds.X + bounds.Width / 2, bounds.Bottom));
        path.CloseFigure();
    
        return path;
    }
    
}
Completed
Last Updated: 25 Jun 2015 13:17 by ADMIN
To reproduce:
- Enable the Trackball.
- Add 2 series to the chart.
- Remove and add back the first one.
- Move the mouse over the chart.

Workaround:
class MyChartTrackballController : ChartTrackballController
{
    protected override string GetPointText(DataPoint point)
    {
        if (point.Presenter != null)
        {
            return base.GetPointText(point);
        }
        else
        {
            CategoricalDataPoint p = point as CategoricalDataPoint;
            if (p!= null)
            {
                return p.Value.ToString();
            }
        }
        return "";
    }
} 
Completed
Last Updated: 25 Jun 2015 12:54 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();

    this.radChartView1.ShowPanZoom = true;
    Random rand = new Random();
    this.radChartView1.AreaType = ChartAreaType.Polar;
    for (int i = 0; i < 85; i++)
    {
        RadarLineSeries radarPointSeries = new RadarLineSeries();
        for (int j = 0; j < 8; j++)
        {
            radarPointSeries.DataPoints.Add(new CategoricalDataPoint(rand.Next(1, 100), "X" + j));
        }
        this.radChartView1.Series.Add(radarPointSeries);
    }
}

Workaround: set the ShowPanZoom property after the chart is populated with data.
Declined
Last Updated: 22 Jun 2015 10:00 by ADMIN
when overlay a radlabel on a radchartview, chartview constantly refreshes
label backcolor set to transparent

tried to recreate this with a sample cs project but wouldn't reproduce!

video has two instances of the same user control on the form
notice that right hand instance does not update when radlabel is added

attached is video of it working fine, then add label ontop , then see it misbehaving  with fast refresh flicker!  not only that it also prevents other items in the user controls from updating and the other user control on the form from updating

have attached sample c# project (but cant reproduce)
Completed
Last Updated: 03 Jun 2015 10:01 by ADMIN
To reproduce
- Add step-line series with two data points.

Workaround:
public class CustomCartesianRenderer : CartesianRenderer
{
    public CustomCartesianRenderer(CartesianArea area) : base(area)
    {
    }

    protected override void Initialize()
    {
        base.Initialize();

        for (int i = 0; i < this.DrawParts.Count; i++)
        {
            SteplineDrawPart linePart = this.DrawParts[i] as SteplineDrawPart;
            if (linePart != null)
            {
                this.DrawParts[i] = new CustomDrawPart((SteplineSeries)linePart.Element, this);
            }
        }
    }
}

public class CustomDrawPart : SteplineDrawPart
{
    public CustomDrawPart(LineSeriesBase series, IChartRenderer renderer)
        : base(series, renderer)
    {
    }
    protected override System.Drawing.Drawing2D.GraphicsPath GetLinePaths(PointF[] points)
    {
        //return base.GetLinePaths(points);
        GraphicsPath path = new GraphicsPath();

         if (points.Length > 1)
        {
            if (this.Element is LineSeries && ((LineSeries)this.Element).Spline)
            {
                path.AddCurve(points, ((LineSeries)this.Element).SplineTension);
            }
            else
            {
                bool isVertical = this.Element.View.GetArea<CartesianArea>().Orientation == System.Windows.Forms.Orientation.Vertical;

                for (int i = 1; i < points.Length; i++)
                {
                    PointF x = points[i - 1];
                    PointF y = points[i];

                    if (isVertical)
                    {
                        path.AddLine(x.X, x.Y, y.X, x.Y);
                        path.AddLine(y.X, x.Y, y.X, y.Y);
                    }
                    else
                    {
                        path.AddLine(x.X, x.Y, x.X, y.Y);
                        path.AddLine(x.X, y.Y, y.X, y.Y);
                    }
                }
            }
        }
        else
        {
            return null;
        }

        return path;
    }
}
//change like this
void radChartView1_CreateRenderer(object sender, ChartViewCreateRendererEventArgs e)
{
    e.Renderer = new CustomCartesianRenderer((CartesianArea)e.Area);
}
 
Completed
Last Updated: 01 Jun 2015 08:19 by ADMIN
public Form1()
{
    InitializeComponent();

    AreaSeries areaSeries = new AreaSeries();
    areaSeries.DataPoints.Add(new CategoricalDataPoint(13, "Jan"));
    areaSeries.DataPoints.Add(new CategoricalDataPoint(20, "Apr"));
    areaSeries.DataPoints.Add(new CategoricalDataPoint(15, "Jul"));
    areaSeries.DataPoints.Add(new CategoricalDataPoint(16, "Oct"));
    this.radChartView1.Series.Add(areaSeries);

    AreaSeries areaSeries2 = new AreaSeries(); 
    areaSeries2.DataPoints.Add(new CategoricalDataPoint(15, "Jan"));
    areaSeries2.DataPoints.Add(new CategoricalDataPoint(25, "Apr"));
    areaSeries2.DataPoints.Add(new CategoricalDataPoint(27, "Jul"));
    areaSeries2.DataPoints.Add(new CategoricalDataPoint(18, "Oct"));
    this.radChartView1.Series.Add(areaSeries2);

    this.radChartView1.ShowTrackBall = true;
    this.radChartView1.Series.First().IsVisible = false;
}

Please refer to the attached sample video.

Workaround 1: remove the series instead of hiding it.

Workaround 2:

private void radChartView1_CreateRenderer(object sender, ChartViewCreateRendererEventArgs e)
{
     e.Renderer = new CustomCartesianRenderer(e.Area as CartesianArea);
}

public class CustomCartesianRenderer : CartesianRenderer
{
    public CustomCartesianRenderer(CartesianArea area) : base(area)
    {
    }

    private int renderPass = 0;

    public override void Draw(object context)
    {
        if (renderPass < 2)
        {
            if (this.Area.View.Owner.Control.Site == null)
            {
                for (int i = 0; i < this.Area.Series.Count; i++)
                {
                    if (this.Area.Series[i].IsVisible && !this.Area.Series[i].Model.IsArrangeValid)
                    {
                        this.Area.View.Layout();
                        renderPass++;
                        return;
                    }
                }
            }
        }
        FieldInfo fi = typeof(ChartRenderer).GetField("surface", BindingFlags.Instance | BindingFlags.NonPublic);
        if (context != null)
        {
            fi.SetValue(this, context);
        }
        Initialize();

        for (int i = 0; i < this.DrawParts.Count; i++)
        {
            this.DrawParts[i].Draw();
        }
    }
}