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

Can't get solid color

6 Answers 41 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Web Services
Top achievements
Rank 2
Web Services asked on 01 Sep 2011, 10:03 PM
I'm trying to set a solid color in the bar graph but it always gives me a fading color. Any ideas why? Here is my code

            Dim bar As New ChartSeriesItem


            bar.YValue = 1


            bar.Appearance.FillStyle.MainColor = Drawing.Color.ForestGreen
            mySeries.Appearance.FillStyle.FillType = Styles.FillType.Solid
            mySeries.AddItem(bar)


            chart.Series.Add(mySeries)

Also, do you know of any way to pick a random color? I.e. where I have drawing.color.forestgreen, I'd just like a random color so each bar is a different color.

6 Answers, 1 is accepted

Sort by
0
Web Services
Top achievements
Rank 2
answered on 02 Sep 2011, 09:21 PM
Anyone have any ideas?
0
Bartholomeo Rocca
Top achievements
Rank 1
answered on 06 Sep 2011, 12:50 PM
Hello,

Have you tried setting bar.Appearance.FillStyle.FillType = Styles.FillType.Solid as well?


Greetings,
Bart.
0
Web Services
Top achievements
Rank 2
answered on 07 Sep 2011, 08:43 PM
That kind of works, but the bars still have some opacity (transparency) to them. Is there any way to make them completely solid?
0
Giuseppe
Telerik team
answered on 12 Sep 2011, 05:08 PM
Hello Web Services,

We are unable to reproduce the problematic behavior in our local tests. These two snippets both work as expected:
Dim mySeries As New ChartSeries()
Dim bar As New ChartSeriesItem()
bar.YValue = 1
 
' individual bar appearance
bar.Appearance.FillStyle.MainColor = System.Drawing.Color.ForestGreen
bar.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid
 
mySeries.AddItem(bar)
 
chart.Series.Add(mySeries)

Dim mySeries As New ChartSeries()
Dim bar As New ChartSeriesItem()
bar.YValue = 1
 
' bar series appearance
mySeries.Appearance.FillStyle.MainColor = System.Drawing.Color.ForestGreen
mySeries.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid
 
mySeries.AddItem(bar)
 
chart.Series.Add(mySeries)



Greetings,
Giuseppe
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sushobhit
Top achievements
Rank 2
answered on 13 Sep 2011, 01:42 PM
hi all

i have also face the problem i have done the following ---
bar.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid
but i also find the same problem .please solve my problem .
0
Giuseppe
Telerik team
answered on 15 Sep 2011, 08:12 AM
Hi Sushobhit,

We have already provided code snippets for two possible solutions that achieve the desired appearance in our previous post.


Regards,
Giuseppe
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Tags
Chart (Obsolete)
Asked by
Web Services
Top achievements
Rank 2
Answers by
Web Services
Top achievements
Rank 2
Bartholomeo Rocca
Top achievements
Rank 1
Giuseppe
Telerik team
Sushobhit
Top achievements
Rank 2
Share this question
or