Bar graph error

I made a program that shows bar graphs, well it's suppose to. Its not working, the compiler says something about the for statements needing ';'s...
help please!
import java.awt.*;
import java.applet.*;
import java.awt.event*;
public class Bars extends Applet implements ActionListener
     int offset = 75; //displace graph vert and horiz from origin
     int height = 150, width = 240;
     int vert_div = height/5; //vert_Div = 5
     int horiz_div = width/data.length; //horiz_div = 4 (4 entries)
     Label prompt = new Label ("Enter a value for the bar graph.");
     final static String data_label[] = {"T1","T2","T3","T4"};
     TextField input = new TextField(3);
     static int data[] = new int[4];
     int numb_entries = 1;
     public void init()
          add(prompt);
          add(input);
          resize(400,275);
          input.addActionListener(this);
     public void actionPerformed( ActionEvent e )
          int numb = new Integer(input.getText()).intValue();
          if(numb_entries<5)
               data[numb_entries-1] = numb;
               numb_entries++;
               input.selectAll(); // places cursor in text box after first entry
               if(numb_entries == 5)
                    input.removeActionListener(this);
                    remove(input); // deletes component from window
                    remove(prompt); // remove() is opposite of add()                    
     public void paint(Graphics g)
          if(numb_entries==5)
               g.drawString("value 1 = "+data[0]+", value 2 = "+data[1] +
                              ", value 3 = "+data[2]+", value 4 = "+data[3],70,30);
               g.setColor(Color.black);
               g.drawLine(offset+width,offset,offset+width,offset+height); //y-axis
               for (int i=0;i<=5;i++) //y tick marks
                    g.drawString(String.valueOf(i*20),offset+width+10,
                                    offset+height-(i*vert_div));
                    g.drawLine(offset,offset+height-(i*vert_div),offset+width+5,
                                 offset+height-(i*vert_div)); //draws horiz gridlines
               g.drawLine(offset,offset+height,offset+width,offset+height);//x-axis
               for (int i=0;i<data.length;i++)
                    g.drawString(data_label,
                         offset+horiz_div*i+horiz_div/2,offset+height+20);
                    g.drawLine(offset+horiz_div*i+horiz_div/2,offset+height,
                         offset+horiz_div*i+horiz_div/2,offset+height+20); //x-ticks
               g.setColor(Color.red);
               for (int i=0,i<data.length;i++)
                    int bar_height = data[i]*height/100;
                    g.fillRect(offset+horiz_div*i+horiz_div/4,
                         offset+height-bar_height,horiz_div/2,bar_height);
               resize(400,275); //paint bars and data values

change
import java.awt.event*;with
import java.awt.event.*;

