How to change the color of a bar in a bar chart

 For the life of me, I can't find how to change the color of the bar in a bar chart. 

It seems like it would be a simple thing, but I can't find anything in the properties that seems to relate to it.

I have a bar chart with subtype as "bar chart" -- i.e., just a bar for each data point, either positive or negative.  The positive should be blue; the negative red.  As it is now, the default color for positive is blue, for negative green, but management does not like that color combo.

Can anyone help?

Thanks in advance...


Cynthia
0
CynthiaD
1/5/2007 11:38:52 PM
asp.net.ssrs 4514 articles. 1 followers. Follow

7 Replies
882 Views

Similar Articles

[PageSpeed] 14

Hi,

  I'm talking out of my hat a bit on this one, but I believe that what you want to look at is the use of "skins" and "themes."  I'm guessing two things, that you are talking about a barchart control that you're using and that you are using ASP.Net 2.0 (Skins and Themes aren't available in 1.1).  I'm also guessing that you have used CSS to sytle html, but can't find a way to get it work on the control - you need to use skins and themes.  Here's a vid to look at http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032278423&EventCategory=5&culture=en-US&CountryCode=US

There's one other thing to look at http://asp.net/CSSAdapters/Default.aspx.  I haven't tried them myself, but looks like it might help you to get the control to play nice with CSS.  Hope it helps.  BRN..

0
Brian27
1/6/2007 8:28:55 AM

Well thanks Brian, but it looks like what you're talking about is HTML -- my problem is with a chart control inside a report using SQL Server Reporting Service. 

