This is a migrated thread and some comments may be shown as answers.

Dashed border

1 Answer 237 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
Pauli asked on 28 Apr 2015, 03:59 PM


How can I get dashed line around pink part of the pie and bar in the attached picture?


1 Answer, 1 is accepted

Sort by
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Apr 2015, 12:26 PM
Hello Pauli,

Thank you for writing.

You can subscribe to the RadChartView.CreatePointElement event and apply the desired style regarding the border. Here is a sample code snippet demonstrating how customize the BarPointElement and the PiePointElement:
public Form1()
    this.radChartView1.CreatePointElement += radChartView1_CreatePointElement;
    BarSeries barSeries = new BarSeries("Performance", "RepresentativeName");
    barSeries.Name = "Q1";          
    barSeries.DataPoints.Add(new CategoricalDataPoint(177, "Harley"));
    barSeries.DataPoints.Add(new CategoricalDataPoint(128, "White"));
    barSeries.DataPoints.Add(new CategoricalDataPoint(143, "Smith"));
    barSeries.CombineMode = ChartSeriesCombineMode.Stack;
    BarSeries barSeries2 = new BarSeries("Performance", "RepresentativeName");
    barSeries2.Name = "Q2";
    barSeries2.DataPoints.Add(new CategoricalDataPoint(153, "Harley"));
    barSeries2.DataPoints.Add(new CategoricalDataPoint(141, "White"));
    barSeries2.DataPoints.Add(new CategoricalDataPoint(130, "Smith"));
    barSeries2.CombineMode = ChartSeriesCombineMode.Stack;
    this.radChartView2.CreatePointElement += radChartView2_CreatePointElement;
    this.radChartView2.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"));
private void radChartView2_CreatePointElement(object sender, ChartViewCreatePointElementEventArgs e)
    PieDataPoint pieDatPoint = e.DataPoint as PieDataPoint ;
    if (pieDatPoint != null && pieDatPoint.LegendTitle == "United States")
        PiePointElement pieElement = new PiePointElement(pieDatPoint);
        e.DataPointElement = pieElement;
        pieElement.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
        pieElement.BorderColor = Color.Black;
        pieElement.BackColor = Color.Fuchsia;
private void radChartView1_CreatePointElement(object sender, ChartViewCreatePointElementEventArgs e)
    CategoricalDataPoint c = e.DataPoint as CategoricalDataPoint;
    if (c != null & e.Series is BarSeries & e.Series.Name == "Q2" & c.Category == "White")
        BarPointElement barElement = new BarPointElement(e.DataPoint);
        barElement.BorderWidth = 2;
        barElement.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
        barElement.BackColor = Color.Fuchsia;
        barElement.BorderColor = Color.Black;
        e.DataPointElement = barElement;           

I hope this information helps. Should you have further questions, I would be glad to help.

See What's Next in App Development. Register for TelerikNEXT.

Asked by
Top achievements
Rank 2
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question