Can't get solid color

Thread is closed for posting
7 posts, 0 answers
  1. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 01 Sep 2011 Link to this post

    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.
  2. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 02 Sep 2011 Link to this post

    Anyone have any ideas?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bartholomeo Rocca
    Bartholomeo Rocca avatar
    247 posts
    Member since:
    May 2006

    Posted 06 Sep 2011 Link to this post

    Hello,

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


    Greetings,
    Bart.
  5. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 07 Sep 2011 Link to this post

    That kind of works, but the bars still have some opacity (transparency) to them. Is there any way to make them completely solid?
  6. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 12 Sep 2011 Link to this post

    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.
  7. Sushobhit
    Sushobhit avatar
    26 posts
    Member since:
    Apr 2011

    Posted 13 Sep 2011 Link to this post

    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 .
  8. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 15 Sep 2011 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017