Solved

MSChart Expert Needed - Color Question

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

751 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