I did find a way to get it to change the color of ALL the bars -- properties dialog, data tab, values edit, Appearance tab, Fill tab (something like that -- I don't have it in front of me right now).  If I change the color of the fill, ALL the bars change to that color.

However, I don't want ALL the bars to be the same color.  I have the "series" grouped according to whether the value is positive or negative.  By default, RS makes the positive bars blue and the negative bars green.  I need the negative bars to be red. 

 I tried using an expression like IIf(Fields!IsPositive.Value=True,Blue,Red) but it told me (predictably) that I hadn't defined Blue and Red.  But I think perhaps the right expression for the "fill" color might work.  I just don't know what it is.


Cynthia
0
CynthiaD
1/6/2007 7:06:11 PM

Hi,

  Not familiar with the control you mentioned (but I'll try to take a look if I have time).  CSS does work on HTML, Themes and Skins were built to offer CSS-like capablities to ASP.Net server controls.  Server controls don't always map directly to HTML controls, so something more than CSS is needed to set the properites for the controls, so they'll look the way you want when the page is rendered as HTML on the users browser.

  If you're using VS 2005, you should be able to look at all the parts of the control that have properties that you can set.  As color is so important to charts and graphs, I have to think that the colors of the bars will be accessable properties.

  When you place the control on the page (in design view), does it have a little black arrowhead in the upper right?  On a Calendar control (for example), clicking on that lets you select an Auto Format (one of a list of styles for that control).  That's one way you might get what you want.  If you  look at the control in source view, and position the curosr just after the start tag for the control, and hit a space, VS's Intellisense will show a large list of properties.  Dbl click one of theose and hit an equal sign, and you'll see a list of values that you can asign to that property.  If your control is anything like the calendar control, you should be all set.

  Good luck in any event.  BRN..
 

0
Brian27
1/7/2007 3:14:03 AM

For the record, I have found the answer to this problem.  It's detailed in this MSDN article:  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/MoreSSRSCharts.asp.

There are ways you can set the color of the bars, but it's not at all intuitive, and doesn't seem to be documented too well (if at all) in the Books Online for SQL Server.  But this is a great article for all kinds of chart issues.


Cynthia
0
CynthiaD
1/8/2007 7:58:47 PM

Hi,

  Glad you got what you needed.  Why don't you mark your own post as the answer - then others will see a solution, should they search the forums for an answer to a similar problem.  BRN..
 

0
Brian27
1/9/2007 3:23:54 AM

I hate to resurrect an old post, but I could really use the information from that article.  However, the link above is broken.  Can anyone please point me to where the article is currently hiding.  Thanks!

0
mattbug
7/6/2007 1:45:42 PM
0
mattbug
7/6/2007 2:25:14 PM
Reply:

Similar Artilces:

Change bar chart color by bar value
I've managed to get my bar chart to show 2 colors by the following code in reportviewer; =IIF(Sum(Fields!AvgScore.Value) > 90, "Goldenrod", "Silver")  but I need to nest another IIF statement that says if it is less than 80 a different set of colors.  I can't seem to get the syntax right for this.. is it even possible? =IIF(Sum(Fields!AvgScore.Value) >90, "Goldenrod",IIF(Sum(Fields!AvgScore.Value) <80, "yourcol","Silver"))...

How do I change colors on bar charts and pie charts
Hi. Sorry I am new to Infomaker (v9). Can anyone tell me how to change the colors that it defaults to for bar and pie charts. Many thanks. You can't. A really dumb restriction. Please submit an enhancement request (see below). -- Terry Dykstra (TeamSybase) http://powerbuilder.codeXchange.sybase.com/ http://www.pb9books.com product enhancement requests: http://my.isug.com/cgi-bin/1/c/submit_enhancement <Hugh Rogers> wrote in message news:44a3784b.2e55.1681692777@sybase.com... > Hi. Sorry I am new to Infomaker (v9). Can anyone tell me > how to change t...

How do I change the bar color in a bar graph?
How do I change the 'bar' color in a bar graph that is in a dw? I am using PB 11.2 Build 8616. setSeriesStyle() or setDataStyle(). Any chance to upgrade to 11.5? The graph engine got a complete overhaul and now uses DirectX... -- Paul Horan[Sybase] paulhoran.pbdjmagazine.com <Anthony> wrote in message news:49e3689b.428.1681692777@sybase.com... > How do I change the 'bar' color in a bar graph that is in a > dw? > > I am using PB 11.2 Build 8616. I tried using SetDataStyle and it does not work. The return code is always -1. Ther...

Changing series colors in stacked bar chart
Hi, How do I change the color of the 5th serie and above in a stacked bar chart ? Thanks, Marcel The first way I would do it is to open the report in crystal and connect it to a live datasource (if you are using a dataset, create a temporary view with the same column names and connect to that). Preview the report in crystal (click on the lightning bolt) to view the report with the graph. You should be able to edit any of the series by right clicking on the line or bar that relates to that series and going to Chart Options>Selected Item and you should be able to change the colou...

Bar below the browser bar (status bar???)
Name: Mike Harris Email: usmmmhatyahoodotcom Product: Firefox Summary: Bar below the browser bar (status bar???) Comments: I deleted 1.5 and installed 2.0. Still could not remove the bar below the browser bar. Is this the status bar? Why does not unchecking the status bar on the View selection of the toolbar not remove this bar? Somehow of other I got it tonight for the first time and could not remove it. So I uninstalled the 1.5 and went to yr website and installed 2.0. Nothing changed. Any suggestions? Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; ...

How to change individual bar colors and legend font n size in a chart in crystal reports which comes with visual studio.
i have been tryng to change the font and color of individual bars in a chart created using crystal reports that comes with visual studio. i can change the field colors but am unable to make any changes to the chart.If anyone can let me know anything regarding the same. Moreover, i cannot customize the legend to suit my needs. Thank you...

Bars change colors
In WinXP,home, sp2, have a theme set where the active window bar is green and inactive is red. Also taskbar is grey. About once or twice a day when booting up these change to dark blue. This necessitates opening the control panel/display/themes and changing to another theme which also has the proper colors, then back again. All is then OK for the moment, until it reoccurs. Or it can be left in one of the other themes and the same occurs. This has been going on for about a year and I can't associate it with any program install or upgrade. Any clues for a remedy would...

color in bar charts
Hi, I am using PB6.5. My application includes a datawindow that displays a bar chart in red and green. When my screen display is 16-bit True Color or 24-bit True Color, I see the bart chart in color. When the screen display is 32-bit True Color, the bar chart is in black and white. The red and green colors are replaced with vertical and oblique lines. The printout also shows vertical and oblique lines (with any screen settings). Any idea regarding what causes the problem? Thanks in advance, Philippe Philippe, I remember this being a bug in 6.4, build 444. If it's a sho...

bar chart colors?
Hello all, I have created a simple (3) bar chart. How can I define the colors of the bars? Currently they are showing as Black and White hatch marks. Please help Thanks again! IM doesn't give you any control over the color of your charts. Submit it as an enhancement request through Case Express: http://etsprod.sybase.com/casexpress/cx.stm -- Terry Dykstra (TeamSybase) Canadian Forest Oil Ltd. Check out Sybase Developer's Network: http://www.sybase.com/sdn Miiko wrote in message ... >Hello all, > >I have created a simple (3) bar chart. How can I d...

after changing the navigation bar or side bar firefox crashes.
Name: chris Email: c.michels7_at_chello.nl Product: Firefox Summary: after changing the navigation bar or side bar firefox crashes. Comments: 1 Ghz PowerPC osx 10.3.9 Like the interface changes & functionality Great product! Grtz � Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; nl; rv:1.8.1b2) Gecko/20060821 Firefox/2.0b2 ...

Change Color of Bar Graph ???
I am trying to change the color of the bars from the default red to blue in a bar graph. Hopefully I can explain this w/o being too confusing... I have a window. On that window is a datawindow control whose dataobject property is set to a report that contains an additional report control. That additional report control (composite or nested report?) contains the graph control (gr_1) I need to edit. What is odd is that if I attempt to do this directly at the level of the report that contains the graph control the color will edit properly. But I am in need of an entire report (which is...

CHANGING TAB BAR COLOR
Name: JOHN AXTELL Email: NEWLIFE88atCENTURYTELdotNET Product: Firefox Summary: CHANGING TAB BAR COLOR Comments: How can I change the color of the tab bar and text on the bar? I find it difficult to see black on gray. I am over 60:) Need black on light blue or white or something with lots of contrast. Also - down scrolling arrow on help pages does not scroll. In general great improvement. Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9b4) Gecko/2008030317 Firefox/3.0b4 ...

Changing the color bar to >
Someone posted code for inclusion to userchrome.css or user.js and prefs.js (I believe) that would change the vertical blue bar that denotes quoted lines to the "traditional" greater-than symbol, but that message has disappeared from my computer. Would someone be kind enough to repost or email me directly? Thanks. Peter Holsberg wrote on 3/5/2015 3:39 PM: > Someone posted code for inclusion to userchrome.css or user.js and > prefs.js (I believe) that would change the vertical blue bar that > denotes quoted lines to the "traditional" greater-than symbo...

Color in Pie/Bar Chart
How can I add color to pie and bar charts? Take a look at the example application that comes with PB. There is an example that shows changing the bar colors. Basically it involves coding in the pbm_dwngraphcreate event (which you have to map to your DataWindow). Then code something like this (formatting might be off): //Set the quadrant colors ll_seriescount = this.SeriesCount('gr_kd_a_quad') //Name of graph //Its not a series graph but PB gives it a series number ls_series_name = this.SeriesName('gr_kd_a_quad',1) li_rc = this.getseriesstyle('gr_k...

Web resources about - How to change the color of a bar in a bar chart - asp.net.ssrs

Change Congress - Wikipedia, the free encyclopedia
Change Congress is an American organization that aims to end perceived corruption in the United States Congress by reducing what it considers ...

Climate change sceptic Bob Carter dies at 74
Australia's climate change sceptic community has suffered a loss with the death of Professor Bob Carter on Tuesday.

Rising global temperatures: when will climate change deniers throw in the towel
Last year was far warmer than the previous record hot year - which was 2014. At some point, you would think most climate change deniers would ...

Is the FTC hinting it will change US auto dealership laws?
... shows that the FTC is listening to different voices on the issue. But what is it hearing? Continue reading Is the FTC hinting it will change ...

Seven Years Ago Today: Hope and Change
I don’t know about you, but for me it was an amazing day. Amazing. So many things I never thought I would see in my lifetime. I am so proud of ...

Actor Idris Elba addressed British Parliament about the need for diversity on screen: 'Change is coming ...
... year's Academy Awards nominations is at an all-time high here in the US, across the pond, actor Idris Elba has thoughts about the need to change ...

Fact-check: Cruz's claims about climate change science
Cruz has claimed that satellites haven't detected significant warming for 18 years

Scotland’s Government Planning To Cut Back On Funding Climate Change Policies, WWF
Analysis done by WWF Scotland has suggested the Scottish Government will soon reduce the amount of money it commits to climate change policies. ...

Psychologists: Climate Change Makes People Too Morose To Care
Daily Caller Psychologists: Climate Change Makes People Too Morose To Care Daily Caller Environmentalists hold a banner which reads, 'Standing ...

China market: Market share of smart TV vendors to change drastically in 2016
The landscape of the smart TV market in China is expected to undergo a drastic change in 2016 as local brands including Skyworth, Hisense and ...

Resources last updated: 1/22/2016 1:02:41 AM