Similar Messages

  • ELOCATION_MERCATOR.WORLD_MAP errors for pie/bar graph theme below zoom 5

    Hi,
    I am trying to create a map using ADF DVT map component in my jspx page. I am using 'elocation_mercator.world_map'. I am creating a pie graph theme over the base world map. For some reason whenever I zoom below 5, i get following javascript error
    [MVThemeBasedFOIControl.foiLoaded] MAPVIEWER-05523: Cannot process response from MapViewer server. (<?xml version="1.0" encoding="UTF-8" ?> <oms_error> MAPVIEWER-06009: Error processing an FOI request.
    Root cause:FOIServlet:null</oms_error>)
    The Pie graphs displays fine at or above zoom level 5. I tried the same thing using my local map viewer instance which has mvdemo.demo_map as the base map. The pie graph displays fine at all zoom levels using my local map. Can anybody tell me what may be the problem when I use the elocator world_map. I can't even look at the logs as it's a hosted service.

    Here are the steps to reproduce the problem
    1) Create a jspx page.
    2) From the component palette on the right hand side, select ADF Data Visualizations and then click on Map in the Geographical Map section. This will open an ADF Map configuration window.
    3) Create a new Map Configuration by providing an id and a URL connection. If you have not created a URL Connection to elocation service, create a new connection to "http://elocation.oracle.com/mapviewer" and select that connection.
    4) You will see data source as ELOCATION_MERCATOR and Base map as WORLD_MAP selected. Enter startingY="38.648911" startingX="-98.349609" , select mapZoom="5" and Click on OK.
    5) Now create an entity object and a view object based on the STATES table in the MVDEMO database and add it to an application module.
    6) Refresh the application module data control. You should a new StatesView1 data control.
    7) Drop it on the map and select Bar graph theme. This will open a Bar Graph theme configuration window for the Map.
    8) In the Name select MAP_STATES_ABBRV. In the location column select STATE_ABRV.
    9) In the Data Location Select Location as StateAbrv and Location Label as State.
    10) Enter Series Attribute as Totpop and Label as Total Population. Enter series attribute as Female and Label as Female Population. Click OK.
    11) Now Run this page.
    12) The page runs fine displaying the Bar chart. Now zoom out. You will get error
    '[MVThemeBasedFOIControl.foiLoaded] MAPVIEWER-05523: Cannot process response from MapViewer server. (<?xml version="1.0" encoding="UTF-8" ?> <oms_error> MAPVIEWER-06009: Error processing an FOI request.
    Root cause:FOIServlet:null</oms_error>)'
    When you say that we should use elocation for map tiles not for FOI rendering, does that mean that I should not use the themes provided by elocation. When I enter the base URL to a mapviewer instance in my map client, the base map and the themes are displayed from the database used by the mapviewer instance. So, how can I use my own mapviewer for FOI rendering? Can you please explain a little more. Thanks.

  • Solution for Messed (Error) Bar Graph of iPod Session in iTunes

    I have encounter the error of iPod Session Bar Graph in iTunes like this:
    http://img160.imageshack.us/img160/4527/capacitybarha6.png
    and I find out the solution that can fix this problem!
    Go to DEVICES > Your iPod > Music > Right click a group of file, and then [Get Info] > Options > Tick the box of [Gapless Album] and choose [Yes], wait for awhile for iTunes processing, and the Bar Graph restore to ordinary status!

    Sounds like it has a drive collision with another device, would you happen to have an external drive or are you on a network, or do you have a printer with memory slots?
    http://docs.info.apple.com/article.html?artnum=93499

  • 10g Graphs - How to customize the default color of a Bar Graph

    Hi,
    I've posted this thread in Reports section, have received no reply yet. Maybe no one has ever tried this before!!
    I am porting a couple of 6i OGD's to 10g graphics.
    Basically I am invoking reports from a form. The reports contains embedded Graph.
    Here comes the tricky part.
    I have a couple of Graphs in 6i that display each bar of a bar graph in different color.
    Example:
    Value       Bar Color
    Critical     Red
    Major       Orange
    Minor       Yellow
    None       GrayQ) I want to know how to set the color of each bar of a bar graph based on the value it takes. i,e If it's critical the bar should be displayed in red. If it's major, the bar should be displayed in orange.
    I added conditional formatting in 10g Graph, and this is the trigger that was created.
    function CT_1FormatTrigger return boolean is
    begin
      -- Automatically Generated from Reports Builder.
      if (:f19 > -1)
      then
        srw.set_foreground_border_color('yellow');
        srw.set_border_pattern('solid');
        srw.set_foreground_fill_color('yellow');
        srw.set_fill_pattern('solid');
      end if;
      -- Automatically Generated from Reports Builder.
      if (:f20 > -1)
      then
        srw.set_foreground_border_color('red');
        srw.set_border_pattern('solid');
        srw.set_foreground_fill_color('red');
        srw.set_fill_pattern('solid');
      end if;
      return (TRUE);
    end;When I try to invoke the above report from the form, I get the error: FRM-41214: Unable to run report.
    If I remove conditional formatting, I am able to invoke the report from the form with the default color in the embedded graph.
    Hopefully someone has ideas on this!
    Thanks

    Why don't you use the build-in charting capability of reports 10g instead? There is FormsGraph.jar implementation for forms but that might not have the flexibility of what 6i graphs has/had and not "officially" supported - not like the reports 10g charting capability (which is built in and can be customized by editing the related xml files (if necessary). Note: FormsGraph.jar has it's own limitations

  • CM29 - bar graph not display in WebGui while is it visible in GUI

    Hi,
    We are trying to see and work on CM29 through SAP GUI for HTML. After making required settings it not pulling up BAR Graph into WebGui and saying error message "Unknown Error:RFC". We have checked on IGS RFC settings and all are working fine but still we are recieving error message.
    1. Can the bar graphs can be seen on WebGui?
    Regards,
    Amol

    Hi Amol,
    This is a limitation                                      
    The IGS does not support the Bar chart                                                                               
    See note: [1299016|http://service.sap.com/sap/support/notes/1299016] Network and bar chart cannot be used in SAP GUI for  
    HTML                                                                               
    This note does not provide this functionality - but provides a different
    message other than "ListenerRfc : Unknown function"                                                                               
    You cannot display this graphic via the WEBGUI, you will need to use the
    SAPGUI if you wish to use transaction "CM29" to view the chart    
    Regards,
    Oisin
    Edited by: Oisin ONidh on Nov 28, 2011 3:10 PM
    Add link for note

  • Labview crashes when trying to use bar graph

    Hi all; I am trying to make a 3D Bar or 3D Pie chart but LabVIEW crashes and shut down. When I try to pick up 3D Bar graph from controls to the front panel, LabVIEW shuts down without giving any error. I was using LabVIEW 2011 and now using LabVIEW 2012 evaluation version but the problem is same on both versions. I am using windows XP. 
    Any suggestions? 

    There has been reports about crashes like this in the past. There is already a CAR filed on this with LV 2009 which seems still to be "unaddressed". It is listed in e.g. the LV 2010 known issues.
    Since the source of the crash is a result of an incompatibility between OS, graphic driver (device) and OpenGL, i doubt that there is much NI as company can do about it.
    So i ask you to follow the suggested updates/test and see if the crash persists.
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Remove decimals from the Bar Graph..

    Hii,
    How to remove the Decimals from the Bar Graph.
    I am using Reports 9i.
    I have created a Bar Graph in that It is showing the decimals bar. Actully in the query i hv used the inbuild function Round but while i run the report it is showing the decimals.
    It is showing if the value is under 10 then 3 decimals. Value is between 10 to 100 then 2 decimals. 100 to 1000 is 1 decimal.
    How can i remove the same.
    Also in the X axis how can I put the description of a field. While i take the description fiel it is showing some exception error.
    Description field width is 50 Now I am showing the code field only have 3 digits.
    Please check this also...
    remove decimal places
    Thanks in Advance
    Jithesh

    Hi Simran
    1. You can get proper variable without decimal point.
    2. Use function "FLOOR" and get the output value assigned to variable defined in step 1.
    data : wv_wh_no type p decimals 0 .   -
    you take as per your requirement
    Let say,
    wv_dec_no = 1.0001.
    w_no = FLOOR(wv_dec_no).
    Hope it will help you.
    Regards,
    Anil Salekar

  • Javascript won't recognize selected portion of bar graph

    Hi,
    I'm trying to write a script that will recognize a selected portion of a bar graph (selected with the direct-selection tool) and change its fill color. I have a working script that will recognize change the color of a selected box (i.e. one drawn with the Rectangle tool), but I get an error when I try to manipulate a selected piece of my graph.
    "Error 21: undefined is not an object"
    OK, then what is it? Is there any documentation that explains the hierarchy of items within a graph or how they are referenced? Or anyone out there figured it out? The Illustrator Scripting PDFs are less than clear on this point.
    This script is (hopefully) a building block for a later, larger script that would step through an entire graph, change the color of each bar, and save a copy before repeating the process with the next bar (basically I need a bunch of variations on one bar graph with a different data point highlighted in each). But that's not happening unless I can select the bars!
    Any ideas would be appreciated,
    Ted

    From looking at the graph item object this doesn't appear possible.
    Items within a graphItem do not show up as selected in JS.
    Looks like the only workaround that I can see would be to expand the graph item then work with the path elements.

  • Using the report generation toolkit, how do I make a bar graph verticle instead of horizontle?

    The attached vi is similar to what I am using, and it produces an Excel bar chart. I would really like to create the same chart, only vertically instead of horizontly. I have tried all kinds of things that don't work. Is there a way to do this that does work. I want a result similar to rotating the produced chart 90 degrees CCW.
    Thank you!
    Attachments:
    Chart Test.vi ‏20 KB

    you want to use a xy-graph.
    you can right click the plot legend to make a bar graph vertical.
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome
    Attachments:
    bargraph2.jpg ‏91 KB

  • BO 4.0 webi: Conditional formatting on a bar graph

    Hi,
    Is it possible to fiormat a Bar graph conditionally in BO 4.0(SAP BO BI: web intelligence)..
    I want to create a bar graph that displays bar in Green color if the value of bar is greater than target set and Red if it is less than target, which is not doable with BO xi3.1 version.
    Please let me know if this can be doable with latest version of BO 4.0 webi.
    Thanks in advance..

    Hi Bharath,
    One workaround in 3.1 I have found is to use a stacked bar chart and then create two variables out of the measure you want to be green if over a certain amount and make the formula:
    =[Measure Object] Where([Measure Object] >= 10,000)
    and the 2nd variable formula for red:
    =[Measure Object] Where ([Measure Object] <10,000)
    Then place these two measure variables on top of each other where the measure values go. Then go into the color palette and make a custom palette with the first two colors green and red see if that gives you what you are looking for.
    Thanks

  • How to use a single variable in multiple schedules in bar graph

    Hello Experts,
    I am usiing a variable X in different schedules for creating a bar graph.This variable X is used in all schedules with different restrictions.For that reason I have to use X and follow some space after X to use it in another schedule. Is there any method to use X again base on schedule name? For example: If schedule1 then X where key=1000 and if schedule2 then X where key=2000.

    Hi,
    You can create a variable with the same name but use this in a small case...
    All the Best,
    Madhu....

  • Single Line and Stacked Bar Graph Representation

    Data to be plotted on graph is as follows
    Year and Month               Study               Planned Subject               Study-Site ID #               # Enrolled          
    2001 / 03          AMXN 9374               50     US-001               1          
    2001 / 04               AMXN 9374               50               FR-101               1          
    2001 / 04               AMXN 9374               50               SP-301               1          
    2001 / 04               AMXN 9374               50               US-001               2          
    2001 / 05               AMXN 9374               50               FR-101               1          
    2001 / 05               AMXN 9374               50               US-001               1          
    2001 / 06               AMXN 9374               50               FR-101               2          
    2001 / 06               AMXN 9374               50               SP-301               2          
    2001 / 06               AMXN 9374               50               US-001               1          
    I want to display the above data in line stacked bar graph format where the
    #Enrolled will be in Stacked Bar by Study -Site ( Y axis)
    Planned Subject should represent a single line at 50 ( Y axis)
    Group by Year and Month ( X- Axis)
    Study excluded ( Study will be selected from dashboard prompt)
    I'm getting the stacked view of Study Site ID correctly but I want Single Line for Planned Subject .
    Currently I'm getting multiple line .
    Eg for 2001/03 I'm getting line at 50 in yellow colour
    for 2001/04 I'm getting a line at 150 in different color since it has 3 Study-Site ID's But the desired output is Single Line at 50
    As per 11g doc this is not possible because there is some upgradation in the nature of the graph
    " Stacked line-bar graphs in which 2 or more measures are shown as lines on the same axis and are not stacked in 10g are stacked in 11g."
    Refer - http://docs.oracle.com/cd/E21764_01/bi.1111/e16452/apndx_ui_chngs.htm
    Is there any workaround for it ?

    Did you found any workaround for it ? I am too looking for same scenerio.

  • How to get bar graph in word in labwindow/CVI ?

    how to get bar graph in word in labwindow/CVI ?

    ashwinic9,
    spawning your question over more and more threads (the present one, this one and this other one) won't give you a faster answer; instead, it will irritate forum users! 
    Especially if you have at your disposal a fast way to perform a test. I pointed you some days ago to word report example, that writes a table to a word document: did you tried changing the graph into a bar graph and generating the report? I have done it for you and the result is OK, as you can see in the attached document.
    Now, since the example works well, there must be something in your particular situation that prevents the graph to be shown; that is: you must add some more data on your actual problem and maybe a small example that exposes the problem.
    But please: keep active only this discussion and let the other threads die! 
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?
    Attachments:
    wordreport.doc ‏38 KB

  • Creating a popup on mouse over in bar graph

    Hi,
    I want to create a popup using mouse over event on bar graph but I didn't find corresponding property in the property inspector. Is it possible to display a popup on mouse over in bar graph?
    At present I am able to create a popup in the backing bean based on click event. I want to align it to the bar in the graph which was clicked. But now, it is being aligned to the bar graph as a whole(like above the graph , below the graph) when I use "RichPopup.PopupHints.HintTypes.HINT_ALIGN_ID, source". Is there a way to align it to the particular bar?
    Any help is greatly appreciated
    Thank you,
    KK

    Hi,
    don't think you can align it to an area within a component. The align id property expects a component reference. Note that mouse over on a bar graph doesn't select the bar, which means that the data in the binding layer is not set to current (just in case that the data in the popup is meant to be dependent)
    Frank

  • How to create static line in line bar graph in obiee 11g?

    Hello,
    I have requirement where user wants to see a line in bar graph.
    Now the line is just static line, we dont have data field available to draw the line in graph.
    is there a way to create a static line in chart and show it in Line bar ombo graph??
    Thanks in advance..

    e.g. i created the static line '10' in fx and now using this column as line in line bar report , but its not displaying the line at measure of '10' in chart.
    Drag the column to measures section of graph (Line - Vertical Axis) to change this static value create an edit box prompt and pass the value to the column using Presentation Variable (as said by Fernando)
    Thanks,
    Saichand

Maybe you are looking for

  • Delivery and Shipments for idocs posting

    Hi - warehouse shipment advice (EDI 945) related (to update qties, packing info, and post G/I) can i use  DELVRY01 or DELVRY02. . which one for what. - customer ASN (EDI 856) related - SHPMNT01 to SHPMNT03 will it update delivery & also the shipment

  • Recover a Director file?

    Hi there Recently a client has come back to us to do revisions on a project we worked on years ago. To our horror we discovered that the french version and all the source files are missing and are unable to recover it. Now we still have the projector

  • Can't get MTP to work on one of my laptops - x86_64 & KDE

    I have Arch x86_64 on both of my laptops.  The newer one of the two can't seem to get MTP to work on my Galaxy Note III.  Both laptops run KDE and use kio-mtp.  I have looked around quite a bit and can't figure this one out. user groups: wheel uucp l

  • Pages in ALV grid output and header on everypage

    Hi, My report output is displayed in a ALV grid. The output has around 100 records. Now , my requirement is to display the output in pages, say 25 records per page and I also want to have the header details for every page. How  can I do it? Thanks, S

  • Favicon, iWeb SEO tool and Safari. Can it be done?

    I have successfully create a favico.iso file and uploaded it directly to my web server and placed it in the root folder. Works fine in Firefox but doesn't show in Safari. How can I get it to work in Safari? I use Rage iWeb SEO tool. Can SEO be used?