Solved

different colours on a single bar ! MSChart..

Posted on 2000-05-03
4
687 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 50 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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
using Access 8 96
Access Object Property from VBA Module in Excel 2010 2 45
Modifying Conditional Format from VBA code 3 85
Sub or Function is not defined 6 59
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

710 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