How to create graph by JSP

How to create graph by JSP

Create an image [ http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Image.html ], draw on image [ http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics.html ], output image in png format [ http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/ImageIO.html ].

Similar Messages

  • How to create graphs on JSP page in JDeveloper 10.1.3

    Hi all,
    Is there an easy way to create graph objects with JDeveloper 10.1.3? I have taken a look to some tutorials, but it looks like they all use the "drag/drop graph from the data control palette" method.
    E.g. I got example 88 to work from http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html, but I have no idea how to get the BIGraphDef1.xml object and how to link it to a set of data.
    Are there some tutorials to show how graphs can be used in JDev 10.1.3?

    Frank,
    This is what I did to implement the graphic manual, but I think, I forgot something...
    1. create a new application with projects DataModel and UserInterface
    2. in the DataModel I created a similar master/detail view as the one of Steve, this is named:
    TestModuleDataControl
    \--DepView
    __\--Deptno
    __\--Dname
    __\--Loc
    __\--EmpView1
    ____\--Sal
    3. I created a new jspx page and added a graph tag:
    <f:verbatim>
    <graph:Graph data="${bindings.DepartmentsEmployeesInDepartmentGraph}"
    imageHeight="200" imageWidth="400"/>
    </f:verbatim>
    4. in the page definitions I added
    <graph id="DepartmentsEmployeesInDepartmentGraph"
    IterBinding="EmployeesInDepartmentIterator"
    ControlClass="oracle.dss.graph.Graph"
    SeriesLabel="Ename"
    GraphPropertiesFileName="userinterface.BIGrap1hDef1"
    SeriesType="SINGLE_SERIES">
    <AttrNames>
    <Item Value="Sal"/>
    </AttrNames>
    </graph>
    5. I added also the iterator:
    <iterator id="EmployeesInDepartmentIterator" Binds="EmpView1" RangeSize="10"
    DataControl="TestModuleDataControl"/>
    6. I copy/pasted the BIGraphDef1.xml from Steve's project into 'Application Sources'\userinterface.
    7. in the web.xml file in WEB-INF I added:
    <servlet>
    <servlet-name>GraphGeneratorServlet</servlet-name>
    <servlet-class>oracle.jbo.html.jsp.graph.GraphGeneratorServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>GraphGeneratorServlet</servlet-name>
    <url-pattern>/GraphGeneratorServlet</url-pattern>
    </servlet-mapping>
    8. when I run the page, I can't see the graph and there are also no errors. I think I mis a global setting somewhere...
    Is there anything I forgot to do?
    note: if I add a new jsp page into steve's application, I do can see the graph if I perform the steps mentioned above...
    I just found out that, If I create the graph on a page which is in the root directory, then it works. If I put it in a subdirectory, it doesn't:
    - create graph as mentioned above on a page: web content/myGraph.jspx --> works
    - create graph as mentioned above on a page: web content/app/myGraph.jspx --> doesn't work...
    Does somebody know where to put a setting/parameter to get the Graph visible in the subdirectory app?

  • "How to create graphs in Reports"

    Hi All,
    Please anybody help me how to create graphs in the BEx Analyzer and whenever the reports will be refreshed the graphs should also be refreshed with the updated data.
    Help much appreciated.
    I will assign points.
    Thanks and Regards,
    Sunil Morwal.

    Hi Sunil,
    You can get charts in Bex Analyzer. After you execute the report, from the Tools menu > Insert Chart. You can position and edit the chart as desired and save this as a workbook.
    Hope this helps...
    Regards.

  • How to create graph through form9i

    dear,
    I mant to know how to create graph in form 9i.Right now i have no idea about graphs use in form9i.
    please reply me as soon as possible.
    my mail id is [email protected]
    If you have any answer related to this problem please mail me in my mail id that i have given .
    with regards
    monika gupta

    Hi Monika,
    http://www.oracle.com/technology/products/reports/htdocs/faq/faq_migration.htm
    http://www.oracle.com/technology/products/reports/10gr2/Reports_guide_to_changed_functionality.pdf
    http://download.oracle.com/docs/html/A90900_01/rwtutorial_graph.htm#1005697
    How do I migrate my charts from Oracle Graphics to the new graph format in Oracle Reports 10g?
    Since release 9i, Oracle Reports uses Business Intelligence Beans (BI Beans) to create and display graphs in reports. There is no direct migration path from Oracle Graphics to the BI Beans graphing functionality. As such, the user will need to rewrite all of their graphs using the new Graph Wizard within the Oracle Reports Builder 10g. Oracle Reports 10g supports over 50 graph types, including 3D graphs. However, keep in mind that it does not support some special types, such as Gantt charts.
    It seems direct graph 6i migration is not possible from reports10g.
    It is asking to use the chart wizard again with your query.
    Please follow the above two link it may helps u a lot.

  • How to Create Graph In forms 10g

    Dear All
    How to create a graph in Forms10G ?
    Can you please give a small full example step by step ?

    This is a fairly common question in the Forum. Searching the forum would have given you your answer. Graphing data in a form is now handled through a Java Bean. You will need to download and install the Forms 10g Demo's to get an example (which includes the JavaBean) and the instructions on how to use the bean.
    Craig...

  • How to create session in JSP & Servlet

    Hi All
    I'm really new to JSP & Servlet. So I want to know how to create sessions and how to pass details to another web page
    Thanks
    Padma

    You can easily pass objects from one jsp or servlet to another.
    On your servlet execute method (for example), you can do this as follows:
    HttpSession session = request.getSession();
    User u = new User();
    session.setAttribute("user", u);And get it again on other servlets:
    HttpSession session = request.getSession();
    User user = (User) session.getAttribute("user");I hope this helps you.

  • How to create table with jsp in mysql

    Hi, every one,
    I just want to know how to create a table with jsp in mysql, please.
    Thanks in advance

    I have got the same question. I tried to pass sql "Create table" statement, but the servlet engine (tomcat4) threw an error "could not manipulet statement.execute". It works for normal SQL select statement.
    Anyone got the same problem ? or got a solution for this ? someone told me that PHP can do it, but just want to get it works with JSP.

  • ADF mobile: how to create graph with dual Y axis?

    Hi,
    Jdev 11.1.2.3.0 + mobile extension.
    I try to figure out how to create a dvtm:comboGraph with dual Y axis but without success.
    All series are rendered on the Y1 axis. Y2 axis even does not appear in the graph.
    here my code:
        <dvtm:comboChart var="row" value="#{bindings.lmrgGraph1.collectionModel}"
                         id="cc1" timeAxisType="enabled">
          <amx:facet name="dataStamp">
            <chartDataItem group="#{row.timeStamp}" value="#{row.acetat}"
                           series="#{lmrgGraphBundle.ACETAT}">
              <!--dvtm:referenceObject color="ff0000" displayInLegend="on"
                                    lineValue="#{bindings.graphTresholdAcetat.inputValue}"
                                    lineWidth="2"/-->
            </chartDataItem>
            <chartDataItem group="#{row.timeStamp}" value="#{row.plannedMachines}"
                           series="#{lmrgGraphBundle.BMPLAN}"/>
            <chartDataItem group="#{row.timeStamp}" value="#{row.actualMachines}"
                           series="#{lmrgGraphBundle.BMACTUAL}"/>
          </amx:facet>
          <dvtm:legend position="end" id="l1">
            <dvtm:legendSection id="ls1" title="Legend"/>
          </dvtm:legend>
          <dvtm:yAxis axisMaxValue="#{bindings.maxYAxisValueAcetat.inputValue}"
                      title="#{lmrgGraphBundle.MENGE}">
            <dvtm:majorTick/>
          </dvtm:yAxis>
                <!--dvtm:y2Axis majorIncrement="1.0"
                       title="#{lmrgGraphBundle.BETRIEBSMITTEL}"
                       axisMaxValue="#{bindings.maxYAxisValueMachines.inputValue}"-->
          <dvtm:y2Axis majorIncrement="1.0"
                       title="#{lmrgGraphBundle.BETRIEBSMITTEL}"
                       axisMaxValue="10">
            <dvtm:majorTick/>
          </dvtm:y2Axis>
          <amx:facet name="seriesStamp">
            <dvtm:seriesStyle assignedToY2="false" color="0052ff" lineWidth="2"
                              rendered="#{(row.series eq lmrgGraphBundle.ACETAT)}"
                              series="#{row.series}"/>
            <dvtm:seriesStyle assignedToY2="true" color="e7e700" lineWidth="10"
                              rendered="#{(row.series eq lmrgGraphBundle.BMPLAN)}"
                              type="bar" series="#{row.series}"/>
            <dvtm:seriesStyle assignedToY2="true" color="94f700" lineWidth="10"
                              rendered="#{(row.series eq lmrgGraphBundle.BMACTUAL)}"
                              type="bar" series="#{row.series}"/>
          </amx:facet>
        </dvtm:comboChart>kr
    Peter

    Hi Jan,
    meanwhile I have managed to display the second Y axix corret.
    Here my code:
                <dvtm:comboChart var="row"
                                 value="#{bindings.lmrgGraph.collectionModel}"
                                 id="cc1" animationOnDisplay="alphaFade"
                                 hideAndShowBehavior="withRescale"
                                 rolloverBehavior="dim" inlineStyle="height:50%;">
                    <amx:facet name="dataStamp">
                        <dvtm:chartDataItem group="#{row.timeStamp}"
                                            value="#{row.acetat}"
                                            series="#{bindings.lmrgGraph.hints.acetat.label}"/>
                        <dvtm:chartDataItem group="#{row.timeStamp}"
                                            value="#{row.plannedMachines}"
                                            series="#{bindings.lmrgGraph.hints.plannedMachines.label}"/>
                        <dvtm:chartDataItem group="#{row.timeStamp}"
                                            value="#{row.actualMachines}"
                                            series="#{bindings.lmrgGraph.hints.actualMachines.label}"/>
                    </amx:facet>
                    <amx:facet name="seriesStamp">
                        <dvtm:seriesStyle series="#{bindings.lmrgGraph.hints.acetat.label}"
                                          color="0052ff" type="line"/>
                        <dvtm:seriesStyle assignedToY2="true" color="e7e700"
                                          type="line"
                                          series="#{bindings.lmrgGraph.hints.plannedMachines.label}"/>
                        <dvtm:seriesStyle assignedToY2="true" color="94f700"
                                          type="line"
                                          series="#{bindings.lmrgGraph.hints.actualMachines.label}"/>
                    </amx:facet>
                    <dvtm:xAxis/>
                </dvtm:comboChart>
    /code]
    There are still some issues if x-axis is timestamp enables but I have already created an SR for this.
    regards
    Peter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to create graph based on sql query

    Hi all,
    I am using jdev 10.1.3.3
    My requirement is need to ctreate graph(pie chart) based on sql query ex: select count(empno) from emp group by deptno;
    and also i need to give link on graph. If i click 10 deptno part in pie chart only 10 deptno employee list need to display.
    Please help meeeeeee
    Thanks
    NR

    Hi,
    just non click able graph in ADF 10g using BI Graph: http://www.freewebalbum.com/blogs/faces/bjanko/blogs.jsp?blog=bjanko20070629162305
    regards,
    Branislav

  • RE: How to create a secure JSP?

    I am interesed in creating a web application using the J2EE standard with one of the pages being a page where credit card info will be entered by the user and then stored in our DB. Everything will run server side with this app.
    Could someone please let me know how to achieve the highest security for such an application. I want to ensure that the information the user will enter could NEVER get into the wrong hands. I know that NEVER is a strong word here, but I want to achieve the best security possible.
    Could you please make any suggestions possible that would assist me in doing this?
    Thanks in advance for your assistance!

    This will be an Internet application and it doesn't matter that much if the application is slowed down. It is a good trade off for good security as long as it is not too slow.
    How easy is it to add SSL security to the site? Is this the best method? In regards to ensuring the mySQL DB is secure - what methods are used to do this?
    I appreciate your comments.
    Thank you!
    You could start by using SSL, this will slow down the
    application.
    Also make sure the data is secure in your database.
    Will this be an intranet or internet application?

  • How to create Graph display depends on input values/

    hello,
    I want to show moving line graph that changes depends on input values.
    If I get input as wireless device receiving signal strength, I want to display the receiving signal strenth changes in graph.
    Is it possible in java.
    what class shall I use for this graph display.
    pls give any information regarding this.

    www.jfree.org

  • How do i Create charts using JSP/Servlet & Database

    I have to create charts which shows the graph of stock exchange.
    i have a database that keeps the data for creating charts.
    But i did not know how to create charts using jsp-servlet.
    Any Example might help me to go forward.
    Any help will be really appreciated.
    Please Advice me.

    JFreeChart - You can generate the charts then convert them to image formats (PNG and JPEG) all using the JFreeChart API
    http://www.jfree.org/jfreechart/

  • How to create Reports and Forms using JSP

    Hi,
    How to create reports using JSP. And how many types of reports can be created using JSP.Can anyone explain with example please.
    Thanks,
    Vijayalakshmi.M

    Here is some code that creates xml for any SQL that returns a ResultSet. Note this uses my default out-of-the-box XML template, but you can quickly create and use your own templates to generate xml to look anyway you desire.
    FormattedDataSet fds=FormattedDataSet.createInstance();
    Map miscData=new HashMap();
    map.put("rootElement", "musicgroups");
    String xml=fds.getFormattedDataSet("select * from groups", miscData, "xml1");
    String xml has the value:
    <musicgroups>
    <row rowID='1'>
      <group_id>1</group_id>
      <group_name>Rolling Stones</group_name>
      <type>Rock</type>
    </row>
    <row rowID='2'>
      <group_id>2</group_id>
      <group_name>Beatles</group_name>
      <type>Rock</type>
    </row>
    <row rowID='3'>
      <group_id>3</group_id>
      <group_name>Led Zepplin</group_name>
      <type>Rock</type>
    </row>
    </musicgroups>steve -
    http://www.fdsapi.com - The easiest way to generate dynamic HTML and XML
    http://www.jamonapi.com - A performance tuning and scalability measuring API

  • How create graphs(pie and bar graphs) in j2me

    hi friends,
    how to create graphs in j2me?
    plz help me.
    regards,
    Shruthi R S

    Hi Shruti,
    I have developed the same application in j2me. I worked on graphs related to stocks. So i think my code can work for u too.
    Here is the code for displaying bars:
    package project;
    import javax.microedition.lcdui.Canvas;
    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.lcdui.Font;
    import javax.microedition.lcdui.Graphics;
    class BarCanvas extends Canvas {
         public static boolean indicator=true;
         public static int lenght=120;
         int pad=2;
         Font font;
         private int fh;
         String xName = "";
         String yName = "VALUE";
         private int xmargen=15;
         private int ymargen=15;
         private int initialx=0;
         private int initialy=0;
         int scale = 15;
         private int bw=0;
         int index=0;
         int scaleincr;
         int padincr;
         int pady=0;
         String s1;
         //int bars[]={20,30,40,40,50,20,70,80,90};
         int bars[]={20,30,40,50,300};
         int k=bars.length;
         int barinc=scale+bw+pad;
              BarCanvas(String s1){
                   this.s1=s1;
                   font = Font.getFont(Font.FACE_SYSTEM,
                   Font.STYLE_PLAIN, Font.SIZE_SMALL);
                   fh = font.getHeight();
                   if(s1.equals("Tic"))
                        padincr=2;
                        bw=3;
                        scaleincr=3;
                   if(s1.equals("1 minute"))
                        padincr=2;
                        bw=3;
                        scaleincr=3;
                   if(s1.equals("5 minutes"))
                        padincr=2;
                        bw=3;
                        scaleincr=15;
                   if(s1.equals("15 minutes"))
                        padincr=10;
                        bw=5;
                        scaleincr=15;
                   if(s1.equals("Hourly"))
                        padincr=10;
                        bw=5;
                        scaleincr=1;
                   if(s1.equals("Daily"))
                        padincr=10;
                        bw=5;
                        scaleincr=1;
                   if(s1.equals("Weekly"))
                        padincr=10;
                        bw=5;
                        scaleincr=1;
                   }//linecanvas
    public void paint(Graphics g) {
                        int width = getWidth();
                   int height = getHeight();
                   int titleHeight;
                   g.setFont(font);
                   int titlex1 = font.stringWidth("TIME");
                   int titlex = (width-titlex1)/2;
                   g.setColor(0,0,0);
                   g.fillRect(0, 0, width, height);
                   //set text on scales
                        setScaleName( xName, yName, titlex, height, width, g);
                   // x axis
                        drawXasxis( g, width, height,xmargen,ymargen);
                             //y axis
                             drawYasxis( g, xmargen, height,ymargen);
                        //horizontal scale
                             drawXhorizontalScales( g, width, height, scale,xmargen,ymargen);
                             //vertical scale
                             drawYVerticalScales(g, width,height,scale,xmargen,ymargen);
                             //draw x scale no.
                             setXScallNo( g, width, height, scale);
    //                         draw y scale no.
                             setYScallNo( g, width, height, scale);
                             //draw line.
                             drawBar(g,height);
    public void setXScallNo(Graphics g,int width,int height,int scale){
         String s=initialx+"";
         int increment =scaleincr;
         for(int i= xmargen;i<width;i+=scale){
              //G.drawLine(i, height-10, i, height-10);
              g.drawString(s,i,height-2,Graphics.BOTTOM|Graphics.HCENTER);
              s=(initialx+increment)+"";
              increment+=scaleincr;
         return;
    public void setYScallNo(Graphics g,int width,int height,int scale){
         String s=initialy+"";
         int increment =scale;
         for(int i= height-ymargen;i>0;i-=scale){
              //G.drawLine(i, height-10, i, height-10);
              g.drawString(s,0,i,Graphics.TOP|Graphics.LEFT);
              s=(initialy+increment)+"";
              increment+=scale;
         return;
    public void setScaleName(String xName,String yName,int titlex,int height,int width,Graphics g){
         g.setColor(250,250,250);
         g.drawString("X-scale=10",width-70,3,Graphics.TOP|Graphics.RIGHT);
         g.drawString("Y-scale=10",width-10,3,Graphics.TOP|Graphics.RIGHT);
         g.drawString(xName,width/2,(height-fh),Graphics.TOP|Graphics.LEFT);
         int i=0;
         for(int j=0;j<yName.length();j++){
              String s=yName.charAt(j)+"";
         g.drawString(s,1,(height/2)+i,Graphics.TOP|Graphics.LEFT);
         i=i+10;
         return;
    public void drawXasxis(Graphics g,int width,int height,int xmargen,int ymargen){
         g.setColor(0x6FFFFF);
    g.drawLine(xmargen, height-ymargen, width , height-ymargen);
    return;
    public void drawYasxis(Graphics g,int xmargen,int height,int ymargen){
         g.setColor(0x6FFFFF);
         g.drawLine(xmargen,height-ymargen,xmargen,0);
         return;
    public void drawXhorizontalScales(Graphics g,int width,int height,int scale,int xmargen,int ymargen){
         g.setColor(0x6FFFFF);
         int j=0;
         while(j<5){
         for(int i= xmargen;i<width;i+=scale)
              g.drawLine(i, height-(ymargen+j), i, height-ymargen);
         j++;
         return;
    public void drawYVerticalScales(Graphics g,int width,int height,int scale,int xmargen,int ymargen){
         g.setColor(0x6FFFFF);
         int j=0;
         while(j<5){
         for(int i=height-ymargen;i>0;i-=scale){
              g.drawLine(xmargen+j,i,xmargen+j,i);
         j++;
         return;
    public void drawBar(Graphics g,int height){
         int j=1;
         for(int i=index;i<bars.length;i++,j++)
              //g.drawRect(scale+bw*j+pad*j,(height-15)-bars,bw,bars[i]);
              g.drawRect(scale+bw*j+padincr*j,(height-ymargen)-bars[i]-pady,bw,bars[i]);
    g.fillRect(scale+bw*j+padincr*j,(height-ymargen)-bars[i]-pady,bw,bars[i]);
    public void setData(int length)
    public int getData(){
         return 0;
    public void keyPressed(int keyCode) {
    if ((keyCode==KEY_NUM4))
         initialx=initialx+scaleincr;
              if(s1.equals("5 minutes"))
                   if(index==0)
                   index=index+3;
                   else
                   index=index+4;     
              else if(s1.equals("15 minutes"))
                   if(index==0)
                   index=index+1;
                   else
                   index=index+1;
              else
                   index=index+scaleincr;
              repaint();
              System.out.println(scaleincr);
    if ((keyCode==KEY_NUM6))
         if(initialx>0)
              initialx=initialx-scaleincr;
              if(s1.equals("5 minutes"))
                   if(index==3)
                   index=index-3;
                   else
                   index=index-4;     
              else if(s1.equals("15 minutes"))
                   if(index==1)
                   index=index-1;
                   else
                   index=index-1;
              else
                   index=index-scaleincr;
         //index=index-scaleincr;
         repaint();
    if ((keyCode==KEY_NUM2))
         if(initialy>0)
         pady=pady+15;
         initialy=initialy-scale;
         repaint();
    if ((keyCode==KEY_NUM8))
         pady=pady-15;
         initialy=initialy+scale;
         repaint();
    protected void keyReleased(int keyCode)
    protected void keyRepeated(int keyCode)
    Similarly u can do for lines and candle sticks too.
    If u need any help give any mail id to post jad or jar files.
    Regards ,
    Deepika

  • NW7.10: How to create NetWeaver 7.10 Mobile JSP Application

    Dear Colleagues,
       I would like to have help documents or external links, to, how to create a mobile JSP application with all the steps neccessary for the same.
      Thanks in advance.
    Regards, Siraj

    Hi,
    You can take reference from SAP Mobile Development Kit (MDK) which is integrated in SAP NWDS with MI plugin. There a complete reference is given along with the sample code.
    Below are some links for further reference:-
    http://help.sap.com/saphelp_nw04/helpdata/en/29/3255c4ef7bbc4fbe4287aa1a0557da/frameset.htm
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bc48bf90-0201-0010-5a95-b671fea8f2b4
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a3/583aef1baa6d42b22bedcb4dec5db9/frameset.htm
    http://www.sdn.sap.com/irj/sdn/nw-mobile71#section2
    Hope that this information would be useful for you guys to start with the SAP MI.
    Regards,
    Saurabh Mathur

Maybe you are looking for

  • Mac mini and Philips tv

    hello. I bought the mac mini and philips tv, but I get pink screen. looking at various forums that this is a known issue between apple and philips.is there  no solutions to this problem?

  • How do I get iTunes 11 to play TV shows continuously?

    I am looking for a way to play several TV shows in a row. Playing directly from the TV media center, this does not work. Playing them from a playlist does not work either. Any idea is greatly appreciated. Regards Jim Knopf

  • MDX Query - Rolling Up A Case Statement

    Hi, I have the following query  with member measures.[EmployeeNumber] as [Employee].[EmployeeNumber].currentmember.member_name member measures.[Type] as Case When [WorkDay].[DayOfWeek].currentmember.member_name = "Sunday" Then "PenaltyRate" Else "Sta

  • Button enlarges via rollover

    Hi fellow Musers, Just a quick question. My client wants me to create a button rollover (image) that enlarges. Can someone help me how to do this if its possible. thank you Andy

  • Decode the values without ETL (Re-group Dimension Values)

    Hello guys, i have a question which is partly triggered by me not wanting to modify the default ETLs. I have values in a dimension table coming as: Region A Region B Region C Region D Region E However, i am hoping to re-org the hierarchy as below: Re