Solved

MSChart Expert Needed - Color Question

Posted on 2001-06-26
2
242 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

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 …
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

856 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