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

Similar Messages

  • Changing the color of bar graph

    I have created a bar graph in graphics builder and I want the
    report to display different colors to indicate different values
    in the field.
    What is the best way to do this?
    Can someone provide me with sample code?
    Thanks

    I have created a bar graph in graphics builder and I want the
    report to display different colors to indicate different values
    in the field.
    What is the best way to do this?
    Can someone provide me with sample code?
    Thanks

  • 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.

  • HELP needed: Changing the username of the User profile for folders

    HI all,
    Would really appreciate if someone can help me figure out how to change the name of my username on the folder. Attached is the image to show what i mean. This is bugging me out!!
    http://t.co/LAo4ZKS

    http://support.apple.com/kb/ht1428
    Note the note at the top of the page though. An alternative is to create a new account and copy your preferences across.

  • Can you change the color of menu buttons dynamically?

    Post Author: DanH
    CA Forum: Xcelsius and Live Office
    Hello, Newbie Here,
    Built my first Xcelsious front end and linked to two personnel databases.  Everything works just fine.  The outputs on this particular visualization generate completion statistics for 12 divisions and a 13th for combined.  Don't know enough about the software yet to know whether I can make the menu buttons appear in red for those that have not accomplished a 100% compliance to the task being tracked?  This would make it visually easier for upper management to click directly on the division menu buttons in red, rather than have to click on all of them to see which divisions haven't achieved completion.  Also, wouldn't hurt to be able to turn the other menu buttons green for those that have completed.  Any ideas are appreciated, really scratching my head at the moment.
    Thanx,
    Dan

    Post Author: amr_foci
    CA Forum: Xcelsius and Live Office
    i dont think you can change the objects' color on runtime for the crytsal xcelsius

  • How Can I change the color in a 3d object?

    Hello.
    I have received a 3dPDF, on which several buildings are created in 3d. Is it possible afterwards to change the color of the buildings in Acrobat X Pro? Or do I need the plugin "Tetra4D"?
    Thank you for your help.
    Greeting
    Sascha

    You can change the color of model parts dynamically at runtime using JavaScript, but there is no way to change them within the embedded model itself.

  • How can i dynamically vary the color of one graph line

    I was looking on the developer zone and noticed several people are looking for a way to change the color of one graph line. Simplest case I would like to know: a graph is running, then you press a button and from that point on the color of the graph changes, but doesnt change the old data line color. THis way the line will consist of different colors.
    The property node changes the whole line, and the line is always just one color. It should be possible to make the line consist of different color sections, anyone know how?

    The application is actually not as slow as it seemed, i had some settings set wrong (anti aliasing in plot, and some functions in advanced, when you right click on the graph)
    Especially unchecking the anti-aliasing makes it much faster
    Also, just plotting point and not a line, or alternatively, changing the interpolation makes it faster.
    Anyway, the attached files do not rely on processor so much anymore, see for yourself
    Attachments:
    multicolor_looking_plot.vi ‏99 KB
    multicolor_looking_plot_2.vi ‏105 KB
    multicolor_looking_plot_3_truncated_array.vi ‏99 KB

  • BI BEANS - Graph - How to change the color .. please help

    Hi Everyone,
    Can anyone please tell me how to change the color of the Graph bars or slices. I mean the color which represents the data.
    For example in a pie chart I want to set specific color for specific slice. Please help.
    Regards
    SRT

    It seems to be the SET_SERIE_COLOR() method added to the FormsGraph revised version, but this latest version is momentarily not available for download.
    I think there is an existant open thread on this. Maybe you could find it using the Forum Search box.
    Francois

  • How do I change the color of the triangle in a menu bar?

    Hi,
    I have a question that might seem very rudimentary...How can I change the color of the little downward-pointing triangle on my menu bar items that have sub-menus? Specifically, I want those triangles to be invisible when the cursor is not over the menu bar. Right now it is black and changes to white. I'm running Dreamweaver CS5 on a Mac if that makes any difference. Is there a CSS rule for this somewhere that I am not seeing?
    Many thanks for any help!
    -AG

    Those are images, so you will need to change the image.

  • Array of clusters and in the cluster is a bar meter, how can I change the color individually?

    Array of clusters and in the cluster is a bar meter, how can I change the color of the bar meter individually for each element of the array?  I have just figured out that you can't change properties of one element of the array without all elements changing.  For the scaling I had to make numeric indicators for each tick of the scale so that each bar meter in the clustered array would have individual scales.  I also had to do some math to scale each barmeter to display correct proportions from 0 to 100%.  Now I'm stumped on the color of the bar meter.  Basically, if the value goes over a setpoint, the bar meter needs to turn red.  It has to be in an array to be infinitely scalable.
    Thanks
    Matt
    Solved!
    Go to Solution.

    You can't do that-
    without a little trick.
    You could consider laying a custom color box over the bar graph in the cluster you can set the color based on the value of the bar graph or even make a "Pseudo"- bar graph using a series of color boxes stacked to look lie a bar and changing values of the Color boxs from empty to full to red.
    Here is an example to demonstrate
    Jeff
    Attachments:
    Pseudo bar.vi ‏12 KB

  • 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

  • How can i change the color of the graph in agreement of the program's condition

    Hi,
    I am using labview 5.1 in my graduation's project final. (sorry by my english, but i am ina hurry)
    How can i change the color of the graph in agreement of the program's condition?
    I am developing a VI to control the temperature of termistors,but i have another sensor too.
    In a graph i have the situation of the termistors,but i want to change the color of the graph when the sensor is active.
    Thanks a lot
    Rafael Wajnsztajn - Brasil

    To change the color of the line itself, you can use the attribute Plot>>Plot Color.
    To change the color of the points, you can use the attribute Cursor>>Cursor Color.
    To select the color, you should have a color box constant inside the Numeric>>Additional Numeric Constants palette.
    This is all in LV 7.0. I'm not sure how it similar it is in 5.1.
    One important thing is to place the attribute node inside a case structure which will execute only when your condition has been filled.
    If this didn't help you, I suggest you post the relevant piece of code, or at least an image of it (no BMPs, please).
    Try to take over the world!

  • Using footage from my iPhone 4, how can I remove the black bars on the sides of my picture? Or change the color to white...

    My footage is vertical and there are two black bars on the side filling in the rest of the picture. I want to imbed this into PowerPoint without the black bars on the side. Any suggestions on how I can remove them or at least change the color to white? I changed the background color in View > Background > White, but it was only for editing purposes and didn't keep the color after rendering.

    To change the background to white, in FCE, place the video on track V2 and place a color matte generator on track V1.  The default color for the color matte is grey so you'll need to change it to white using the color picker.
    -DH

  • 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.

  • Chart: Changing the color of a bar

    Hello Experts,
    We would like to change the color of a particular bar in the chart. Can someone share a code snippet to achieve the same? If we use color-pallete aggregation then color change is getting reflected to all the bars.
    We are using makit library, please note that we had tried the same with viz library also.
    Snippet from XML view:
    <ma:Chart id="idChart1" height="50%" width="100%" type="Column"
      rows="{/}" showRangeSelector="true"
      showTableView="false" showTotalValue="false">
      <ma:category>
      <ma:Category column="type" displayName="Product" />
      </ma:category>
      <ma:values>
      <ma:Value expression="tickets" displayName="Gross Value"
      format="number" />
      </ma:values>
      <ma:columns>
      <ma:Column name="type" value="{BillCycle}" />
      <ma:Column name="tickets" value="{Volume}" type="number" />
      </ma:columns>
      </ma:Chart>
    Regards,
    DR

    annajus wrote:
    Hello
    I am having trouble changing the color of a line chart. I can change colors in bar charts, but it does not let me change the colors for the same data set in a line chart format.
    Do you mean that you want to have different parts of the same line to appear in different colors?
    When I move the chart to Pages it won't let me put the chart legend actually in the chart (which I need based on the APA guidelines).
    Print the Chart to PDF and import the PDF to Pages, with the Legend wherever you want it.
    Finally - any thoughts on how to adjust the X axis so that the first data point doesn't start right on the Y axis?
    Set the Axis Minimum to some other value.
    Regards,
    Jerry

