This is a migrated thread and some comments may be shown as answers.

Overriding Background Color for Skin

10 Answers 348 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
terrysmith
Top achievements
Rank 1
terrysmith asked on 11 Mar 2009, 03:55 PM
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


10 Answers, 1 is accepted

Sort by
0
terrysmith
Top achievements
Rank 1
answered on 12 Mar 2009, 04:22 PM
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

0
terrysmith
Top achievements
Rank 1
answered on 12 Mar 2009, 09:23 PM
I'm on a tight deadline, so I'm submitting a support ticket for this.

0
Accepted
Ves
Telerik team
answered on 13 Mar 2009, 11:14 AM
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.
0
Sue
Top achievements
Rank 1
answered on 19 Mar 2009, 09:28 PM
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?
0
Ves
Telerik team
answered on 23 Mar 2009, 08:36 AM
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.
0
Sue
Top achievements
Rank 1
answered on 23 Mar 2009, 02:00 PM
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!
0
PiG
Top achievements
Rank 2
answered on 06 Nov 2012, 10:04 AM
More than three years later, this bug is still not fixed.. Any news on this?
0
Princy
Top achievements
Rank 2
answered on 07 Nov 2012, 10:28 AM
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.
0
PiG
Top achievements
Rank 2
answered on 07 Nov 2012, 10:45 AM
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.


0
Ab
Top achievements
Rank 1
answered on 26 Mar 2013, 08:03 PM
... 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!!!!

 

 

Tags
Chart (Obsolete)
Asked by
terrysmith
Top achievements
Rank 1
Answers by
terrysmith
Top achievements
Rank 1
Ves
Telerik team
Sue
Top achievements
Rank 1
PiG
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Ab
Top achievements
Rank 1
Share this question
or