How to draw a simple line chart using GRAPH_MATRIX_2D function

Hello,
can anyone help me with that function please,
i couldn't draw a line graph with three data series, i mean with three lines in the graph.
i want to the chart to be drawn as line graph at the beginning, i shouldn't have to change the chart type later,
can anybody send me a sample code that does what i want.
i am expecting your answers,
thanks.
Note: all answers will be pointed.

Hi Ali,
please refer to my reply [here|Re: drawing 2d line chart problem, urgent please!!!] and skip this thread. This is a copy of the other request.
Regards
Matthias

Similar Messages

  • How to draw a simple pie chart?

    I want to draw a simple pie chart.
    I was wondering whether there already exists a method to allow me to do that in SDK 1.4.2. I saw on the net a method getPieChart( ).
    Do you know if its incorporated in SDK1.4.2 and how to draw the pie chart using this method. Can anybody guide me?
    Thanks.

    Have a look in your demos folder in your SDK, for example:
    C:\j2sdk1.4.2_04\demo\applets\GraphicsTest

  • I want to make a simple line chart

    i want to make a simple line chart using the data in two nonadjacent columns.
    it seems that the easiest way to do this is to export the sheet to google docs and use THEIR charting, which is a two-click deal.
    is there an easy way to do this in numbers?
    my impression:
    numbers:
    very fancy, super pretty, easy to modify APPEARANCE, difficult to use actual charts. custom paint job on a junker
    googledocs:
    available everywhere, basic, more difficult with actual data flexibility, but you can use what you've got.
    the whole emphasis on numbers seems to be how pretty i can make displays, but not a lot of emphasis on making it easy to make things work.
    can anyone shed some light on how to make this simple instead of pretty?

    You can definitely use the technique I mentioned to order the columns to make it easy to chart:
    Here I created a table (the top one) to hold the original data and make a second table (the lower one) to pull data into two adjacent columns:
    The bottom table, as I said pulls data from the top data table:
    Then highlight the data in the table to chart, and selec the chart type from the menu (I suggest the bar chart which is the first item in the chart tool menu):
    I made up this data and mean it to be no reflection on your running ability 

  • Simple Line Chart - Values over time

    A simple line chart displaying a set of values over time would seem to be a very easy report to design. I'll be darned if I can see how to design it. Can anyone shed some light?
    I have provided links to a report and a spreadsheet which is the report datasource. My actual report will use SQL Server as its datasource. I am providing ths excel based example for the sake of protability.You will need to set the datasource location after saving the files to your hard drive.
    I can get the lines to draw properly, what I cannot figure out is how to specify the datetime values for the x axis. The column I would like to use on the x-axis is called DerivedLoggingTime.
    I'd also like to get control of the logarithmic algorithm used to formulate the y-axis values. I am not always happy with the values that the log algorithm comes up with.
    Any help is greatly appreciated.
    [Link to report|http://www.usol.com/~joe/linechart.rpt]
    [Link to spreadsheet|http://www.usol.com/~joe/AnalysisResults.xls]
    Another discovery while working on this report - our database will be SQL 2008 and  we are making use of the datetime2 datatype. CR appears to be treating this datatype as text. So when working with the SQL based datasource, I had to cast datetime2 columns as datetime in order for CR to see the columns as datetime instead of text. This is fine in this instance because the granularity of the datetime values for this particular report does not require datetime2, but that will not always be the case. CR will need to recognize the new datatype.
    Edited by: Joe Sytniak on Jul 17, 2008 5:37 PM

    Hi Joe,
    The Date Axis Line Chart of the Numeric Axis Type Chart, can be used to display data on a regular interval of days, Months and Years. The information displayed can unfortunately not be more granular that days.
    This type of chart is generally used when the data is recorded on irregular intervals in the database, and to make sense of the information stored it needs to be displayed at regular intervals.
    Since the data stored in your data source seems to be stored every 4 minutes, it will not be necessary to use this type of chart. I will suggest to use the regular line chart instead.
    To create a line chart using your date time field and value:
    1. Select "Chart" under the menu "Insert"
    2. Insert the chart on your report in the desired section.
        ( Group Header # 3 in your case. )
    3. In the "Chart Expert" window, under the tab "Type",
        change the chart type to a line chart by selecting "Line" in
        the "Chart Type" list.
    4. Under the tab "Data", add the database field that contains the Date Time information under the "On change of" list.
    (In your case, add the "DerivedLoggingTime" database field)
    5. To display the data for each minute, select the database fields you just added under the "On Change of" list, and
    click on the button "Order". In the "Chart Sort Order" window,
    select "For each minutes" in the "Section will be printed" drop down list, then click "OK"
    6. Add the field you want to display the value in the "Show Value List", then click "OK"
    Now it will display a line chart as desired, but since there is a lots of data point on your chart, the x axis date time labels will overlap each other. To avoid  this situation, I will suggest to skip labels.
    To format a chart to skip labels:
    1. In the "Preview" tab of the report, select one of the x axis label, and right click on it. In the contextual menu, select "Group (X) Axis Options..."
    2. In the "Group (X) Axis Settings" window, under the tab "Layout", check the option "Skip Group Labels" and set the value to 15 for example.
    Now, it will display the date time label at every 15 data point.
    As for your question on how get control of the logarithmic algorithm used to formulate the y-axis values, we unfortunately do not have much control over it other than:
    - Entering static values, or
    - Checking or Unchecking the option "Use Logarithmic scales"
    The above options are available on the y axis. To change those options:
    1. In the "Preview" tab of the report, select one of the y axis label, and right click on it. In the contextual menu, select "Group (Y) Axis Options..."
    2. In the "Group (Y) Axis Settings" window, under the tab "Scales", you will see the following options:
    - Minimum Values
    - Maximum Values
    - Use Logarithmic scales
    I will suggest to check the option "Use Logarithmic scales"
    Finally, as for the issue you discovered where SQL Server 2008 data type DateTime2 is converted to a string in Crystal Reports 2008, it is important to note that SQL Server 2008 hasn't been released yet, therefore it has not been tested in Crystal Reports 2008. Once SQL Server 2008 is released, I will suggest to test it again using the ODBC driver provided with this new version. 
    At this point I am assuming that this is happening because it is a new data type and an unknown data type get converted to string.

  • How to Axis labels for Line charts in Business Graphics

    Hi
    I am planning to do the Business Graphic example using Line chart.As part of this
    i didn't clearly understand what is the perpose of Series,Points,categorys?
    if i want to set the Labels at X-axis and y axis ,then how to do that?Baiscally i want to put time related data as X-axis label(20min,30min,60 min etc).Please help.
    is there any good example to understand the concept?
    Thanks
    Prasad

    Hi Bachier
    Thanks for your repsonce.I had seen the example you suggested.but there is no answer for my question.How to set the x-Axis,Y-axis Labels.I had done example for "line chart".But i have same problem:
    Hi
    I am trying to do example on "line chart" using Business graphics in my webdynpro application.
    In the Context i created Node "A" under which i created "B".then it has  value attributes xValue,yValue.Then in View i created BG UI element >Series>point-->NumericValue(for xValue) ,NumericaValue(yValue).Now in view init() method i had initialized values to x and y. some output is coming.but i want to know how to set the X-Axis Label,y-Axis Labels.in X-Aix Label i want to mention time in hrs i.e 8.00,8.30AM,9.00AM,9.30AM etc.as part of y-axis labels i want to mention numeric values( .2,.4,.8,2.0 etc). Please tell me how to set this X-Axis,y-Axis labels.at every 30min(8.00Am,8.30AM etc) user enter quality data(i.e .2 etc) then i want to generate chart.Please help in this regard.i will give very good points
    Thanks
    Prasad

  • How to create curve fitted line chart?

    Line chart is formed with straight lines, but how to create curve fitted line chart?

    Jasper wrote a blog on curve fitting charts

  • Please help me to draw a special line Chart!

    Hi, I am programming to draw a line chart with X-axis as timepoint (for example, t1, t2, t3, t4, ...) and Y-axis as values (v1, v2, v3,v4,...) and have a line connecting all the (t, v) point. The issue I have encountered is that when a value (for example, v3) is missing at the timepont(t3), I still want the timepoint to show on X-axis but the connectiong line to stop at (t2, v2) and start again at (t4, v4). Is it possible to draw such a line chart? Is there any 3rd party supporting it? If so, may you please give me hints and help me out of this? Thanks alot.

    I did find this:
    import java.awt.event.*;
    import java.awt.*;
    public class Pxy extends Frame 
    public Pxy()
         addWindowListener(new WindowAdapter()
        {     public void windowClosing(WindowEvent ev)
              {     dispose();
                   System.exit(0);}});
         setBounds(1,1,670,450);
         txy pan = new txy();
         add(pan);     
         setVisible(true);
    public class txy extends Panel
         int xt[] = {1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1};
         int yv[] = {40,15,30,90,105,128,120,98,199,250,269,203,90,210,200,145};
         int sx = 40;
         int sy = 30;
    public txy()
         super();
         setBackground(Color.pink);
    public void paint(Graphics g)
         g.setColor(Color.white);
         for (int i=0; i < 21; i++)
              g.setColor(Color.white);
              g.drawLine(i*30+sx,sy,i*30+sx,sy*10);
              g.setColor(Color.blue);
              g.drawString(""+i*30,i*sy+sy+2,30*10+30/2);
         for (int i=0; i < 10; i++)
              g.setColor(Color.lightGray);
              g.drawLine(sx,i*30+sy,20*30+sx,i*30+sy);
              g.setColor(Color.blue);
              g.drawString(""+i*30,10,i*sy+sy+2);
         g.setColor(Color.black);
         for (int i=0; i < xt.length-1; i++)
              if (xt[ i ] == 1)
              g.drawLine(i*30+sx,yv[ i ]+sy,(i+1)*30+sx,yv[ i+1 ]+sy);
    public void update(Graphics g)
         paint(g);
    public static void main(String[] args )
         new Pxy();

  • JDEV 10G: how to display the value of the line chart using jChart in JSP

    I have draw the line chart in JSP using the JChart and now I wan to display the value label in the line there..
    but the value wasn't show..
    anyone can help me..
    thx..

    Hi,
    what I do understand, you want to display the value of each point in your Line Graph.
    I guess you will be having BIGraph.xml file. In this file check the "Show Data Tips When Mouse is over bars" checkbox.
    Lets try with this.
    --Abhijit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Can't seem to draw a chart (line chart) using dates rather than numbers

    I'm trying to draw a Line Chart but rather using numbers i want to use dates for example: Switzerland 23/06/2008 - 23/08/2008. Can't seem to get it to work? it seems to all go wrong when I change the cell format to 'date'
    Can anyone help?
    Thanks
    PS. I can do it easily in Excel

    Hello
    From my point of view, it's not surprising.
    In XL, a date is a number to which a date format is applied. So, it may be charted.
    Same thing with the good old AppleWorks.
    With Numbers, a date is NOT a number, it IS a specific class of data.
    The consequence is that it can't be charted directly.
    Happily, we may easily convert a date into a number.
    In column B the formula is
    =A-$A$1
    which calculates the numeric difference between stored dates and the date stored in A1.
    So, we may chart the results.
    I know that it's far from perfect but we have to live with the choices made by Numbers's designers.
    Yvan KOENIG (from FRANCE vendredi 18 avril 2008 18:44:14)

  • How to draw a simple little line.

    I have a JApplet that loads images from a jar file. This applet can scale the images, and move them left right, up and down.
    I just want to be able to draw a line on top of the images and then erase it if needed. How do I do this?
    Currently, I have a the jpg images loaded into an Image, which is then converted to an ImageIcon, which is then used to create a JLabel, which is used to create a JScrollPane which finally gets added as a tab on a JTabbedPane.
    I was told to use BufferedImage but that didn't help me. Here is what I have currently:
    private void draw()
    //Get the current image to draw on
    JScrollPane jsp = (JScrollPane)m_tabbedPane.getSelectedComponent();
    JViewport port = jsp.getViewport();
    GrabAndScrollLabel gnsLabel = (GrabAndScrollLabel) port.getView();
    ImageIcon ii = (ImageIcon) gnsLabel.getIcon();
    BufferedImage bi = new BufferedImage (ii.getIconWidth(),
    ii.getIconHeight(),
    BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = bi.createGraphics();
    g2.setPaint(Color.blue);
    g2.drawLineRect(100, 200, 300, 500);
    g2.drawImage(ii.getImage(),null,null);
    ImageIcon newIcon = new ImageIcon(ii.getImage());
    gnsLabel.setIcon(newIcon);
    port.setView(gnsLabel);
    jsp.setViewport(port);
    getRootPane().revalidate();
    getRootPane().repaint();
    Please help. I can't believe it has to be this difficult to draw a little line.
    Thanks.

    I have a little more insight into my problem.
    I built a sample form Sun (the Map_Line sample). It looks like this:
    public class Map_Line extends Applet
    private BufferedImage bi;
    public Map_Line()
    setBackground(Color.white);
    Image img = getToolkit().getImage("bld.jpg");
    try
    MediaTracker tracker = new MediaTracker(this);
    tracker.addImage(img, 0);
    tracker.waitForID(0);
    catch (Exception e)
    int iw = img.getWidth(this);
    int ih = img.getHeight(this);
    bi = new BufferedImage(iw, ih, BufferedImage.TYPE_INT_RGB);
    Graphics2D big = bi.createGraphics();
    big.drawImage(img, 0, 0, this);
    public void paint(Graphics g)
    Graphics2D g2 = (Graphics2D) g;
    int w = getSize().width;
    int h = getSize().height;
    int bw = bi.getWidth(this);
    int bh = bi.getHeight(this);
    g2.drawImage(bi, null, 0, 0);
    g2.setColor(Color.white);
    g2.setStroke(new BasicStroke(5.0f));
    g2.drawLine(10, 10, bw - 10, bh - 10);
    public static void main(String[] s)
    WindowListener l = new WindowAdapter()
    public void windowClosing(WindowEvent e)
    System.exit(0);
    Frame f = new Frame("Map_Line");
    f.addWindowListener(l);
    f.add("Center", new Map_Line());
    f.pack();
    f.setSize(new Dimension(350, 250));
    f.show();
    Note how the drawing is done in paint. This applet works just fine for me.
    The difference is that I'm trying to use the BufferedImage to get my Graphics2D object where as this one gets it from paint (casts Graphics to Graphics2D).
    This applet works just fine, but if you try to use the Graphics2D that comes back from the BufferedImage, it doesn't work!.
    For example, if I create a member variable:
    Graphics2D big;
    And then in paint do this:
    //Graphics2D g2 = (Graphics2D) g;
    Grahics2D g2 = big;
    It no longer works!
    So, it looks like I need to use something other than the
    BufferedImage.createGraphics() to get the Graphics2D object I need.
    Does this seem right?
    Thanks!

  • How to draw 3D/2D Surface Chart and Contour Plot using MSCHART

    Hello all
    i want to draw 3D/2D surface chart and Contour Plot using MSCHART, is that possible ?
    Please help me to sort the issue. Is there any like ?
    Thanks in advance

    As founder of Gigasoft, add our
    MS Chart Alternative to your research.  Quick 18 meg no hassle demo download will prove our bits beyond any words or pictures.

  • Drawing TrendLines in Line Chart

    Hi,
    I am using a Line Chart in one of my projects.
    I use a HTTPService to fetch XML Data to feed the chart.
    <mx:HTTPService id="myServ" url="ChartData.xml" result="myResultHandler(event)"/>
    I draw two trend lines over the chart based on the max & min values for a specified node in the XML data
    <?xml version="1.0" encoding="utf-8"?>
    <nodes>
        <node month="Jan-10">
           <expenses>20</expenses>       
        </node>
        <node month="Feb-10">
           <expenses>30</expenses>       
        </node>
        <node month="Mar-10">
            <expenses>80</expenses>       
        </node>
        <node month="Mar-10">
            <expenses>20</expenses>       
        </node>
    </nodes>
    I use the expense node in determining the max & min value for the chart.
    I determine the max & min values & draw the lines in the result handler function:
    If i use result Format = "e4x", I am able to iterate the data as XML List Collection, but when I get the data as ActionScript objects, I am not able to iterate the XML data.
    public function drawLine(event:Event):void
         myChartCanvas.clear();
         myChartCanvas.lineStyle(2, 0x000000, 1);
         myChartCanvas.moveTo('Jan-10', 50);
         myChartCanvas.lineTo('Aug-10', 70);
    How can i iterate the nodes in AS3 object format to find the max & min nodes & draw the trend lines ?
    - Sen

    Cast the Objects. You know they are XML behind the scenes.

  • Creating a Line Chart using a user enter target amount.

    Hi all,
    I'm trying to create a chart that will use Total Sales and Annual Target(Goal).
    I get the Total sales to work just fine. It's just getting the Annual Target(Goal), which is a parameter, to come into the chart. Right now they are doing this in Excel and the Target line goes from 0 to 8,000,000.
    So how do i get that to work in my Crystal Report?
    So when the report is working correctly i should have a Line Chart with two Lines. Line 1 "The Target", Line 2 "Total Sales".
    Thanks

    Hi
    Create a formula field and store the parameter there.
    Now put this formula field in "On change of" in the Chart expert.
    e.g. I have a parmeter on country and I have a chart which shows the last year sales year wise for the countries.
    I create a formula field and put the below formula:
    stringvar x = {?countryparameter};
    Now i put this formula field in On change of so when i run the report i select the required country.
    Hope this helps!!
    Regards
    Sourashree

  • How to draw only straight line instead of angled one??

    Dear friends,
    I saw a very good code posted by guru here(I think is camickr),
    But I tried to change it and I hope to draw only straight line instead of angled one, can you help how to do it??
    Thanks so much.
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class DrawingArea extends JPanel
         Vector angledLines;
         Point startPoint = null;
         Point endPoint = null;
         Graphics g;
         public DrawingArea()
              angledLines = new Vector();
              setPreferredSize(new Dimension(500,500));
              MyMouseListener ml = new MyMouseListener();
              addMouseListener(ml);
              addMouseMotionListener(ml);
              setBackground(Color.white);
         public void paintComponent(Graphics g)
              // automatically called when repaint
              super.paintComponent(g);
              g.setColor(Color.black);
              AngledLine line;
              if (startPoint != null && endPoint != null)
                   // draw the current dragged line
                   g.drawLine(startPoint.x, startPoint.y, endPoint.x,endPoint.y);
              for (Enumeration e = angledLines.elements(); e.hasMoreElements();)
                   // draw all the angled lines
                   line = (AngledLine)e.nextElement();
                   g.drawPolyline(line.xPoints, line.yPoints, line.n);
         class MyMouseListener extends MouseInputAdapter
              public void mousePressed(MouseEvent e)
                   if (SwingUtilities.isLeftMouseButton(e))
                        startPoint = e.getPoint();
              public void mouseReleased(MouseEvent e)
                   if (SwingUtilities.isLeftMouseButton(e))
                        if (startPoint != null)
                             AngledLine line = new AngledLine(startPoint, e.getPoint(), true);
                             angledLines.add(line);
                             startPoint = null;
                             repaint();
              public void mouseDragged(MouseEvent e)
                   if (SwingUtilities.isLeftMouseButton(e))
                        if (startPoint != null)
                             endPoint = e.getPoint();
                             repaint();
              public void mouseClicked( MouseEvent e )
                   if (g == null)
                        g = getGraphics();
                   g.drawRect(10,10,20,20);
         class AngledLine
              // inner class for angled lines
              public int[] xPoints, yPoints;
              public int n = 3;
              public AngledLine(Point startPoint, Point endPoint, boolean left)
                   xPoints = new int[n];
                   yPoints = new int[n];
                   xPoints[0] = startPoint.x;
                   xPoints[2] = endPoint.x;
                   yPoints[0] = startPoint.y;
                   yPoints[2] = endPoint.y;
                   if (left)
                        xPoints[1] = startPoint.x;
                        yPoints[1] = endPoint.y;
                   else
                        xPoints[1] = endPoint.x;
                        yPoints[1] = startPoint.y;
         public static void main(String[] args)
              JFrame frame = new JFrame("Test angled lines");
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              DrawingArea d = new DrawingArea();
              frame.getContentPane().add( d );
              frame.pack();
              frame.setVisible(true);
    }

    Change the AngledLine class to store two points instead of 3 points (I would rename the class to be StraightLine). The code is much simpler because you just store the starting and ending points and you don't need to calculate the middle point.

  • How to Draw a vertical line in flex

    I was just wondering the simplest way to draw a vertical line , preferably dashed.

    You could always just use the graphics class of your chart component.  Just access its graphics object, set the line style/thickness, move to the start point, and line to the end point.  Something like this,
    this.graphics.lineStyle(1, 0x000000);
    this.graphics.moveTo(startX, startY);
    this.graphics.lineTo(endX, endY);

Maybe you are looking for

  • OER running inside VirtualBox

    All I was wondering if anybody has some suggestions here, my problem is as follows 1 - Installed Oracle Enterprise Repository into a OEL 5.6 32 bit Virtual Box VM, using Oracle Xe 10.2 as the Db, all on the same VBox image 2 - Runs fine and can acces

  • Logic not opening 64-bit 48khz audio files.

    I recently tracked drums at a studio thatuses Cakewalk Sonar 6. The audio files are consolidated (into 16 54 minute strips) and on my hard drive now, but Logic will not open them for some reason. I have my Mac and Logic in 64-bit mode. When I try to

  • Report Execution from within Java application

    I am currently running my Oracle reports through a Java application where I just create a HttpURLConnection to the reports server and push in my report request, and then read the connection input stream in order to obtain the generated report. This i

  • API for tag parameters?

    Hi,<br /><br />Does anyone know the appropriate API call for embedding elements _within_ a tag? Versions/stVer:event is an appropriate example where this occurs. It should look something like this:<br /><br />   <xmpMM:Versions><br />     <rdf:Seq><b

  • Not able to Check Delta Enabled Checkbox in Datasource

    Hi, I created a Custom Datasource in ECC system which extracts data through Function module.  I activated the Datasource without checking the Delta checkbox.  Only when i created Infopackage in BI, i realized my mistake.  When i try to go back to ECC