Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Chart > Setting background image on bar chart
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Setting background image on bar chart

Feed from this thread
  • Mark avatar

    Posted on Mar 12, 2007 (permalink)

    trying to set the background image of the plot area on a chart of default type bar.  not sure where it's looking for the image but when I put something like
    "~/Images/myimage.jpg" it give me a file i/o exception that it cannot find the file...

    I am running in win xp, vstudio 2k5 without IIS on my machine (in other words using Cassini server rather than IIS) to debug.

    I swear it worked the first time and doesn't seem to work now.  I am combining this background image setting with images for the chartseriesItems.  The images on the chartseriesitems now work since I changed their series type to bar (didn't work as type Bubble)

    I can set the image path to be some absolute path, C:\mypath\image.jpg and that works in code or in the html...but if I try anything like ~/ImagePath/image.jpg it cannot find it even if I set the PlotArea image path in the same method that I set the chartseriesitem image paths and the paths are the same save the actual image name.

  • Steve Steve admin's avatar

    Posted on Mar 13, 2007 (permalink)

    Hi Mark,

    We were unable to reproduce the issue on our end. We set successfully the background image like this:

     RadChart1.Background.FillStyle = FillStyle.Image;
     RadChart1.Background.BackgroundImage = "~/Img/Sunset.jpg";


    Let us know if other questions/problems arise.

    Best wishes,
    Steve
    the telerik team

  • Mark avatar

    Posted on Mar 13, 2007 (permalink)

    thanks...this works for the PlotArea or the Chart when I do it in the code behind now, I guess I had some mismatched stuff in the aspx source

  • Mark avatar

    Posted on Mar 13, 2007 (permalink)

    I spoke too soon...there is a problem if you add this line

    RadChart1.PlotArea.ImageMode = ImageMode.Stretch;

    if I remove that line it works like a charm, if I put that in the code behind then I get an error saying it can't find the image file

    having it stretch would be good because then i don't have to match the image width and height exactly to the plot area.

  • Vladimir Milev Vladimir Milev admin's avatar

    Posted on Mar 13, 2007 (permalink)

    Hello Mark,

    We have no luck reproducing this issue. Can you please send us a small sample demonstrating the problem?
    Thanks in advance.

    Sincerely yours,
    Vladimir Milev
    the telerik team

  • mca avatar

    Posted on Jun 22, 2011 (permalink)

    Hi,

    I am having the issue if i am using the background in bar chart. i image is shaded at the end of the bars.
    Please help for this.
    Attached files

  • Evgenia Evgenia admin's avatar

    Posted on Jun 27, 2011 (permalink)

    Hello mca,

    We haven't faced such issue with our RadChart control. Can you please open a formal Support thread and send us a sample project where this erroneous behavior reproduces? This way we will be able to support you further.

    Best wishes,
    Evgenia
    the Telerik team

    Consider using RadControls for ASP.NET AJAX (built on top of the ASP.NET AJAX framework) as a replacement for the Telerik ASP.NET Classic controls, See the product support lifecycle here.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Chart > Setting background image on bar chart