Solved

MSChart Expert Needed - Color Question

Posted on 2001-06-26
2
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month3 days, 15 hours left to enroll

630 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