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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ChartAreaBackImage not showing in the main part of a graph.

Thread ID:





34419 Sep 8,2005 10:12 PM UTC Sep 9,2005 07:15 PM UTC WinForms 5
Tags: Chart
Rich Strangfeld
Asked On September 8, 2005 10:12 PM UTC

In version 2.1 we were doing some custom stuff by creating a bitmap and giving it to the chart control by setting ChartAreaBackImage. The chart displayed our bitmap in the inner rectangle of the chart; that is, in the rectangle whose left side is the Y axis line and whose bottom is the X axis line. Now in 3.2.2 I''m trying the same thing and I find a couple of things: 1. The chart area background image is now displayed in a larger rectangle that includes the all of the x and y axis area (legends and all), plus a little extra margin at the top and right. That''s OK. 2. However, the image is *not* displayed in the inner rectangle of the chart, the one place where it originally appeared. That area is filled with a solid white background that covers that rectangle. We only see our image in the areas around the inner rectangle; that is, under the axis legend area and margins. I can send you a picture if you like. I see a chart apparently doing the right thing in the Chart Background Sample. I can start eliminating code to try to reduce the differences between that code and mine, but there''s a lot of code to eliminate. Before I do that, do you have any suggestions? One thing I notice in the Chart Background Sample is that the background picture looks different under the inner rectangle of the chart. It''s lighter there than around the edges. Looking at the sample code I can''t see why. Is there something going on with partial transparency by default in the chart? Is it possible that somehow I''ve got the inner rectangle opaque where the sample doesn''t, and that''s why the background isn''t showing through? Any suggestions are welcome. Thanks! - Rich

Rich Strangfeld
Replied On September 8, 2005 10:15 PM UTC

Correction, now we''re in version 3.3.0. - Rich

Geetha M [Syncfusion]
Replied On September 9, 2005 07:27 AM UTC

Hi Rich, 1.You can have the image at the background of the inner rectangle, that is, in the plotting area by setting the image to the ChartAreaBackImage of the ChartControl. 2.The slight color difference which you see in the sample can be eliminated by setting the chart interior color as empty. The following code explains these two settings: Image img = new Bitmap (filename); this.chartControl1.ChartAreaBackImage = img; this.chartControl1.ChartInterior=new BrushInfo (Color.Empty); I hope this fulfills your requirements. Please let me know if you have any questions. Thanks, Geetha.

Rich Strangfeld
Replied On September 9, 2005 02:19 PM UTC

Geetha - Thanks for your prompt reply. We''re already setting the ChartAreaBackImage. It''s showing our image around the edges (in the axis and margin areas) but not in the inner rectangle where there''s a solid white background. Setting the ChartInterior=new BrushInfo (Color.Empty) does eliminate the lighter background in your sample, so that''s explained. It doesn''t make our solid white background go away in our own chart though. With the combination of ChartAreaBackImage and an empty brush ChartInterior, we''re still seeing the problem. Rich

Administrator [Syncfusion]
Replied On September 9, 2005 07:14 PM UTC

Hi Rich, What is the order in which you are setting the ChartInterior and the ChartAreaBackImage? Could you please try setting the ChartAreaBackImage last if its not currently set to be in that order. Thanks, Davis

Rich Strangfeld
Replied On September 9, 2005 07:15 PM UTC

OK; I found what I was doing wrong. My particular subclass of ChartControl was setting its ChartInterior to new BrushInfo(Color.Empty), but the container that owned it was subsequently setting it to new BrushInfo(Color.White), so it ended up white and the image didn''t show through. My fault. Thanks for the help! - Rich


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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