Maybe you are looking for

  • ITunes wont connect to the internet, connection refused. Need help

    I have no idea what settings were moved on my laptop, but now everytime i open itunes and i try to connect to the itunes store, it shows the message: "ITUNES COULD NOT CONNECT TO THE ITUNES STORE. THE NETWORK CONNECTION WAS REFUSED. Make sure your ne

  • No sound g60-235DX Windows XP only after standby

    Thanks to CherylG and Provost, I was able to convert the above said computer from Vista to XP.  The thing runs great, except for one small annoyance... When I bring the computer back from standby, there is no sound. The Conexant 221 driver is there,

  • Using Policy Files

    I have made an applet that I want to be able to access all other web recources and the local hard drive. I heard this can be done with a policy file. How do I make and use policy files? Can somebody point me to a tutorial or something?

  • CS2 and Leopard

    Running on a G4 1.42daul, clean install of everything. InDesign is quitting sometimes on startup and sometimes on export to pdf. I have to fix permissions, toss prefs and restart to do anything, and it's getting progressively worse. Any thoughts?

  • Preventing selection for specific ALV rows

    In WD ABAP, does anyone know the technique for using the SET_ROW_SELECTABLE / SET_ROW_SELECTABLE_FIELDNAME methods to shut off the row selection button for specific ALV rows?  I'm not wanting to completely hide the buttons a la the SET_SELECTION_MODE