Colors of bar chart dynamically

Hi,
I need help on this requirement.  I have a product as a dimension and hex# color code as its attribute,  and they both coming over through the datasource.  I want to create a bar graph that would use the color hex from each product to display it on the graph.  For example,  if product A with hex #0000F1 comes up, then the bar chart for that particular product should display the color #0000F1.  Any information or examples would be very helpful. Thank you in advance.
Vinh

Hi Vinh,
Do you mean that you will have the product on the x-axis of the chart and you want to display a different colour for each product bar on the same chart, or will you have a product selector that displays a single chart only for that product against a specific dimension so that all bars are the same colour determined by the colour attribute of the product?
I am assuming your requirement is the former, in which case rather than jumping through scripting and CSS hoops, I would encourage you to reconsider the business need for this requirement in the context of Stephen Few's Rule #4 in the article Practical Rules for Using Color in Charts, an excerpt of which is shown below:
Regards,
Mustafa.

Similar Messages

  • Help Needed : Changing the Color of Bar Graph Dynamically

    Hi..
    Is der any body to help me out...?
    My Question is :- How to change the color of Bar graph Dynamically..
    For example (Assume when one of the Bar Graph crosses certain limit of Y axis value mentioned, the graph must be changed into RED color)
    Thanks in Advance
    Edited by: user12873839 on Mar 30, 2010 10:03 PM

    Manoj,
    You have to create the entire chart manually. follow the below steps. You can refer to the anychart website for more help on different tags and features.
    1. Enter the following code in the html header of the page
    <script src="#WORKSPACE_IMAGES#AnyChart.js"  type="text/javascript" > </script>2. Create an ON Demand Application process by going to the Home>Application Builder>Application #>Shared Components>Application Processes
    3. Click On Create
    4. Enter the name as DYNAMIC_BAR_GRAPH_CHART
    5. Select the processing point as On Demand
    6. Click on Nxt
    7. Enter the following code in the processing text
    DECLARE
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    OWA_UTIL.http_header_close;
    HTP.p ('<?xml version = "1.0" encoding="utf-8" standalone = "yes"?>');
    HTP.p ('<anychart>');
         HTP.p ('<settings>');
              HTP.p ('<animation enabled="True"/>');
         HTP.p ('</settings>');
      HTP.p ('<charts>');
       HTP.p ('<chart plot_type="CategorizedVertical">');
         HTP.p ('<data_plot_settings default_series_type="Bar">');
              HTP.p ('<bar_series>');
                        HTP.p ('<tooltip_settings enabled="True">');
                        HTP.p ('<position valign="Top" halign="Right"/>');
                        HTP.p ('<format> Name: {%Name}');
                        HTP.p ( 'Value : ${%YValue}{numDecimals:0}');
                        HTP.p ('</format>');
                        HTP.p ('<font bold="false"/>'); 
                        HTP.p ('<background>');
                        HTP.p ('<corners type="Rounded" all="3"/>');
                        HTP.p ('<border type="Solid" color="DarkColor(%Color)" thickness="2"/>');
                        HTP.p ('</background>');
                   HTP.p ('</tooltip_settings>');
              HTP.p ('</bar_series>');
         HTP.p ('</data_plot_settings>');
         HTP.p ('<data>');
              HTP.p ('<series name="series 1">');
               FOR cThis IN (select table2.name, table2.value
                                  from table1,table2,table3
                                  where table1.T1ID = table3.T3ID
                                  and table2.T3ID = table3.T3ID
                                  and table3.C_ID=1
                                  and table3.A_ID=1
                        ORDER BY table2.name )
              LOOP
                   IF cThis.value > 90 THEN
                        HTP.p ('<point name="' || cThis.name || '" y="'|| cThis.value || '" color="red"/>');
                    ELSE
                        HTP.p ('<point name="' || cThis.name || '" y="'|| cThis.value || '" />');
                   END IF;
              END LOOP;
              HTP.p ('</series>');
         HTP.p ('</data>');
         HTP.p ('<chart_settings>');
              HTP.p ('<title>');
                   HTP.p ('<text>Chart Title</text>');
              HTP.p ('</title>');
              HTP.p ('<axes>');
                   HTP.p ('<y_axis>');
                        HTP.p ('<title>');
                             HTP.p ('<text>Value</text> ');
                        HTP.p ('</title>');
                        HTP.p ('<labels>');
                             HTP.p ('<format>${%Value}{numDecimals:0}</format>');
                        HTP.p ('</labels>');
                   HTP.p ('<axis_markers>');
                   HTP.p ('</axis_markers>');
                   HTP.p ('</y_axis>');
                   HTP.p ('<x_axis position="Normal" align="inside">');
                   HTP.p ('<labels display_mode="Rotated" rotation="90" align="inside" />');
                   HTP.p ('<title>');
                        HTP.p ('<text>Name</text> ');
                   HTP.p ('</title>');
                   HTP.p ('</x_axis>');
              HTP.p (' </axes>');
         HTP.p ('</chart_settings>');
        HTP.p ('</chart>');
      HTP.p ('</charts>');
    HTP.p ('</anychart>');
    htmldb_application.g_unrecoverable_error := true;
    END;8. Click on Create Process
    Now we will create a html region to display the graph.
    9. Create a new region of type HTML on the same page and select the region template as no template.
    10. Enter the following code in the region source
    &lt;div id="DynamicaBarGraph"></div>
    &lt;script type="text/javascript" language="javascript">
    function DynamicaBarGraph()
    var DynamicaBarGraph = new AnyChart('/i/flashchart/swf/AnyChart.swf');
    //    DynamicaBarGraph.width = "400";
    //    DynamicaBarGraph.height = "400";
    DynamicaBarGraph.addEventListener('pointClick', onDynamicaBarGraphClick);
        var DynamicaBarGraphData = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=DYNAMIC_BAR_GRAPH_CHART',0);
        gReturn = DynamicaBarGraphData.get();
        DynamicaBarGraph.setData(gReturn);
        DynamicaBarGraph.write("DynamicaBarGraph");
    function onDynamicaBarGraphClick(e)
    // Read point name
         name=e.data.Name;
    // Read point value
         value=e.data.YValue;
    // You can add onclick even here using the values name and value
    DynamicaBarGraph();
    </script> Hope it helps. Thanks.
    Regards,
    Manish

  • Changing Colors of Bar chart in Omini Portlets

    Hi,<BR>
    Is is possible to change the colors of bar charts in Omini Portltets? If so can any one tell How to change the colors.<BR>
    Thanks,<BR>
    Vijay.

    Hi Vinh,
    Do you mean that you will have the product on the x-axis of the chart and you want to display a different colour for each product bar on the same chart, or will you have a product selector that displays a single chart only for that product against a specific dimension so that all bars are the same colour determined by the colour attribute of the product?
    I am assuming your requirement is the former, in which case rather than jumping through scripting and CSS hoops, I would encourage you to reconsider the business need for this requirement in the context of Stephen Few's Rule #4 in the article Practical Rules for Using Color in Charts, an excerpt of which is shown below:
    Regards,
    Mustafa.

  • How to highlight different color in bar chart above the mark

    Hi friends,
    I have a bar chart in which im displaying it in blue color in obiee 11g. In graph properties i have set a scale marker to the point 4000, so that a line is appearing horizontally at the point 4000 in the bar chart. My chart is exceeding above 4000, as it reaches upto 5000.
    I need to set a color to the graph such that from *0-4000, i need to have one color* and above from 4000-5000 i need to highlight it with a different color.
    How to possible it to highlight with different color above that *4000 mark in my bar chart*.
    Thanks
    All izz Well
    GTA

    From your initial post I thought you meant you wanted to change the colour of the bit above the line for every bar that went over the line.
    The solution above works because stacked bar will use different colours for different measures - by splitting your original measure into one measure for the data up to the line and another measure for any data above the line you achieve this. Bars that don't cross the line will only show one colour, bars that do cross the line will show two.
    eg
    original measure/new measure 1/new measure 2
    2000/2000/0
    3000/3000/0
    5000/4000/1000
    5500/4000/1500
    The other scenario is that you want the whole bar to be coloured if it crosses the line. If that's the case then there is a conditional formatting section under graph properties->style->style and conditional formatting.
    Regards,
    Robert

  • Colored bars in BAR Chart

    Hi all,
    I want to display a bar chart which is having different colored bars. For example, i am now using equipment wise bar chart, if i am having 50 equipments, all 50 equipments should be displayed in different colors in bar chart. Now i am getting output for those 50 equipments having same color. I tried by giving that equipment column in DATA MAPPING -
    > LABEL COLUMNS, I got only 32 bars which is in different colors in output. Kindly give me some solution for this.
    thanks in advance

    You may have more than 32 bars but they will be the same data series and therefore the same color.  For separate colors the limit is 32 (I think you'll see that pens 17-32 repeat the colors from pen 1-16 in the default template).
    It sounds like your best bet is using ValueColumn for your numerical field and then LabelColumn for the string name field.  This way, depending upon the results returned it will provide good coloration between bars, but it may also be decreasingly relevant beyond the first 'x' items.  A normal Pareto chart might use the notion of top 10 or top 20, which would be well within the 32 color limit.

  • How to the colours of bar chart in WAD

    Hi mates,
    Could you tell me how to change the colors of bar chart in WAB.
    Regards.
    Harry

    harry,
    right click on the chart - select properties - then click on any one of the lines and right click - you can see the colors - otherwise the same should be available in the properties of the chart web item.
    Arun

  • CR for VS 2005 - Bar Chart - Bar colors

    Hi,
    I'm creating a report in Visual Studio 2005 and have a bar chart in it.  I've searched the forums but can't seem to find out how to change the colors of the Series bars.
    If anybody has any ideas or suggestions, they would be greatly appreciated.
    Thanks in advance.
    Ron

    Apparently, the version of CR that ships with Visual Studio doesn't allow much in the way of customization.  I have since upgraded to CR 2008 and can now change the bar colors.

  • Fine-grained control of colors in a bar chart

    Hello,
    Short version: How do I control the colors of the bars in a bar chart in Keynote, so that each bar, representing a particular entity, retains its color no matter its position relative to the other bars after updating the chart?
    Detailed version: I am using iWork '09. In Keynote I have a 3D bar chart showing an indicator for different companies (industry comparison). The companies are sorted in ascending order by revenue, so that the lowest bar (company with smallest revenue) is to the far left and the tallest - to the far right. I update the chart regularly. I have the following problem: each bar, representing a company, is in a particular color. When I update the chart, if the the order of the companies changes, the colors of the bars do not change, so that in the new chart the order of the colors is the same, although some or all of the bars now represent different companies. In other words: if in version 1 company A is in red and comes before company B which is in blue, if in the next version company A comes after company B, I want its bar to still be red. In the current situation, if company A comes after company B its bar will be blue and comapny B's will be red, i.e. red still comes before blue.

    I have to give up the beautiful colors of the automatic chart and only use the restricted number of colors from the color well.
    There is no restricion in the choice of colour, the colour depth on a Mac has over 16 million to choose from.
    Further, the fill type has options for;  colour, gradient, image and tint

  • How to change the color of bar in bar chart

    Hi I'm
    using Crystal Reports 2005 with Visual Studio 2005. How do i change the color of the bar in a bar chart, i don't see any options, someone telling in the forum that i can simply right click on the bar and choose color, but i don't get that option. all i can select is the entire chart object.
    any help is greatly appreciated.
    Thanks
    yesvee

    You have to make sure that you select the correct part of the bar.
    For Example:   When you click on the outside of the chart, the entire chart will be selected. Clicking somewhere inside the chart will also highlight the entire chart, but to highlight a specific bar or line you have to click until only that part is highlighted.
    Once you have the bar or series highlighted, right-click on the highlighted section and then select Chart Options, or "Format Series Riser" and you should be able to change the colour of the bar/line.

  • Can you change color of bars in bar chart?

    I have made a chart by using the spreadsheet and converting my data to a bar chart. I would like to change the default colors of the bars in the chart but so far haven't figured out how to do it, if indeed it is possible. Is it? If so, how should I go about it? I have been able to change the labels for the bars, but I want to change the colors of the bars themselves. Also, is it possible to change the arrows in the pictogram graph to some other clipart that might better represent the thing I am graphing?
    iMac G5   Mac OS X (10.4.8)   AppleWorks 6.2.9

    "I tried what you suggested, but it didn't work. When I click on the color square in the legend, a small circle appears in the square, but I am unable to select any of the paint tools. ... (Likewise, when I open the Modify dialogue and try to select the color in the sample box there, AppleWorks won't let me change it."
    Paint tools won't work, as the bars are Draw objects, and you have only limited control over them while the chart is still connected to the spreadsheet. Click on the colour square in the Legend. The white dot indicates it's selected.
    Now click on the Fill formatting button in the bottom section of the Tools (It's the almost invisible plain white button in the stack of three. The other two are the Pen formatting button—which has a black outline—and the Text formatting button—which has a T.). Then choose a colour from the Colors palette in the stack to the right of the three buttons.
    "Similarly, when I open the Modify dialogue and try to delete the arrow symbol in the sample box, it won't go anywhere; I just get an alert sound and nothing happens. Am I doing something wrong?"
    Should work like this:
    Double click the chart.
    In the Modify dialogue, click Series.
    In the Series dialogue, click the Sample box. A black outline should appear around the box, indicating it is selected.
    Press Delete to delete the current image. You should then see only the background colour.
    Press command-V to Paste your image.
    Uncheck Repeating to get a single copy of the image, stretched to fill the bar.
    Check Repeat to get a fixed size image that repeats to fill the bar.
    Set the overlap percentage if you want the repeating image to overlap.
    Click OK to return to the chart and view the results.
    Regards,
    Barry

  • How to change the color (or fill) of a SINGLE bar in a bar chart series

    I've searched the forum and consulted the help system in Keynote '09, and I can't find the answer.
    I have a simple bar chart with 6 bars. I want to select two of the bars and turn them a different color. I only seem to be able to change the color of the series as a whole. I can only select the series as a whole, and I can't Ungroup it or even copy it to the clipboard (it beeps!). I've tried changing the color of the number represented by the bar in the underlying table; can't be done.
    Am I attempting something impossible? If so (grumble grumble), why hasn't Apple made it possible? It seems like an obvious thing to allow.

    It is unfortunately impossible -- the individual bars are not selectable. As a workaround you can a) overlay them with a rectangular object, or b) overlay them with a second chart identical to the first, with all the bars except the two set to zero.

  • Customize the color of bars in chart

    Hi All,
    How to customize the color of a simple bars in a simple bar chart having Year and Sales as measure so that for each year different color is generated?
    Thanks,
    Sushil

    Got it we can do it using conditional formatting.

  • SSRS- Drill down to sub report of a bar chart on click on a particular color of the bar

    Hi,
    I have a bar chart which can have many colors on each bar, Now if i click on a bar, i am getting all the data related to that particular bar. Is it possible to click only on a particular color and get related data instead of whole bar?
    To be more precise, in the below image if i click on 16/6/2013 bar, i am getting all the data related to the bar, but is it possible to click on red  and green colors of the bar separately and  get the relevant data? Any help is greatly appreciated.
    Kruthi Hegde

    Hi Kruthi,
    In your case, you can use “Go to report” property to solve the issue.
    Suppose we have a dataset (DataSet1) in main report and subreport with following fields: Months, DateTime, Amount. We can according to Months and DateTime fields to display the subreport. Please refer to the steps below:
    Subrepot:
    Add dataset (DataSet2) in the report with Months field.
    Add dataset (DataSet3) in the report with DateTime field.
    Add two parameters in the report. Please refer to the following Available Values:
    Months:
    Dataset:  DataSet2
    Value field: Months
    Label field: Months
    DateTime:
    Dataset:  DataSet2
    Value field: DateTime
    Label field: DateTime
    Add filters in the tablix.
    Main report:
    Right click the bar chart, select Series Properties.
    Click Action in the left pane, select “Go to report” option.
    Specify the corresponding report.
    Click Add icon to add parameters to run the report:
    Name: Months    Value: [Months]
    Name: DateTime    Value: [DateTime]
    (Note: If we want subreport display these data which is only relevant with color, we can delete DataTime parameter in the report.)
    If you have any questions, please feel free to let me know.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • How to change the color of Data Markers in Bar chart

    Hi All,
    In OBIEE 11G, I have Bar chart with 4 measures, each measure is set to a color using Style properties of Graph. Now i want to change the color of the Data markers matching to the Bar color. Which means Bar and Data marker value should be set to same color.
    Please guide me on this.
    Thanks,
    GJ

    Here's a picture that may help in following Ian's instructions:
    I clicked on a green column to select the series as shown.
    Then this:
    Turns into this and you can click Style:
    SG

  • Different colors for same series in bar chart / "Deviation" Chart

    Hello,
    I calculate the absolute deviation for a certain characteristic - let's say 0CUSTOMER - with respect to an average value on a certain key figure - let's say "Sales".
    Let's say, the average "Sales" over 3 customers is 100 €.
    Customer 1 has "Sales" = 150 (-> deviation = +50)
    Customer 2 has "Sales" = 80  (-> deviation = -20)
    Customer 3 has "Sales" = 70  (-> deviation = -30)
    I'd like to show the positive and negative deviations (which build up one series) in a bar chart that is able to show the positive values in a different color than the negative values (green for positive; red for negative).
    I tried the bar chart of the WAD, but I have no idea, how I can have values of the same series be shown in two different colors depending on their value (e. g. positive vs. negative).
    Is there a way to smartly solve this problem?
    Thanks for any answer in advance.
    Best Regards,
    Philipp

    Hello Kai,
    I've already seen that value range functionality in the chart editor. But actually I'm doing my first steps concercnig the WAD and chart design - still quite unexperienced user
    I will give it a try with the value ranges... perhaps it helps me solving the problem. I will report on the outcome here.
    Thx,
    Philipp

