Solved

MSChart Expert Needed - Color Question

Posted on 2001-06-26
2
235 Views
Last Modified: 2008-02-01
I have used the MSChart extensively in Visual Basic where setting the colors is as simple as right clicking on the chart component and selecting properties.

However, I am using a ASP add-on called ASPControlHost which allows the MSChart control to be used in Active Server Pages.  However, this means the chart colors must be set programmatically, and the documentation on this control in the MSDN library is frankly quite a maze.  The problem is further complicated by the fact that none of the constants for the control available as they are in VB.  

I would like to use a black background and have the title and the legend text appear in light brown or green.  



0
Comment
Question by:Dreaming_Eagle
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 6230587
Dreaming_Eagle, this is VB but not using the constants, you can easily adapt this as necessary for ASP. It sets the background colour to black and both the title and legend forecolours to a light green colour, you can obviously change this to an appropriate colour by setting the RGB parameters in the relevant .Set 0,200,0 (.Set Red,Green,Blue) lines.

    With MSChart1.Plot.Backdrop.Fill
        .Style = 1
        .Brush.FillColor.Set 0, 0, 0
        .Brush.PatternColor.Set 0, 0, 0
    End With
    With MSChart1.Backdrop.Fill
        .Style = 1
        .Brush.FillColor.Set 0, 0, 0
        .Brush.PatternColor.Set 0, 0, 0
    End With
    With MSChart1.Title
        .VtFont.VtColor.Set 0, 200, 0
        .Backdrop.Fill.Style = 1
        .Backdrop.Fill.Brush.FillColor.Set 0, 0, 0
    End With
    With MSChart1.Legend
        .Backdrop.Fill.Style = 1
        .Backdrop.Fill.Brush.FillColor.Set 0, 0, 0
        .Backdrop.Fill.Brush.PatternColor.Set 0, 0, 0
        .VtFont.VtColor.Set 0, 200, 0
    End With
0
 

Author Comment

by:Dreaming_Eagle
ID: 6238671
Thanks much, Tim, I'm awarding you the points.  We have, however, purchased a great chart control called 3DChart from Nevron.  http://www.nevron.com/moreinfo.asp?product=3

It's only $200 and has presentation quality comparable to vastly more expensive products.  Also, it comes with an extensive collection of sample .vbps to keep you from having to research out collections and properties in a Help file.    I realize this sounds like a paid advertisement, but I'm sold on it after just two days.

Thanks again.  
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

759 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