Solved

Problems with setting the color of the bar in an MSChart control

Posted on 2004-04-30
1
628 Views
Last Modified: 2013-12-26
Hi all,
I must be doing something very silly. I want to change the
color of the bar in an MSChart Control. I found (and pasted)
the code to do that from http://support.microsoft.com/default.aspx?scid=kb;en-us;177997

The resulting code is:
        ReDim arr(1 to 5, 1 To 2)
         For j = 1 To 5
            arr(j, 1) = j
            arr(j, 2) = j*100
        Next j
       
        With mschart1.Plot.SeriesCollection(1).DataPoints(-1)
            .Brush.Style = VtBrushStyleSolid
            .Brush.FillColor.Red = 255
            .Brush.FillColor.Green = 0
            .Brush.FillColor.Blue = 0
        End With
        mschart1.ChartData = arr()

But whatever the R,G,B combination I use, the bars are always green!!

(:confused)

Any clue? Thank you very much,

rr.



0
Comment
Question by:rrgw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
OHDev2004 earned 50 total points
ID: 10968504
instead of :
            .Brush.Style = VtBrushStyleSolid
            .Brush.FillColor.Red = 255
            .Brush.FillColor.Green = 0
            .Brush.FillColor.Blue = 0

Try this:
.Brush.FillColor.Set 255, 0, 0

OHDev2004
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
passing parameter in sql procedure 9 70
Modifying Conditional Format from VBA code 3 84
Passing a Text Box name to a Sub 6 104
MS SQL Update query with connected table data 3 80
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

738 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