.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Series Color in MSCHART

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :ASP.Net

Hello I have a Chart with diferente series when I added those series to my Chart the have diferente colors by default but my legend dont reconize these colors in the series and when I put the color to my serie manual then my legend reconized the colors.

The problem is that I have many series and a lot of time I dont know how many series are. I need somenthing for put diferent color to my series or something to fix it and the legend reconize the automatic color.

Series Name is different for all my new series.

//Add serie


//{If I tried something like this :newChart.Series[SeriesName].Color = Color.Green; All my series are green and my legend reconize those color for the differents series}


newChart.Legends[SeriesName].CustomItems.Add(newChart.Series[SeriesName].Color, ChartD.LegendLabels[i]);

View Complete Post

More Related Resource Links

MSChart - color only part of background

I'm trying to make a risk chart in ASP.NET using an MSChart control, and I only want to color the background for some of the quadrants.  The chart is 5 by 5, with 25 quadrants, and let's say I just want to color the upper-right quadrant red.  Can anyone tell me if that is possible?Thanks!Dave

Expression to pick a chart series color by ordinal from custom palette



This is probably an easy question but I cannot find a solution to this. The stored procedure that I use to retrieve data for my bar chart in SSRS returns an ordinal number for each row, which represents a group the item belongs to. For example, I get:

Car - 20% - 1
Bus - 10% - 1
Train - 15% - 1
Bike - 3% - 2
Inline skates - 16% - 2

so 1 is all vehicles with an engine, and 2  all vehicles without engine. What I would like to do is to plot a bar with the percentage for each row and in the color of the custom palette, so Car, Bus and Train would get the first color of the user defined palette, Bike and Inline skates would be the second color of the custom palette.

I think I have to use the Choose function in the expression for this but I cannot figure out how to access the custom palette to retrieve all colors.


I know I could retrieve a color code from the database instead of the group ordinal, but I would prefer to have the color being picked from the custom palette; is this possible?

Thank you,



MSchart (more series) slows down web application?


I am using MS Chart Control 3.5 and four series.  Each series has 500 points and I"m using the DataBindXY method to bind data from array.

If I draw two waveforms in MSChart, the postback controls on the webapplication are fast and response.  If I add a third, it slows down a bit.  If I add a fourth series, the applications response tremenedously drops. 

The chart is inside an updatepanel.  I've narrowed it down to the fact that it is caused by the series and also by points.  I can alleviate the situation when I set a lower axis minimum and maximum to reduce the range of the graph.  This will then plot maybe the first 75 points out of 500.  Then the problem goes away.

anyone know why MSChart severely lags the web application?  I've stepped through the drawchart function and it does not hang there.  I suppose it is caused by an internal object function of the MSChart object.

ASP.NET, HTML, JavaScript Snippet Support (VS 2010 and .NET 4.0 Series)

This post covers another useful improvement in VS 2010 - HTML/ASP.NET/JavaScript snippet support. Snippets allow you to be more productive within source view by allowing you to create chunks of code and markup that you can quickly apply and use in your application with a minimum of character typing.

Visual Studio has supported the concept of "snippets" for VB and C# in previous releases - but not for HTML, ASP.NET markup and JavaScript. With VS 2010 we now support snippets for these content types as well.

Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

VS 2010 and .NET 4 Series

VS 2010 and .NET 4 are the next major releases of our developer tools and framework. Together they contain a ton of new functionality and improvements that I think you'll really like, and which make building applications of all types easier, faster and better. The improvements range from nice small tweaks to major, major enhancements - and can be found across the .NET Framework, the languages, and the IDE.

GridView Sorting/Paging : 'REAL' AJAX with Asp.Net Series

This is a continuation of my 'REAL' AJAX with Asp.Net (not Asp.Net AJAX) series posts for those of us trying to stop relying on Asp.Net 'AJAX'.

Ok, nothing too dramatic to start things off, we are going to make some tabled data sortable and pagable all without using a bit of postback. Not only that, but it is going to be incredibly easy!

Free Series of SharePoint Workflow How-to Videos

This is the series of "How to" Document Workflow with SharePoint using Visual Studio 2008 (using the .NET Framework 3.0 for backward compatibility to Visual Studio 2005). I have created video's that show the most common requests that I have seen around MOSS/SharePoint 2007 workflow & document workflow.

Feature available to Silverlight 4 with VS 2010.

In Part I of this article series we have seen some features available to Silverlight 4 with VS 2010. We will continue to explore more in this article.

Download and Share Visual Studio Color Schemes

The good news is that Visual Studio allows you to completely customize the editor background and text colors to whatever you want - allowing you to tweak them to create the experience that is "just right" for your eyes and personality. You can then optionally export/import your color scheme preferences to an XML file via the Tools->Import and Export Settings menu command.

Ajax Tab: Each TabPanel with different Color



I have situation like, Each tab panel should display with different colors based on the status. Example:

Completed tabs should display in "Green"

Inprogress status tabs should display in "Red"

Not eligible status tabs should display in "Gray".

Ajax Tab look and feel is very good. So, thought of using the Ajax Tab for my above requirement. I tried to change it. But I am not able to change the color of the each tab.  

Is it possible to change the color of each tab in Ajax Tab control? Pleas help me.

If not possible, please suggest any other tab controls to achieve above my requirement.

Note:I already tried with IE tab controls, since it provides me that flexibility to change the color of the each tab. But, It is crashing my browswer. I am not sure about the reason.

I tried Jquery option, since I need to change the tab status dynamically based on the selection made in that same page, I am not able to achieve this one in the JQuery.

Selected to change the background color of the page



As this site, http://www.borfin.com.tr/genel/Default.aspx, How can I change the background color selected pages.



Hi there,


 I am doing one task on asp.net graphics. i would like to a form that let the user choose the color code from the color picker.

inside my backend code, i can get the color code and convert to the system.drawing.color.



Dim col As System.Drawing.Color = System.Drawing.ColorTranslator.FromHtml("#9932CC")

 Dim Brush As New SolidBrush(col)


but i have some problem in make this col object to alpha color. as i know the .net code that make the system color to become alpha is wrote as like tat :

gr.DrawString(strWatermarkText, wmFont, New SolidBrush(Color.FromArgb(8, 0, 0, 0)), x, y)


May someone share me how to make the color input from form to become alpha color? thanx in advanced. hope to hear from you all soon 


Toolbox: Realistic Test Data, Dare Obasanjo's Blog, Color-Coding Tools, and More


This month Scott shows how to generate realistic test data, visits Dare Obasanjo's blog, and demonstrates color coding code for better readability.

Scott Mitchell

MSDN Magazine October 2008

Get A Raise: Discover a Series of Fortunate Event Handlers in Visual Basic


You may use them every day, but how much do you really know about events? What's going on when you add an event handler to a class? In this article, Ken Getz demonstrates various ways to interact with events and event handlers, and shows how they can solve common problems. Along with the article, you can download two sample applications (one for Visual Basic .NET 2002 and 2003 and one for Visual Basic 2005) and follow along.

Ken Getz

MSDN Magazine June 2005

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend