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

PlotArea border

1 Answer 46 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Mariusz Wiejski
Top achievements
Rank 2
Mariusz Wiejski asked on 18 Aug 2011, 01:24 AM
I have a plain radchart. Only thing is I want to have a black border around the plotarea something you see in Ajax radchart like the attached file.

Can I achieve this via code behind?

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 23 Aug 2011, 11:49 AM
Hi Mariusz,

Currently there is no direct way to set Border for the ChartArea. However you may use the following approach: wire to the LayoutUpdated event of the ChartArea and add the following code lines that search for Border child of the ChartArea:
void ChartArea_LayoutUpdated(object sender, EventArgs e)
        {
            var clipPanel = minuteChartData.DefaultView.ChartArea.FindChildByType<RadTransitionControl>();
            var grid = clipPanel.FindChildByType<Grid>();
            var border = grid.FindChildByType<Border>();
            border.BorderBrush = new SolidColorBrush(Colors.Green);
            border.BorderThickness = new Thickness(3);
        }

Feel free to customize the BorderBrush Color or the BorderThickness as per your needs.

Best wishes,
Evgenia
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Chart
Asked by
Mariusz Wiejski
Top achievements
Rank 2
Answers by
Evgenia
Telerik team
Share this question
or