Click here to Skip to main content
15,795,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I’m using column chart (Bar chart) of MSChart in my project. I need to do following 2 things.

1. I need to customize y-axis labels. I want to add string "R+" before y axis labels
2. I need to change the color of the bar if it is negative.

Any help will be highly appreciated.


1 solution

Changing the color of the bar isn't generally done. If the color red represents a data point, it should be red whether it's positive or negative. Otherwise the user won't be able to find it, and it changes meaning of the data.
Share this answer
Md Athaulla 20-Dec-11 6:38am    
Yes your right but the user wants it in that way. right now all the bars are in the same color. he wants negative values with red bar and positive with blue bars. please click the below link for the snapshot
#realJSOP 22-Dec-11 6:19am    
If that's the case, see if the column chart has a property for setting the bar colors based on whether they're positive or negative. If you can;'t do that, then see if you can set individual bar colors in a given series (but I doubt you can). Failing all of that, create separate series that contains the negative values.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900