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

Filltype not solid when adding item with colour

2 Answers 59 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
david mills
Top achievements
Rank 1
david mills asked on 08 Jun 2010, 08:26 AM
Hi

I have a page where I am adding the items programmatically and specifying the colour of the bar. This works fine except that the FillType="Solid" specified in my ascx seems to be overidden and the bars fade with a gradient.

ascx:
 <telerik:RadChart ID="crtResults" runat="server"  SeriesOrientation="Horizontal" SkinsOverrideStyles="false" 
            OnItemDataBound="crtResults_ItemDataBound" AutoLayout="true"
            <ChartTitle> 
                <TextBlock Text="Title"
                </TextBlock> 
            </ChartTitle> 
            <Series> 
                <telerik:ChartSeries Name="Series" Type="Bar" > 
                    <Appearance LegendDisplayMode="Nothing" > 
                    <Border Visible="false"/> 
                    <FillStyle FillType="Solid" MainColor="White"></FillStyle> 
                    <LabelAppearance Visible="false" ></LabelAppearance></Appearance> 
                   
                </telerik:ChartSeries> 
            </Series> 
        </telerik:RadChart> 
 then adding items in code-behind:
 crtResults.Series[0].AddItem(1, "label", Color.Red);  

If I remove the Color param in the code, all bars display a solid white.

Thanks


2 Answers, 1 is accepted

Sort by
0
david mills
Top achievements
Rank 1
answered on 08 Jun 2010, 08:44 AM
I've also tried setting the fill type programmatically on the item databound event:
e.SeriesItem.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid; 

Still showing as fading bar
0
david mills
Top achievements
Rank 1
answered on 08 Jun 2010, 02:25 PM
For anyone who cares....

It looks like if you add items to the chart in the code behind and specify the colour, the FillType in the ascx is not pulled through.

This code solves my problem;
ChartSeriesItem newItem = new ChartSeriesItem(1, "label", Color.Red); 
newItem.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid; 




Simple really, but something that could be addressed or explained?
Tags
Chart (Obsolete)
Asked by
david mills
Top achievements
Rank 1
Answers by
david mills
Top achievements
Rank 1
Share this question
or