We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Chart Interior Border

Thread ID:

Created:

Updated:

Platform:

Replies:

75745 Aug 7,2008 03:27 PM UTC Aug 8,2008 07:44 PM UTC Windows Forms 2
loading
Tags: Chart
Robert Avery
Asked On August 7, 2008 03:27 PM UTC

I would like to eliminate all gridlines within the Chart Interior so that you only see the series. However, when I do that, how do I change the color of the border separating the ChartControl.ChartInterior
from the
ChartControl.ChartArea.BackInterior

Thanks.


Manohari [Syncfusion]
Replied On August 8, 2008 04:46 AM UTC

Hi Robert,

Thanks for your interest in Syncfusion products.

It is possible to differentiate the ChartInterior border with different color using the ChartArea.RenderBounds rectangle.Please find the sample code below.

Sample code:

this.chartControl1.PrimaryXAxis.DrawGrid = false;
this.chartControl1.PrimaryYAxis.DrawGrid = false;
this.chartControl1.ChartAreaPaint += new PaintEventHandler(chartControl1_ChartAreaPaint);
...
...

void chartControl1_ChartAreaPaint(object sender, PaintEventArgs e)
{
Rectangle chartInteriorBorder = this.chartControl1.ChartArea.RenderBounds;
Rectangle chartAreaBorder = this.chartControl1.ChartArea.Bounds;
using (Pen p = new Pen(Color.SteelBlue))
{
p.Width=3;
e.Graphics.DrawRectangle(p, chartInteriorBorder);
p.Color = Color.Maroon;
e.Graphics.DrawRectangle(p, chartAreaBorder);
}

}

Also I have attached the sample that illustrates the same in this link below.

http://websamples.syncfusion.com/samples/Chart.Windows/F75745/Main.htm

Kindly let us know if this meets your requirements. Thanks for your patience.

Regards,
Manohari.R


Robert Avery
Replied On August 8, 2008 07:44 PM UTC

This is great. Thanks.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;