Solved

different colours on a single bar ! MSChart..

Posted on 2000-05-03
4
650 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
  • 2
4 Comments
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
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
Comment Utility
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
Comment Utility
Just checked - mschart does allow stacked bar charts - chart properties - stack series.
0
 

Accepted Solution

by:
manimala earned 50 total points
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

19 Experts available now in Live!

Get 1:1 Help Now