Using g.drawLine to draw a graph

I was wondering if anyone might have some insight as to how to use g.drawLine(x1, y1, x2, y2) to draw the contents of an array to make a graph?
This code shown here just illustrates the idea I'm after.
int a[] = arr;
for( int i = 0; i < a.length; i++ )
     g.drawLine(i, arr, i, 300);
The nature of my problem is not being able to get g.drawLine to work in the main, or getting the data from the main to the method. Thanks.

public class GraphComponent extends Canvas
private int[] arr;
public GraphComponent(int[] arr)
this.arr=arr;
public void paint(Graphics g)
// Do your paiting here using this.arr array.
public class MyFrame extends Frame
public MyFrame(int[] arr)
this.setLayout(new BorderLayout());
this.add(new GraphComponent(arr));
this.setBounds(10, 10, 400, 300);
public static void main(String[] args)
// Create the array here
MyFrame frame=new MyFrame(args);
frame.setVisible(true);
}

Similar Messages

  • Using appended array to draw a graph

    Hi Guys, I'm having a problem with using appended array. I used appended array to save the values from the analyser and then use those values to draw a graph. I have attached 2 VI with this post.  
                                   1st-I can able to save the results in the appended array in different rows.                               2nd-I couldn't save the results in different rows. I can able to save the results in one row only. The new results are over write on the same row.  Can anyone help me with this please? RegardsMayuren  
    Attachments:
    15.vi ‏63 KB
    new1.vi ‏13 KB

    I have attached the sub VI for the previous post
    Attachments:
    Append Text Strings.vi ‏17 KB
    Concatenate Strings.vi ‏15 KB
    Multi-Line List to Array of Strings.vi ‏44 KB

  • Need help to draw a graph from the output I get with my program please

    Hi all,
    I please need help with this program, I need to display the amount of money over the years (which the user has to enter via the textfields supplied)
    on a graph, I'm not sure what to do further with my program, but I have created a test with a System.out.println() method just to see if I get the correct output and it looks fine.
    My question is, how do I get the input that was entered by the user (the initial deposit amount as well as the number of years) and using these to draw up the graph? (I used a button for the user to click after he/she has entered both the deposit and year values to draw the graph but I don't know how to get this to work?)
    Please help me.
    The output that I got looked liked this: (just for a test!) - basically this kind of output must be shown on the graph...
    The initial deposit made was: 200.0
    After year: 1        Amount is:  210.00
    After year: 2        Amount is:  220.50
    After year: 3        Amount is:  231.53
    After year: 4        Amount is:  243.10
    After year: 5        Amount is:  255.26
    After year: 6        Amount is:  268.02
    After year: 7        Amount is:  281.42
    After year: 8        Amount is:  295.49
    After year: 9        Amount is:  310.27
    After year: 10        Amount is:  325.78
    After year: 11        Amount is:  342.07
    After year: 12        Amount is:  359.17
    After year: 13        Amount is:  377.13
    After year: 14        Amount is:  395.99
    After year: 15        Amount is:  415.79
    After year: 16        Amount is:  436.57
    After year: 17        Amount is:  458.40And here is my code that Iv'e done so far:
    import javax.swing.*;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.lang.Math;
    import java.text.DecimalFormat;
    public class CompoundInterestProgram extends JFrame implements ActionListener {
        JLabel amountLabel = new JLabel("Please enter the initial deposit amount:");
        JTextField amountText = new JTextField(5);
        JLabel yearsLabel = new JLabel("Please enter the numbers of years:");
        JTextField yearstext = new JTextField(5);
        JButton drawButton = new JButton("Draw Graph");
        public CompoundInterestProgram() {
            super("Compound Interest Program");
            setSize(500, 500);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            amountText.addActionListener(this);
            yearstext.addActionListener(this);
            JPanel panel = new JPanel();
            panel.setBackground(Color.white);
            panel.add(amountLabel);
            amountLabel.setToolTipText("Range of deposit must be 20 - 200!");
            panel.add(amountText);
            panel.add(yearsLabel);
            yearsLabel.setToolTipText("Range of years must be 1 - 25!");
            panel.add(yearstext);
            panel.add(drawButton);
            add(panel);
            setVisible(true);
            public static void main(String[] args) {
                 DecimalFormat dec2 = new DecimalFormat( "0.00" );
                CompoundInterestProgram cip1 = new CompoundInterestProgram();
                JFrame f = new JFrame();
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.getContentPane().add(new GraphPanel());
                f.setSize(500, 500);
                f.setLocation(200,200);
                f.setVisible(true);
                Account a = new Account(200);
                System.out.println("The initial deposit made was: " + a.getBalance() + "\n");
                for (int year = 1; year <= 17; year++) {
                      System.out.println("After year: " + year + "   \t" + "Amount is:  " + dec2.format(a.getBalance() + a.calcInterest(year)));
              @Override
              public void actionPerformed(ActionEvent arg0) {
                   // TODO Auto-generated method stub
    class Account {
        double balance = 0;
        double interest = 0.05;
        public Account() {
             balance = 0;
             interest = 0.05;
        public Account(int deposit) {
             balance = deposit;
             interest = 0.05;
        public double calcInterest(int year) {
               return  balance * Math.pow((1 + interest), year) - balance;
        public double getBalance() {
              return balance;
    class GraphPanel extends JPanel {
        public GraphPanel() {
        public void paintComponent(Graphics g) {
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setColor(Color.red);
    }Your help would be much appreciated.
    Thanks in advance.

    watertownjordan wrote:
    http://www.jgraph.com/jgraph.html
    The above is also good.Sorry but you need to look a bit more closely at URLs that you cite. What the OP wants is a chart (as in X against Y) not a graph (as in links and nodes) . 'jgraph' deals with links and nodes.
    The best free charting library that I know of is JFreeChart from www.jfree.org.

  • Problem drawing a graph in Java2D

    I am trying to draw a graph using Java2D, onto a JPanel. I works sort of ok, but i have 2 problems;
    1. I don't know how to get it "linked" to the paint() method, so everytime someone resizez the window/window looses focus, the drawing is removed.
    2. The graphing becomes unacurate when passing more than 25-30 values, I think the problem might be the "hvorPaAkse" (whereOnAksis) or the "okY" (increaseY) value, that for some rasen appear to add too much, so that the error gradually increases for every loop in the for(), or something like that.
    I know reading the code and understanding the problem itselv is a challenge, but I if there's anybody out there who can help, I would be thankful for any help!
    CODE:
    //The draw axis method
    public void tegnAkser(JComponent comp, int antX, int antY, int okX, int okY) {
    Graphics g = comp.getGraphics();
    Graphics2D g2 = (Graphics2D) g;
    g2.setStroke(akseStrek);
    g2.draw(new Line2D.Double(origo.x, origo.y, origo.x, comp.getHeight()-((antY*okY)+(comp.getHeight()/yOffset))));
    g2.draw(new Line2D.Double(origo.x, origo.y, origo.x+(antX*okX), origo.y));
    int hvorPaAkse = origo.x;
    System.out.println(comp.getHeight()/antY);
    int gangeverdi = 1;
    if(comp.getHeight()/antY < 16) {
    gangeverdi = 5;
    for(int i=0; i<antX; i++) {
    g2.draw(new Line2D.Double(hvorPaAkse, origo.y - 2, hvorPaAkse,
    origo.y + 2));
    g2.drawString("" + i, hvorPaAkse, origo.y + 15);
    hvorPaAkse += okX;
    hvorPaAkse = origo.y;
    for(int i=0; i<antY; i++) {
    if(i%gangeverdi == 0) {
    g2.draw(new Line2D.Double(origo.x - 2, hvorPaAkse, origo.x + 2,
    hvorPaAkse));
    g2.drawString("" + i, origo.x - 15, hvorPaAkse);
    hvorPaAkse -= okY;
    //the drawGraf method
    public void tegnGraf(int[] verdier, JComponent comp) {
    Graphics g = comp.getGraphics();
    Graphics2D g2 = (Graphics2D) g;
    int xLengde = comp.getWidth();
    int yLengde = comp.getHeight();
    origo = new Punkt(xLengde - 9 * (xLengde / xOffset),
    yLengde - (yLengde / yOffset));
    int ant = verdier.length;
    int maxVerdi = 0;
    for (int i = 0; i < verdier.length; i++) {
    if (verdier[i] > maxVerdi)
    maxVerdi = verdier;
    tegnAkser(comp, ant+1, maxVerdi+1, (xLengde - (xLengde / xOffset)) / ant,
    ( (yLengde / yOffset) - yLengde) * -1 / maxVerdi);
    g2.setColor(Color.BLUE);
    g2.setStroke(grafStrek);
    ArrayList punkter = new ArrayList();
    for (int i = 0; i < verdier.length; i++) {
    g2.drawString("x", origo.x-2 + (i * (xLengde - (xLengde / xOffset)) / ant),
    origo.y +3 -
    (verdier[i] * ( (yLengde / yOffset) - yLengde) * -1 /
    maxVerdi));
    punkter.add(new Point2D.Double(origo.x +
    (i * (xLengde - (xLengde / xOffset)) / ant),
    origo.y -
    (verdier[i] *
    ( (yLengde / yOffset) - yLengde) * -1 /
    maxVerdi)
    //g2.draw(new Line2D.Double(origo.x,origo.y,origo.x+1,origo.y+1));
    for(int i=1; i<punkter.size(); i++) {
    Point2D.Double forrige = (Point2D.Double)punkter.get(i-1);
    Point2D.Double denne = (Point2D.Double)punkter.get(i);
    Line2D.Double linje = new Line2D.Double(forrige,denne);
    g2.draw(linje);
    Thanks
    CJ

    I couldn't do much with the code that you posted. It looks like you are plotting integers. Maybe you can use this.
    /* Plots plus/minus int values for ordinate for
    * evenly-distributed, positive int values on abcissa
    import java.awt.*;
    import java.awt.geom.*;
    import java.util.*;
    import java.util.List;
    import javax.swing.*;
    public class PlottingIntegers
        public static void main(String[] args)
            int[] data = {
                100, 220, 12, 65, 47, 175, 190, 18
            IntegerPlotter plotter = new IntegerPlotter();
            for(int i = 0; i < 8; i++)
                plotter.plot(data);
    JFrame f = new JFrame("Plotting Integers");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(plotter);
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    class IntegerPlotter extends JPanel
    final int PAD = 25;
    List dataList;
    public IntegerPlotter()
    dataList = new ArrayList();
    setBackground(Color.white);
    setPreferredSize(new Dimension(400,300));
    public void paintComponent(Graphics g)
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D)g;
    int width = getWidth();
    int height = getHeight();
    int xStep = (width - 2*PAD)/(dataList.size() - 1);
    int x = PAD;
    int y;
    // scale data
    int max = ((Integer)Collections.max(dataList)).intValue();
    int min = ((Integer)Collections.min(dataList)).intValue();
    int vertSpace = height - 2*PAD;
    int yOffset = height - PAD;
    int yDataOffset = (min >= 0 ? min : max > 0 ? 0 : max);
    double scale = (double)vertSpace/(max - min);
    int yOrigin = yOffset + (int)(min > 0 ? 0 : max > 0 ? scale*min : - vertSpace);
    // draw ordinate
    g2.draw(new Line2D.Float(PAD, PAD, PAD, yOffset));
    // draw abcissa
    g2.draw(new Line2D.Float(PAD, yOrigin, width - PAD, yOrigin));
    // label ordinate limits
    g2.drawString(String.valueOf(max), 10, PAD - 10);
    g2.drawString(String.valueOf(min), 10, yOffset + PAD/2);
    g2.setStroke(new BasicStroke(4f));
    g2.setPaint(Color.red);
    for(int i = 0; i < dataList.size(); i++)
    y = yOrigin -
    (int)(scale * (((Integer)dataList.get(i)).intValue() - yDataOffset));
    g2.draw(new Line2D.Float(x, y, x, y));
    x += xStep;
    protected void plot(int input)
    dataList.add(new Integer(input));
    repaint();

  • I DRAW A GRAPH IN 2D AND I HAVE A PROBLEME WITH THE BUBBLE HELP(ToolTipText

    dear friend,
    i wrote a java applet that draws a graph in 2D. i want to have coordinates (x,y) on an bubble help while displacing the mouse on the graph.
    if someone have an idea, thank you to rather communicate it to me as soon as possible.
    thanks.

    I don't think you can use a tooltip in this case.
    You need to add a MouseMotionListener, then follow the mousemove and build you own TollTip.
    Noah

  • How to draw a graph step by step ?

    Hi, sirs,
    Can you tell me how to draw a graph step by step by using Labview 6.0 ? On one step, I create two variables : one variable is used for X-axis, and other variable is used for Y-axis. Can you give me a simple example ?
    Thanks a lot.

    Try this example out.
    Attachments:
    plotxy.vi ‏24 KB

  • Could you please give me the method to draw Line Graph in detail?

    Could you please give me the method to draw Line Graph in detail?

    Hi,
    First update your username instead of using that number.
    and also provide full information like
    Apex version
    Database version
    I am giving you one link related to charts,
    http://dgielis.blogspot.in/2011/02/apex-4-bug-series-type-bar-line-marker.html
    Hope this will helps you
    Thanks and Regards
    Jitendra

  • Easiest Way to draw a graph

    Hi guys,
    what is the easiest way to draw a graph in java?
    Suppose I have 2 arrays. One array contains the x-coordinates. Another array contains the respective y-coordinates.
    I do not need the graph to be smooth. Is there a API in java that allows the programmer to draw a graph simply? If not, please kindly advise what would be the easiest way to do it. I do not need the codes but just some suggestions and advice will be fine.
    Many thanks for your time and attention!!
    Regards

    setClipArea and drawPolyline <--- good ideas, however, say 'thank you' and soon please. I did this app for someone at these forums a few months back - a line graph applet with labels etc - try it;-import java.awt.*;
    public class LineGraff extends java.applet.Applet{
       double []toGraff = {6.0, -14.0, -164.0, -210.0, 108.0, 770.0,
                                1354.0, 896.0, -572.0, -1348.0, -780.0, -108.0};
       double []numsFromFile = {6.0, -14.0, -164.0, -210.0, 108.0, 770.0,
                                1354.0, 896.0, -572.0, -1348.0, -780.0, -108.0};
       int max, min, size, Hscale;
       double Vscale;
       public void init(){
          size = numsFromFile.length-1;
          java.util.Arrays.sort(numsFromFile);
          max = (int) numsFromFile[size];
          min = (int) numsFromFile[0];
          Vscale = max-min;
          Vscale = 200/Vscale;
         Hscale = Math.round(300/size);
       public void paint(Graphics g) {
          g.setFont(new Font("Arial",0,14));
          g.drawString("Example app: drawing a graph from a double array",25,18);
          g.setFont(new Font("Arial",0,10));
          g.setColor(Color.blue);
          g.fillRect(10,20,365,230);
          g.setColor(Color.cyan);
          g.drawLine(25,25,25,225);
          g.drawLine(25,140,330,140);
          g.setColor(Color.white);
          int intA = 30, intB = 0, intC = 0;
          int intD = (int) (Math.round(140 - (Vscale * toGraff[0])));
             for(int i=1; i <= size; i++) {
               intC = intA + Hscale;
               intB = intD;
               intD = (int) (Math.round(140 - (Vscale * toGraff[ i ])));
               g.drawLine(intA, intB, intC, intD);
                  if(toGraff[ i ] > 0)
                     g.drawString(Double.toString(toGraff[ i-1 ]), intA+6, intB-3);
                  else
                     g.drawString(Double.toString(toGraff[ i-1 ]), intA+6, intB+8);
               intA += Hscale;
          g.drawString(Double.toString(toGraff[size]), intA+6, intD-3);    
    }

  • Editing Pdfs using the Annotations and Drawing Markups

    I regularly use the Annotations and Drawing markups on Pdfs on Mac to edit, but since updating to Adobe Reader 11 everything has gone haywire. The Pdf freezes constantly. Although I can still edit on screen, none of the Markup shows in the toolbar so I can't use it to review or navigate around the Pdf. I can't delete the Pop-ups or markup by right clicking as usual. The Save button in the top toolbar doesn't work - I have to go to the Drop down menu, which takes longer. It's impossible to close any Pdfs by clicking the red top left button - I have to go to the Drop down menu to close. It's hopeless! Any suggestions?

    I have Adobe Reader XI version 11.0.9 and Mac OS X version 10.6.8. I wonder now if I have the right version ...

  • How to draw xy graph with multiple y axis input?

    Hi,
    I have problem in xy graph, the xy graph only can show 1 signal from the y axis input ( As you can see in the attachment )
    Is it possible to draw xy graph with 2 Y input? Or maybe there are another type of graph that possible to do this? 
    Note:  the x axis should be from an input too ( not versus time / sample ).
    All answer and advice are welcomed.
    Best regards,
    Alvin Chandra 
    Solved!
    Go to Solution.
    Attachments:
    Example.vi ‏139 KB

    Are you asking for a second Y scale on the graph?
    If so, right click on the existing scale, select "Duplicate Scale". This will create a second scale. You can then (if you wish), right click on the new scale a select "Swap Sides" to put it on the other side of the graph.
    Are you asking about adding a second plot?
    If so then you need to bundle your arrays of X and Y points into clusters and build those into an array:
    The X-axis is always from an input on the XY Graph. You just need to change the axis title. Easiest way to do this is to double click on the axis title and type the new name.
    Rob

  • Using the Titler to draw masks -- how put it together?

    For lack of a rotoscope function in PPro (16 point garbage matte being the limit), I tried using the Titler to draw a mask, but can't get the transparency to work.
    The base clip is a static skyline shot.  Using the Titler, I created another title clip, using the base clip, with a mask drawn around the sky.  The idea is to make the area enclosed by the mask transparent, so as to replace it with the sky from another shot -- and retain the rest of the base shot, which (on the Titler) is the area outside the mask.
    But, using these 3 clips on 3 tracks, and the track matte filter, I can't get it to work.  Any ideas?

    The main issue you're facing might be in the fact that Titler doesn't create a shape with alpha channel. Hence, your should set your Track Matte Key to 'Matte Luma' instead.
    Here is briefly how to create procedural matte in PrPro:
    1. Duplicate your footage in the sequence, place it above the previous one and apply Threshold effect onto it. Adjust Threshold Level to taste so as to get more or less acceptable edges with the sky keyed out. Apply Fast Blur to soften edges a bit.
    2. Open up Titler and draw a shape for garbage matte. Set Graphic Type to Filled Bezier and Color to Black.
    3. Drop your newly created garbage matte above your footage with Threshold effect and nest them.
    4. Apply Track Matte Key onto your lower clip and set Composite Using to Matte Lume.
    5. Enjoy.

  • Use Pages like a drawing program

    I'm on the trial version of pages right now, and before I purchase the program, becasue it seems really flexible, is is possible to use Pages like a drawing program, or as other page layout programs like Pagemaker or InDesign?
    iBook, iMac DV   Mac OS X (10.4.3)  

    Kyler,
    Welcome to Apple Discussions. Neither PageMaker, InDesign, nor Pages is a drawing program. Yes, there are some very rudimentary things you can do to insert lines and boxes, but that's a far cry from what Freehand will do. Steve Jobs introduced iWork by saying, "We're building the successor to AppleWorks." Many have inferred from that statement that Apple will eventually release all of the iWork apps that currently make up the AppleWorks suite: draw, database, and spreadsheet. But that's just speculation, although at least somewhat accurate. So, if you need a drawing program, Pages isn't going to get it done for you. But neither will PageMaker or InDesign.

  • Printer only uses Freehand and Corel Draw

    We want use a printer in China that only uses Freehand and
    Corel Draw software (very primitive, I know). Is there a way to
    export InDesign files to work in either of those
    applications?

    It depends what you mean by 'Convert'. If you just want to be
    able to import into FreeHand (which version - MX?) you could save
    as an EPS. If you want to be able to edit... it could be a
    struggle. I tried this: From InDesign - save an EPS. Open the EPS
    in Illustrator CS2 and save as an illustrator 8. FreeHand will then
    open the Illustrator 8 file - it is editable BUT the text boxes get
    broken down into many smaller ones.

  • I am measuring resistance changes using hp 4284A LCR meter. I want to monitor the changes continuously by drawing a graph.Can I?

    I am measuring resistance changes in chip using hp 4284A LCR meter. The LCR meter is connected to the PC through IEEE488. I am using Labview 6.1 and window 2000. I want to monitor the resistance changes continuously and get a XY graph about it (the X-axis should be time as a unit of second). It should be also saved as an excel file. Please help me to do this work. I appreciate any help.

    You might consider a chart, instead of an X-Y graph. You don't need to supply an x-axis array, if your samples are evenly spaced in time.
    A chart gradually (or rapidly) moves from right to left, with new values appearing on the right, and old values disappearing off the left side.
    This sort of thing is what LabVIEW was designed for. What specifically, are you having trouble with?
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • How to Draw a graph Using layout In a module pool Program

    Hello Friends
                   How to Represent a Graph in the layout  in a module pool program.
    Plz suggest me.
    Thanking you all
    lavanya

    THIS IS AN EXAMPLE PROGRAM FOR GRAPHICS.
    Run this program & see whether it will be useful for u or not.
    before running dont forget to set the pf status.
    after copying double click the pf status & in application tool bar. give function code like this.
    PF07 - for 2d graph.
    PF06 - for 3d
    PF05 - for 4d
    DATA: BEGIN OF DATA OCCURS 1,
            P TYPE P,
          END OF DATA.
    --- options-table -
    DATA: BEGIN OF OPTS OCCURS 1,
             C(80) TYPE C,
          END OF OPTS.
    DATA: BEGIN OF TDIM1 OCCURS 1,
             C(80) TYPE C,
          END OF TDIM1.
    DATA: BEGIN OF TDIM2 OCCURS 1,
             C(80) TYPE C,
          END OF TDIM2.
    DATA: BEGIN OF TDIM3 OCCURS 1,
             C(80) TYPE C,
          END OF TDIM3.
    DATA: BEGIN OF MAX OCCURS 1,
             D1(3) TYPE P VALUE 4,
             D2(3) TYPE P VALUE 5,
             D3(3) TYPE P VALUE 6,
          END OF MAX.
    DATA: TYEAR1(5) VALUE '#1991',
          TYEAR2(5) VALUE '#1992',
          TYEAR3(5) VALUE '#1993',
          TYEAR4(5) VALUE '#1994'.
    DATA: TPROD1(9),
          TPROD2(9),
          TPROD3(9),
          TPROD4(9),
          TPROD5(9).
    TPROD1 = TEXT-P01.
    TPROD2 = TEXT-P02.
    TPROD3 = TEXT-P03.
    TPROD4 = TEXT-P04.
    TPROD5 = TEXT-P05.
    DATA: TLAND1(20),
          TLAND2(20),
          TLAND3(20),
          TLAND4(20),
          TLAND5(20),
          TLAND6(20).
    TLAND1 = TEXT-L01.
    TLAND2 = TEXT-L02.
    TLAND3 = TEXT-L03.
    TLAND4 = TEXT-L04.
    TLAND5 = TEXT-L05.
    TLAND6 = TEXT-L06.
    DATA: INDEX     LIKE  SY-INDEX.
    DATA: MAXD(3)    TYPE  P.
    DATA: TYP.
    FIELD-SYMBOLS: <F>.
    SET PF-STATUS 'GRAF'.
    PERFORM FILL_DATA.
    MAXD = MAX-D1 * MAX-D2.
    *{listdisplay
    display of a list:                                                   *
    for 5 countries each 4 colums (years) and 5 lines (products)
    WRITE: / TLAND1.
    INDEX = 1.
    PERFORM LISTE.
    SKIP.
    ULINE.
    WRITE: / TLAND2.
    INDEX = MAXD + 1.
    PERFORM LISTE.
    NEW-PAGE.
    WRITE: / TLAND3.
    INDEX = 2 * MAXD + 1.
    PERFORM LISTE.
    SKIP.
    ULINE.
    WRITE: / TLAND4.
    INDEX = 3 * MAXD + 1.
    PERFORM LISTE.
    NEW-PAGE.
    WRITE: / TLAND5.
    INDEX = 4 * MAXD + 1.
    PERFORM LISTE.
    SKIP.
    ULINE.
    WRITE: / TLAND6.
    INDEX = 5 * MAXD + 1.
    PERFORM LISTE.
    PF05: 4D-graphic, general function-module                            *
    AT PF05.
      REFRESH OPTS.
    --- first screen: selection -
      WRITE 'FIFRST = PU' TO OPTS-C. APPEND OPTS.
    --- 2D-graphic-type: perspective bars -
      WRITE 'P2TYPE = TD' TO OPTS-C. APPEND OPTS.
    --- kind of colours: regular  -
      WRITE 'P3CTYP = PL' TO OPTS-C. APPEND OPTS.
    *--- dimension 1
      REFRESH TDIM1.
      MOVE TYEAR1 TO TDIM1.
      APPEND TDIM1.
      MOVE TYEAR2 TO TDIM1.
      APPEND TDIM1.
      MOVE SPACE  TO TDIM1.
      APPEND TDIM1.
      MOVE TYEAR4 TO TDIM1.
      APPEND TDIM1.
    *--- dimension 2
      REFRESH TDIM2.
      MOVE SPACE  TO TDIM2.
      APPEND TDIM2.
      MOVE TPROD2 TO TDIM2.
      APPEND TDIM2.
      MOVE TPROD3 TO TDIM2.
      APPEND TDIM2.
      MOVE TPROD4 TO TDIM2.
      APPEND TDIM2.
      MOVE SPACE  TO TDIM2.
      APPEND TDIM2.
    *--- dimension 3
      REFRESH TDIM3.
      MOVE TLAND1 TO TDIM3.
      APPEND TDIM3.
      MOVE SPACE  TO TDIM3.
      APPEND TDIM3.
      MOVE TLAND3 TO TDIM3.
      APPEND TDIM3.
      MOVE TLAND4 TO TDIM3.
      APPEND TDIM3.
      MOVE SPACE  TO TDIM3.
      APPEND TDIM3.
      MOVE SPACE  TO TDIM3.
      APPEND TDIM3.
      CALL FUNCTION 'GRAPH_MATRIX'
           EXPORTING
                TITL  = TEXT-VGL
                VALT  = 'DM'
                DIM1  = TEXT-J00
                DIM2  = TEXT-P00
                DIM3  = TEXT-L00
           TABLES
                DATA  = DATA
                TDIM1 = TDIM1
                TDIM2 = TDIM2
                TDIM3 = TDIM3
                OPTS  = OPTS.
    PF06: 3D-graphic general function-module                             *
    AT PF06.
      REFRESH OPTS.
    --- first screen: selection -
      WRITE 'FIFRST = PU' TO OPTS-C. APPEND OPTS.
    --- 2D-graphic-Type: perspective bars -
      WRITE 'P2TYPE = TD' TO OPTS-C. APPEND OPTS.
    --- kind of colours: regular -
      WRITE 'P3CTYP = PL' TO OPTS-C. APPEND OPTS.
    *--- dimension 1
      REFRESH TDIM1.
      MOVE TYEAR1 TO TDIM1.
      APPEND TDIM1.
      MOVE SPACE  TO TDIM1.
      APPEND TDIM1.
      MOVE TYEAR3 TO TDIM1.
      APPEND TDIM1.
      MOVE TYEAR4 TO TDIM1.
      APPEND TDIM1.
    *--- dimension 2
      REFRESH TDIM2.
      MOVE TPROD1 TO TDIM2.
      APPEND TDIM2.
      MOVE SPACE  TO TDIM2.
      APPEND TDIM2.
      MOVE TPROD3 TO TDIM2.
      APPEND TDIM2.
      MOVE SPACE  TO TDIM2.
      APPEND TDIM2.
      MOVE TPROD5 TO TDIM2.
      APPEND TDIM2.
      REFRESH TDIM3.
      CALL FUNCTION 'GRAPH_MATRIX'
           EXPORTING
                TITL  = TEXT-VGL
                VALT  = 'DM'
                DIM1  = TEXT-J00
                DIM2  = TEXT-P00
           TABLES
                DATA  = DATA
                TDIM1 = TDIM1
                TDIM2 = TDIM2
                TDIM3 = TDIM3
                OPTS  = OPTS.
    PF07: 2D-graphic general function-module                             *
    AT PF07.
      REFRESH OPTS.
    --- first screen: selection -
      WRITE 'FIFRST = PU' TO OPTS-C. APPEND OPTS.
    --- 2D-graphic-type perspective bars -
      WRITE 'P2TYPE = TD' TO OPTS-C. APPEND OPTS.
    --- kind of colour: regular -
      WRITE 'P3CTYP = PL' TO OPTS-C. APPEND OPTS.
    *--- dimension 1
      REFRESH TDIM1.
      MOVE TYEAR1 TO TDIM1.
      APPEND TDIM1.
      MOVE SPACE  TO TDIM1.
      APPEND TDIM1.
      MOVE TYEAR3 TO TDIM1.
      APPEND TDIM1.
      MOVE TYEAR4 TO TDIM1.
      APPEND TDIM1.
      REFRESH TDIM2.
      REFRESH TDIM3.
      CALL FUNCTION 'GRAPH_MATRIX'
           EXPORTING
                TITL  = TEXT-VGL
                VALT  = 'DM'
                DIM1  = TEXT-J00
           TABLES
                DATA  = DATA
                TDIM1 = TDIM1
                TDIM2 = TDIM2
                TDIM3 = TDIM3
                OPTS  = OPTS.
          FORM LISTE                                                    *
          displays a list with turnover figures                         *
          (products and years)                                          *
    FORM LISTE.
      DATA: CNT_MOD LIKE SY-TABIX.
      DATA: CNT_DIV LIKE SY-TABIX.
      WRITE: / TEXT-P00,22 TYEAR1,39 TYEAR2,56 TYEAR3, 73 TYEAR4.
      SKIP 2.
      DO MAXD TIMES.
        READ TABLE DATA INDEX INDEX.
        IF SY-SUBRC NE 0. EXIT. ENDIF.
        INDEX = INDEX + 1.
        CNT_MOD = SY-INDEX MOD MAX-D1.
        CNT_DIV = SY-INDEX DIV MAX-D1.
        IF CNT_MOD EQ 1.
          CASE CNT_DIV.
            WHEN 0.
              WRITE: / TPROD1, ' '.
            WHEN 1.
              WRITE: / TPROD2, ' '.
            WHEN 2.
              WRITE: / TPROD3, ' '.
            WHEN 3.
              WRITE: / TPROD4, ' '.
            WHEN 4.
              WRITE: / TPROD5, ' '.
          ENDCASE.
        ENDIF.
        WRITE: DATA-P.
      ENDDO.
    ENDFORM.
          FORM FILL_DATA                                                *
          fills the datatable                                           *
    FORM FILL_DATA.
      DATA-P = 153470.
      APPEND DATA.
      DATA-P = 243470.
      APPEND DATA.
      DATA-P = 124567.
      APPEND DATA.
      DATA-P = 179037.
      APPEND DATA.
      DATA-P = 234980.
      APPEND DATA.
      DATA-P = 287513.
      APPEND DATA.
      DATA-P = 253430.
      APPEND DATA.
      DATA-P = 223440.
      APPEND DATA.
      DATA-P =  24567.
      APPEND DATA.
      DATA-P = 180037.
      APPEND DATA.
      DATA-P = 129830.
      APPEND DATA.
      DATA-P = 145530.
      APPEND DATA.
      DATA-P = 132470.
      APPEND DATA.
      DATA-P = 453470.
      APPEND DATA.
      DATA-P =  24456.
      APPEND DATA.
      DATA-P = 119807.
      APPEND DATA.
      DATA-P = 288710.
      APPEND DATA.
      DATA-P = 166656.
      APPEND DATA.
      DATA-P = 300430.
      APPEND DATA.
      DATA-P = 723110.
      APPEND DATA.
      DATA-P =  22767.
      APPEND DATA.
      DATA-P = 195522.
      APPEND DATA.
      DATA-P =  38970.
      APPEND DATA.
      DATA-P =  89635.
      APPEND DATA.
      DATA-P = 166970.
      APPEND DATA.
      DATA-P = 401470.
      APPEND DATA.
      DATA-P =  29967.
      APPEND DATA.
      DATA-P = 112957.
      APPEND DATA.
      DATA-P =  37860.
      APPEND DATA.
      DATA-P =  77450.
      APPEND DATA.
      DATA-P = 253150.
      APPEND DATA.
      DATA-P = 343570.
      APPEND DATA.
      DATA-P = 768867.
      APPEND DATA.
      DATA-P = 236790.
      APPEND DATA.
      DATA-P = 122750.
      APPEND DATA.
      DATA-P = 328760.
      APPEND DATA.
      DATA-P = 292150.
      APPEND DATA.
      DATA-P = 356570.
      APPEND DATA.
      DATA-P = 268867.
      APPEND DATA.
      DATA-P =  36790.
      APPEND DATA.
      DATA-P = 125680.
      APPEND DATA.
      DATA-P = 178893.
      APPEND DATA.
      DATA-P = 333150.
      APPEND DATA.
      DATA-P = 373570.
      APPEND DATA.
      DATA-P = 168867.
      APPEND DATA.
      DATA-P = 226790.
      APPEND DATA.
      DATA-P = 278940.
      APPEND DATA.
      DATA-P = 177784.
      APPEND DATA.
      DATA-P = 234150.
      APPEND DATA.
      DATA-P = 296570.
      APPEND DATA.
      DATA-P = 233867.
      APPEND DATA.
      DATA-P =  16790.
      APPEND DATA.
      DATA-P = 125590.
      APPEND DATA.
      DATA-P = 208760.
      APPEND DATA.
      DATA-P = 113150.
      APPEND DATA.
      DATA-P = 388570.
      APPEND DATA.
      DATA-P = 565867.
      APPEND DATA.
      DATA-P = 211790.
      APPEND DATA.
      DATA-P = 277480.
      APPEND DATA.
      DATA-P = 277489.
      APPEND DATA.
      DATA-P = 53470.
      APPEND DATA.
      DATA-P = 321560.
      APPEND DATA.
      DATA-P = 452456.
      APPEND DATA.
      DATA-P = 174695.
      APPEND DATA.
      DATA-P = 277590.
      APPEND DATA.
      DATA-P = 177490.
      APPEND DATA.
      DATA-P = 153470.
      APPEND DATA.
      DATA-P = 467560.
      APPEND DATA.
      DATA-P = 222456.
      APPEND DATA.
      DATA-P = 198695.
      APPEND DATA.
      DATA-P =  99470.
      APPEND DATA.
      DATA-P = 100340.
      APPEND DATA.
      DATA-P = 11470.
      APPEND DATA.
      DATA-P = 323560.
      APPEND DATA.
      DATA-P = 434456.
      APPEND DATA.
      DATA-P = 224695.
      APPEND DATA.
      DATA-P = 277490.
      APPEND DATA.
      DATA-P = 467890.
      APPEND DATA.
      DATA-P = 953470.
      APPEND DATA.
      DATA-P =  67560.
      APPEND DATA.
      DATA-P = 298456.
      APPEND DATA.
      DATA-P =  98695.
      APPEND DATA.
      DATA-P = 577900.
      APPEND DATA.
      DATA-P = 199490.
      APPEND DATA.
      DATA-P = 18470.
      APPEND DATA.
      DATA-P = 390560.
      APPEND DATA.
      DATA-P = 411456.
      APPEND DATA.
      DATA-P =  94695.
      APPEND DATA.
      DATA-P = 182000.
      APPEND DATA.
      DATA-P = 260570.
      APPEND DATA.
      DATA-P = 367356.
      APPEND DATA.
      DATA-P = 231850.
      APPEND DATA.
      DATA-P = 436645.
      APPEND DATA.
      DATA-P = 346650.
      APPEND DATA.
      DATA-P =  82500.
      APPEND DATA.
      DATA-P = 300560.
      APPEND DATA.
      DATA-P = 467109.
      APPEND DATA.
      DATA-P = 161850.
      APPEND DATA.
      DATA-P = 356470.
      APPEND DATA.
      DATA-P = 198840.
      APPEND DATA.
      DATA-P = 199000.
      APPEND DATA.
      DATA-P = 340570.
      APPEND DATA.
      DATA-P = 127356.
      APPEND DATA.
      DATA-P = 591850.
      APPEND DATA.
      DATA-P = 287460.
      APPEND DATA.
      DATA-P = 299770.
      APPEND DATA.
      DATA-P =  12500.
      APPEND DATA.
      DATA-P = 230560.
      APPEND DATA.
      DATA-P = 437109.
      APPEND DATA.
      DATA-P = 191850.
      APPEND DATA.
      DATA-P =  36780.
      APPEND DATA.
      DATA-P =  78789.
      APPEND DATA.
      DATA-P = 282000.
      APPEND DATA.
      DATA-P = 270570.
      APPEND DATA.
      DATA-P = 567356.
      APPEND DATA.
      DATA-P =  31850.
      APPEND DATA.
      DATA-P = 92410.
      APPEND DATA.
      DATA-P = 121350.
      APPEND DATA.
      DATA-P = 67356.
      APPEND DATA.
      DATA-P = 431891.
      APPEND DATA.
    ENDFORM.

Maybe you are looking for

  • Visual Studio Visual Basic 6.0 Professional - License

    Hi, As per the information available online, Visual Basic 6.0 is not supported by Microsoft.  Query: This product (Visual Basic 6.0 Professional) was being used with Windows XP and now as part of migration will be moved to Windows 7. Can you please c

  • Can't get firefox to connect / IE (yuk) can: no proxy setting

    family community pc...firefox was working fine and preferred browser by 3 of 5 home pc users...stopped being able to connect to web w/mozilla... Troubleshooting steps: 1. Removed mozilla from programs 2. Searched and deleted all mozilla folders (foun

  • Difficulties opening PDF documents with Adobe XI

    Lately I have to click multiple times on PDF document in order to open it. I have reinstalled several times but the problem continues. I use Window 7. Any suggestions?

  • Putting Photos IN the iPod

    Im trying to actually get the photos in the ipod and i really dont know where to start. I searched all over the forums for any tips but i cant find anything Help!

  • What's a nice FHS-compliant spot to put all my media?

    I recently migrated from Ubuntu to Arch and am loving it so far (although I have nothing bad to say about Ubuntu). I got almost everything set up how I want it, except all my music/movies/videos/etc. In Ubuntu I just put it all in my home folder but