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.

Change bar colours and chart padding

Thread ID:

Created:

Updated:

Platform:

Replies:

61520 May 28,2007 10:25 AM Jun 6,2007 04:38 AM ASP.NET Web Forms (Classic) 6
loading
Tags: Chart
Nathan Dunn
Asked On May 28, 2007 10:25 AM

Couple of questions:

I've set the palette to Default and if I have one bar graph, the bars are a set colour. If I had a couple of line graphs on top, the first line graph takes the colour of the bar graph without the line graphs.

How can I set the bar graph so it is always the same colour whether there are other line graphs on top?

Secondly, is there anyway to reduce the padding between the graph and the image it is generated in (I've highlighted it in gray in the attached image)?

Thanks.

Untitled-1.zip

Rashidha F [Syncfusion]
Replied On May 28, 2007 10:51 AM

Hi Nathan,

Thanks for using Syncfusion Products.

You can able to acehive your requirements using Custom color palette and Element spacing features in chart web control.

Please take a look at the attached sample.

http://websamples.syncfusion.com/samples/Chart.Web/5.1.0.51/I61520/main.htm

Let me know if this helps.

Regards,
Rashidha.

Nathan Dunn
Replied On June 1, 2007 08:09 PM

Hi Rashidha

Thanks for your help. Your suggestion fixed the padding issue I was having.

Please see the attachment, I want the bars in both graphs to be the same colour (the only difference is the second graph also has two line graphs).

Thanks
Nathan

23.zip

Rashidha F [Syncfusion]
Replied On June 2, 2007 02:53 AM

Hi Nathan,

Thanks for your Screen shots.

Please take a look at the attached sample.

http://websamples.syncfusion.com/samples/Chart.Web/5.1.0.51/F61520/main.htm

The above sample shows how to set the custom color for each series.

Please let me know if this helps.

Regards,
Rashidha.

Nathan Dunn
Replied On June 3, 2007 02:10 AM

Hi Rashidha

Still no luck.

Please see the attachment, would like the bars in the background to remain the same colour no matter if they are the only thing in the graph, or if they have one or two lines overlapping.

Does it matter what order they are added to the graph?

Thanks
Nathan

images26.zip

Rashidha F [Syncfusion]
Replied On June 4, 2007 04:40 AM

Hi Nathan,

Thanks for your Information and Screen shots.

When the chart is rendered, the interior color for each series is normally specified by the interior property of the series style. However this is not always the case. In cases where the interior property is left uninitialized, the chart uses its color model to retrieve an array of colors called a palette for this purpose. The ChartColorModel class serves as a repository for color information. Chart series color will vary depending upon the number of series in the chartcontrol.

You can make use of PrepareStyle Event available in chartControl, for your requirement.

The following code snippet illustrates how to set interior color to the series.

protected void ChartControlSeries_PrepareStyle(object sender, ChartPrepareStyleInfoEventArgs args)
{
ChartSeries series = sender as ChartSeries;
if (series != null)
{
args.Style.Interior = new BrushInfo(Color.FromArgb(149, 51, 58));

}
}

Please have a look at the attached sample.

http://websamples.syncfusion.com/samples/Chart.Web/5.1.0.51/F61520_1/main.htm

Please let me know if this helps.

Regards,
Rashdiha.

Nathan Dunn
Replied On June 6, 2007 04:38 AM

Hi Rashdiha

Thanks for all your help, your last suggestion has worked brilliantly.

Regards
Nathan

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.

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.

;