Solved

different colours on a single bar ! MSChart..

Posted on 2000-05-03
4
661 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
add text to end of existing text in file 16 69
SQL VB connection works in one PC and doesn't in another 15 58
Help me. 3 48
Problem to With line 4 43
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

863 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

25 Experts available now in Live!

Get 1:1 Help Now