Maybe you are looking for

  • I erased ical and i don't know how to fix it, it still apears there but i erased the software.. what do I do?

    What happened to me was that when I got my imac everything was workin perfecty, but two months later I erased the ICAL software by mistake. Now I can't open it because it says that I don't have the software or I don't know what it is talking about. B

  • Help! Where do I start

    I want to make changes to a TV viewer swf file by changing the color scheme in the corresponding CSS file. I was told to compile the file when the changes are made in the CSS file. Question: Do I compile the SWF file itself. Can someone give me some

  • VOLUME THROUGH CAR STEREO

    When I first played my 40g ipod HP through my car stereo with a cassette adaptor it sounded great! Now when I do it it won't play loud enough to hear it. Even with the ipod volume and stereo volume cranked. What did I do wrong? Does it have something

  • Problems launching Logic Express 7.2.2

    I recently purchased and installed the Logic 7.2 Crossgrade. I used Software Update to upgrade to 7.2.2. Now when I launch Logic it crashes. This is from my userid which is setup as an admin. If I launch Logic 7.2.2 from the 'root' account, it launch

  • I don't like ios 7, is there any way to downgrade?

    Hi, I don't like ios 7, is there any way to downgrade? It looks very very cheap! iPhone lost its karisma. It gives cheap android look. Thanks Chandhar