Overriding Background Color for Skin

Thread is closed for posting
11 posts, 1 answers
  1. terrysmith
    terrysmith avatar
    127 posts
    Member since:
    Nov 2006

    Posted 11 Mar 2009 Link to this post

    I want to use the Vista skin but override the chart background to white. Is this not possible without having to make my own skin? The following is not working for me:

    <telerik:RadChart ID="chart" Skin="Vista" runat="server"
        <Appearance> 
            <Border Visible="false" /> 
            <FillStyle FillType="Solid" MainColor="White" /> 
        </Appearance> 
    </telerik:RadChart> 

    Thank you


  2. terrysmith
    terrysmith avatar
    127 posts
    Member since:
    Nov 2006

    Posted 12 Mar 2009 Link to this post

    I'm still looking for some help on this one. I've tried setting a number of the Appearance and FillStyle properties,and I still can not get a solid white background.

    Thank you

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. terrysmith
    terrysmith avatar
    127 posts
    Member since:
    Nov 2006

    Posted 12 Mar 2009 Link to this post

    I'm on a tight deadline, so I'm submitting a support ticket for this.

  5. Answer
    Ves
    Admin
    Ves avatar
    2879 posts

    Posted 13 Mar 2009 Link to this post

    Hello Terry,

    Here is the answer provided in the support ticket:

    It seems you have hit a bug in RadChart. The solid fill type is not respected in this case. Fortunately, there is a simple workaround -- set the FillType to "Gradient" and set both MainColor and SecondColor to White.

    Best regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Sue
    Sue avatar
    8 posts
    Member since:
    Mar 2009

    Posted 19 Mar 2009 Link to this post

    I am also having a similar problem trying to set the background color of the PlotArea of a line chart. I originally specified FillType.Solid, then per this thread, set both the MainColor and SecondColor to white, and used FillType.Gradient. I did this for both the PlotArea, and the entire chart itself...

    chart.RadChart.Appearance.FillStyle.MainColor = Color.White; 
    chart.RadChart.Appearance.FillStyle.SecondColor = Color.White; 
    chart.RadChart.Appearance.FillStyle.FillType = FillType.Gradient; 
     
    chart.RadChart.PlotArea.Appearance.FillStyle.MainColor = Color.White; 
    chart.RadChart.PlotArea.Appearance.FillStyle.SecondColor = Color.White; 
    chart.RadChart.PlotArea.Appearance.FillStyle.FillType = FillType.Gradient; 

    while the chart background is solid white when FillType is set to either Solid or Gradient, the chart PlotArea continues to display horizontal alternating blocks of gray/white. Is there a different set of properties that must be set so as to create a solid white background in the PlotArea?
  7. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 23 Mar 2009 Link to this post

    Hello Sue,

    Is it possible that you see the Y axis gridlines? You may need to disable them too:

    RadChart1.PlotArea.YAxis.Appearance.MajorGridLines.Visible = false;
    RadChart1.PlotArea.YAxis.Appearance.MinorGridLines.Visible = false;

    Sincerely,
    Ves
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  8. Sue
    Sue avatar
    8 posts
    Member since:
    Mar 2009

    Posted 23 Mar 2009 Link to this post

    The result was due to outdated dll's, and the background color being set using a ChartMarkedZone JUST prior to layout, but sequentially after the code described that I used to set the PlotArea background color. For my purposes though, I do want the Y axis gridlines to display. Thank you for the quick response!
  9. PiG
    PiG avatar
    2 posts
    Member since:
    Oct 2012

    Posted 06 Nov 2012 Link to this post

    More than three years later, this bug is still not fixed.. Any news on this?
  10. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Nov 2012 Link to this post

    Hi,

    You can set the background color of RadChart as follows.

    ASPX:
    <telerik:RadChart ID="RadChart2"  runat="server" Skin="Vista" >
      <PlotArea>
        <Appearance>
          <Border Visible="false" />
          <FillStyle FillType="Solid" MainColor="Black" />
        </Appearance>
     </PlotArea>
      <Series>
       .....................
      </Series>
    </telerik:RadChart>

    Hope this helps.

    Thanks,
    Princy.
  11. PiG
    PiG avatar
    2 posts
    Member since:
    Oct 2012

    Posted 07 Nov 2012 Link to this post

    Well yes, the _PlotArea_ is ok, but the background area OUTSIDE this does not work when setting the filltype to solid. It has to be set as gradient, and then both maincolor and secondcolor need to be set to the same value.

    This SHOULD work:
    RadChart RadChart = new RadChart();
    RadChart.Skin = "Vista";
    RadChart.SkinsOverrideStyles = false;
    RadChart.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
    RadChart.Appearance.FillStyle.MainColor = System.Drawing.Color.White;


    It doesn't, you have to use this workaround, which was suggested three years ago:
    RadChart RadChart = new RadChart();
    RadChart.Skin = "Vista";
    RadChart.SkinsOverrideStyles = false;
    RadChart.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Gradient; // WORKAROUND
    RadChart.Appearance.FillStyle.MainColor = System.Drawing.Color.White;
    RadChart.Appearance.FillStyle.SecondColor = System.Drawing.Color.White; // WORKAROUND


    It's confirmed to be a bug, so I think the workaround is not a solution to the problem.
    It has taken me a few hours to solve (ie find the workaround), time which I rather have invested in my code.


  12. Ab
    Ab avatar
    3 posts
    Member since:
    Dec 2012

    Posted 26 Mar 2013 Link to this post

    ... now 2013 and the bug still hasnt been fixed!!! wow!

    Apparantly charts do not like some colors. In this case white wasnt taking affect, using Transparent worked. This is a bug too, several colors are not supported in other areas ...
    Appearance-Border-Color="Transparent"
    Appearance-FillStyle-FillType="Solid"
    Appearance-FillStyle-MainColor="Transparent"
    Appearance-FillStyle-SecondColor="Transparent"
    PlotArea-Appearance-FillStyle-FillType="Solid"
    PlotArea-Appearance-FillStyle-MainColor="Transparent"
    PlotArea-Appearance-FillStyle-SecondColor="Transparent"
    PlotArea-Appearance-Border-Color="Transparent"  

    Hope this helps! Shouldnt have to spend so much time on this!!!!

     

     

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017