Changing the color in MS chart

Posted on 2004-10-27
Last Modified: 2012-06-27
I know this is an easy question but i need to know.  
I'm using MS Chart for a bar graph.  I need to change the color of the series in the middle of the program.  How would i do that?  i've been trying to do it like this.

AXMSChart1.forecolor =

but that doesn't change the bar part.  any ideas.  thanks!

Question by:kevinmeredith
    LVL 6

    Expert Comment

    you cuold try

    AXMSChart1.forecolor =  System.Drawing.Color.Red

    that should work

    Author Comment

    Thanks for the idea BioChemist, but that didn't work.  I need to change the fill color i think but i dont' know.  any other ideas???
    LVL 6

    Expert Comment

    Now that was an absolute nightmare trying to find!

    1) What you have to do is change the backdrop property using a brush adapter setting iot to fill and then setting the color in RGB format (255,255,255) = white
    2) Then you have to set the fill style to use a specific brush!

    But here it is, all you have to do is choose your color and work out the RGB value or just plau around changing the 255s to other numbers!

            With AxMSChart1
                .Backdrop.Fill.Brush.FillColor.Set(255, 255, 255)
                .Backdrop.Fill.Style = MSChart20Lib.VtFillStyle.VtFillStyleBrush
            End With

    Author Comment

    Thanks so much Bio, but that is still not what I am looking for. (but it is usefull i will use it in the future).  What i am looking for is to change the data series color on the graph.  The default is green and i want to change it to red in the middle of my program.  Sorry if i were confusing the first couple posts.  I really appreicate all your help on this too!


    Author Comment

    I found what i was looking for.  the code is right here

                AxMSChartMainHeL.Plot.SeriesCollection(1).DataPoints(-1).Brush.FillColor.Set(255, 0, 0)

    Thanks for all your help Bio!

    Accepted Solution

    Closed, 150 points refunded.

    Community Support Moderator
    Experts Exchange

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    856 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now