Solved

MSChart Expert Needed - Color Question

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

740 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