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. Image for the cookie policy date
close icon

Chart Interior Border

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.


2 Replies

MA Manohari Syncfusion Team 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



RA Robert Avery August 8, 2008 07:44 PM UTC

This is great. Thanks.


Loader.
Live Chat Icon For mobile
Up arrow icon