Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

different colours on a single bar ! MSChart..

Posted on 2000-05-03
4
Medium Priority
?
713 Views
Last Modified: 2008-02-01
hi all, this has been bugging me for ages now. hope someone out there can help me.. k, straight to the point.

I am writing a golf program. Now what i am trying to do is lets say, someone got a 5 on a par 3..
ok, now i would like the bar graph (column) to represent 5, but i would like the colour upto 3 (par) to be different from the rest of the bar.
but i cant seem to find anything that will alow me to do this..
thanks in advance

0
Comment
Question by:MelbGuy
[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
  • 2
4 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2776374
how attached are you to the mschart control?  you could probably create your own graph using pictureboxes. or you could use a statusbar and set its orientation to vertical.
0
 
LVL 3

Expert Comment

by:paulstamp
ID: 2776438
For a straightforward bar chart like you describe I agree with AzraSound - make your own one using a picture box and draw your own rectangles.

Alternatively, use the BPS Graphic Server control which comes with VB. This allows you to create stacked bar charts, so say for a double-bogey on a par three you would have one data set showing three in blue, and a second showing two in red, stacked.

In fact I'd be surprised if you cant do this with mschart.

One other thing - these will work if you want flat colours (ie blue for the first part, red for the rest), but if you want a funky gradient fill starting blue and turning red towards the top you'd be better of writing your own.
0
 
LVL 3

Expert Comment

by:paulstamp
ID: 2776442
Just checked - mschart does allow stacked bar charts - chart properties - stack series.
0
 

Accepted Solution

by:
manimala earned 100 total points
ID: 2889232
You can use a single Row and more thatn one column to display few coloured bars.

For an example:
  With Form1.mschart1
      .Row = 1
      .Column = 2
      For Column = 1 to .Column
         'Assigning the array
         .Data = tArray(Column).Data  
         .ColumnLabel = "Period"
      Next Column
  End With

This is the basic outline. Try this.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

721 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