Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

different colours on a single bar ! MSChart..

Posted on 2000-05-03
4
Medium Priority
?
719 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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
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…
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…
Suggested Courses
Course of the Month11 days, 13 hours left to enroll

916 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