To remove border lines when using RadChartView

1 Answer 87 Views
ChartView
Jay
Top achievements
Rank 1
Jay asked on 26 Oct 2022, 08:18 AM

Hi.

I'm trying to draw a specific graph using RadChartView.

However, I couldn't find a way to remove the border line, which is marked with a red arrow in the attached image.

The background color must be Transparent.

Please tell me how to remove only those lines.

 

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Oct 2022, 08:31 AM
Hello, JaeHa,     

According to the provided screenshot, it wouldn't be easy to determine what is the exact setup for RadChartView that you have to observe the border around the axis labels. I suspect that you are setting the BorderColor for the horizontal axis: 
            LineSeries lineSeries = new LineSeries();
            lineSeries.DataPoints.Add(new CategoricalDataPoint(20, "Jan"));
            lineSeries.DataPoints.Add(new CategoricalDataPoint(22, "Apr"));
            lineSeries.DataPoints.Add(new CategoricalDataPoint(12, "Jul"));
            lineSeries.DataPoints.Add(new CategoricalDataPoint(19, "Oct"));
            this.radChartView1.Series.Add(lineSeries);

            lineSeries.HorizontalAxis.BorderColor = Color.Red;

In order to get rid of the border around the labels, you may use the following approach: 

            lineSeries.HorizontalAxis.BorderColor = Color.Red;

            foreach (var item in lineSeries.HorizontalAxis.Children)
            {
                AxisLabelElement label = item as AxisLabelElement;
                if (label==null)
                {
                    continue;
                }
                label.BorderWidth = 0;
            }

I hope this information helps.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Jay
Top achievements
Rank 1
commented on 26 Oct 2022, 08:33 AM

Thank you for your help.

Is there a way to remove the white border that covers the entire chart?
Dess | Tech Support Engineer, Principal
Telerik team
commented on 26 Oct 2022, 08:45 AM

It is necessary to set the RadChartView.ChartElement.BorderWidth property to 0 and thus the border around the chart will be eliminated.
Jay
Top achievements
Rank 1
commented on 26 Oct 2022, 08:50 AM

All problem is clearly solved. Thank you.

Tags
ChartView
Asked by
Jay
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or