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);

Similar Messages

  • How to draw text vertically, or in an angle

    please help me how to draw text vertically, or in an angle

    I robbed the framework from Dr Las or 74phillip (don't remember which) ...
    import java.awt.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class AngleText extends JPanel {
      private int      degrees = 16;
      private JSpinner degreesSpinner;
      public AngleText () {
        setBackground ( Color.WHITE );
      }  // AngleText constructor
      protected void paintComponent ( Graphics _g ) {
        super.paintComponent ( _g );
        Graphics2D g = (Graphics2D)_g;
        g.setRenderingHint ( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
        AffineTransform at = AffineTransform.getRotateInstance ( Math.toRadians ( degrees ) );
        Font f =  g.getFont();
        g.setFont ( f.deriveFont ( at ) );
        g.drawString ( "Rotating Text!", getWidth()/2, getHeight()/2 );
        g.setRenderingHint ( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF );
      }  // paintComponent
      public JPanel getUIPanel () {
        SpinnerModel degreesModel = new SpinnerNumberModel (
                                      degrees  // initial
                                     ,0        // min
                                     ,360      // max
                                     ,2        // step
        degreesSpinner = new JSpinner ( degreesModel );
        degreesSpinner.addChangeListener ( new DegreesTracker() );
        JPanel panel = new JPanel();
        panel.add ( degreesSpinner );
        return panel;
      }  // getUIPanel
      //  DegreesTracker
      private class DegreesTracker implements ChangeListener {
        public void stateChanged ( ChangeEvent e ) {
          Integer i = (Integer)((JSpinner)e.getSource()).getValue();
          degrees   = i.intValue ();
          repaint();
      }  // DegreesTracker
      //  main
      public static void main ( String[] args ) {
        JFrame f = new JFrame ( "AngleText" );
        f.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
        AngleText app = new AngleText();
        f.getContentPane().add ( app );
        f.getContentPane().add ( app.getUIPanel(), BorderLayout.SOUTH );
        f.setSize ( 200, 200 );
        f.setVisible ( true );
      }  // main
    }  // AngleText

  • Drawing a vertical line in sapscript

    Hi all,
    How can I draw vertical lines in sapscript? Box can be used, but is there any other way? like vline or something else?
    Regards,
    Netrey.

    Hi
    Try with the field &VLINE&
    if don't work,You have to draw boxes only as per the size of the windows.
    /: BOX FRAME 10 TW
    There is no other way like how we write in Report output.
    Reward points if useful
    Regards
    Anji
    Message was edited by:
            Anji Reddy Vangala

  • 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 can I remove vertical lines when printing from Aperture 3.2.2 to Epson Stylus Photo RX690?

    I have been generally quite happy with my access to and use of Aperture 3.2.2 (recently purchased) for import and manipulation of photos and movies, etc.I am using Aperture on a MacBook Pro OSX 10.6.8.
    However I have been unable to print high quality images on Epson premium glossy, glossy or matt paper on my Epson Stylus Photo RX690.
    High quality prints on screen show perfectly in preview, but all prints come out with good and accurate colours, but a series of vertical lines or bands of lines across the photo print.
    Using the Aperture Manual I have checked my settings in Aperture for the printer, for colour and quality of paper etc and they all seem to be correct.
    The Epson Printer is networked with a Toshiba (Vista) laptop which prints perfect results from Picasa and Photoshop with fine colour and no markings.
    I would appreciate any help please.
    Cam Opie

    Thank you Mark
    I thought I had done all the settings .....but no.
    I now have perfect prints. Easy when you know how!!!
    Cheers
    Cam

  • How to draw a vertical string?

    I use Graphics2D to draw a 2D graph with x-axis and y-axis. I would like to put the name of the y-axis vertically along the y-axis. This means I need to rotate my drawString 90 degrees. How can we do that? I would be very thankful if anyone can help me out.
    Thank you

    I had the same problem when I started developing JFreeChart:
    http://www.object-refinery.com/jfreechart/index.html
    Here is the code I use:
         * A utility method for drawing rotated text.
         * <P>
         * A common rotation is -Math.PI/2 which draws text 'vertically' (with the top of the
         * characters on the left).
         * @param text The text.
         * @param g2 The graphics device.
         * @param x The x-coordinate.
         * @param y The y-coordinate.
         * @param rotation The clockwise rotation (in radians).
        public static void drawRotatedString(String text, Graphics2D g2,
                                             float x, float y, double rotation) {
            AffineTransform saved = g2.getTransform();
            AffineTransform rotate = AffineTransform.getRotateInstance(rotation, x, y);
            g2.transform(rotate);
            g2.drawString(text, x, y);
            g2.setTransform(saved);
        }Regards,
    Dave Gilbert
    JFreeChart Project Leader

  • How to Remove the Vertical Line in Forward Mail

    when using apple's mail program how do I remove the vertical line when I forward email ?
    Thanks

    If you are doing this on an iPhone:
    For forwarding or replying to an email without the Blue Vertical line to the left of the text...
    - Open the email
    - Select Forward or reply (this will open a new window)
    - Select All of the text in the new email.
    - In the pop-up bar that says "cut, copy, paste" select the right arrow for more options.
    - Select Quote Level
    - Select Decrease
    Voila!

  • I want to know how to draw arrows & dashed lines in a picture control

    I have to draw arrows & dashed lines in a picture control. Just like we can do that in word or paint etc. I need to do the same using the mouse and drag the line/arrow till I realease the mouse. I am able to this for a normal line ( it works perfectly) but when I have to draw an arrow or a line I am stumped.

    Unfortunately, you have to code your own VIs to do these. It's not going to be too complicated if you manage the animation (while dragging the mouse) with a normal line and draw the dashed line/arrow at the end (when releasing the mouse button).
    In both cases, you'll know start/end line coordinates, thus having the line equation. For arrows, you need to calculate the angle in order to draw it properly.
    A simpler solution may be an activeX control with these features (Paint like) already integrated or to develop one in Visual Basic (at least it will be simpler to manage mouse events and drawing tasks).
    Let's hope somebody already did it and wants to share.

  • How to use a vertical line as column separator in Pages?

    I have a two-column document (a questionnaire) in which I'd like to have a thin vertical line separating the text columns for the sake of clarity. I've tried inserting a floating line using "Insert Shape" but it doesn't appear to like living between the columns. I see these column separators quite a bit in published multi-column layouts, so I figure that I'm not completely crazy. Can anybody offer a suggestion?
    Charlie Perdue

    Thanks... that did it! I had (mistakenly) assumed that once the line was "floating" that it wouldn't interact with the text any more, so that I didn't have to worry about the whole "wrap" issue.
    Thanks for the quick response.

  • How to add a vertical line in crosstab

    Hi guys,
    Like below picture, I'm designing a crosstab, with many columns.
    How to add a line between each other?
    Thanks.

    Hi Hu,
    CR doesn't draw gridlines for summaries unfortunately. This has been a feature that has been requested quite a few times and you should be able to find it in the Ideas Place as well.
    Only two workarounds for now:
    1) Draw a line manually using the line object or
    2) Turn On right/left borders for the field.
    -Abhilash

  • How to draw 2 seperate lines w/Pen tool?

    Hello:                                                                                     Level: New Newbie  OS: Windows 7 64bit
    It's me again w/the same tut at: http://designinstruct.com/drawing-illustration/how-to-make-a-golden-compass-in-illustrator /
    Thank you everyone for all your help thus far!!
    Please refer to step #8 and the picture below
    Where I am confused is that once the line is drawn from top to bottom and I go to draw the line across the upper area the anchors stay connected.
    I tried the Alt key + click to cut the path but (as you advanced folk probably already know) it didn't work.
    So, I searched the manual, forums and other places for a way to make the bottom Anchor an end Anchor ... ?? Does that even exist?
    I don't know if I am explaining this correctly or well enough but I sure would appreciate your guidence
    Honestly I am not even sure what I ought to be looking for in the manual etc.
    I tried just drawing the shape for the Glossy effect and then filling it with the required gradient but frankly it just looks odd ... it looks flat and basically UGLY
    Below is a picture of what I need help accomplishing. The blue line that goes across is the problem for me.
    I should also mention, if you go to the tutorial ... it says that I am suppose to Duplicate the Inner Circle but I made too many goofs and somehow all my layers ended up on one layer so rather than doing what the tut instructs I just made a New Layer and then drew a new circle with the Ellipse tool.
    Even so, I actually couldn't grasp why or how I was suppose to go about intergrating the new circle with using the Pen Tool to draw the Glossy effect object. So, I skipped that part and just used the Pen tool to draw the needed shape as shown above in pink.
    Thank you again!!
    wow ...

    Kara,
    Or just press the P key.
    This will reselect the Pen Tool, implying a deselection.
    Edit: And now I realized: In the other thread I never looked at anything but the actual question, so I was unaware that it was all about a compass.
    There are a few things in the tutorial that could create inaccuracies, and some might be done in easier ways, but differeent users prefer different ways. That is one of the reasons for the pleasant great variation in suggestions here.

  • How to draw a hollow ring in flex

    i gotta requirement to draw a ring in my project... currentlty am drawing a circle with border and decreased alpha value.... it pretend to be a ring but it is not...... here is my code:
                                   var spr:Sprite = event.target.parent as Sprite;
                                    s = new Sprite();
                                    s.graphics.clear();
                                    s.graphics.lineStyle(5, 0xFF0000);                               
                                    s.graphics.beginFill(0xffffff);//d9d9d9  0xfbfbfb
                                    s.alpha=0.4;
                                    s.graphics.drawCircle(spr.mouseX,spr.mouseY,10);
                                    s.graphics.endFill();
                                    img.addChild(s);
                                    addChild(img);
    any one hepl me out plz

    Hi,
    The following code is just a basic ring you could do things like mouse events etc and they will only respond to the ring itself as the 'group' has the mouseenabledwheretransparent set to false.
    The width of the ring is controlled by the stroke weight
    MyRing.mxml - you can use as a component or just use copy the group into your application
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" width="300" height="300" mouseEnabledWhereTransparent="false">
    <s:Ellipse top="0" left="0" bottom="0" right="0">
    <s:stroke>
    <s:SolidColorStroke color="0x000000" weight="20"/>
    </s:stroke>
    </s:Ellipse>
    </s:Group>
    David

  • 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

  • How to Drawing black color line in photoshop...

    What ever color i choose to draw the line it appear grey....this is getting frustration...and wasted alot of time to figure out what bug photoshop has

    and wasted alot of time to figure out what bug photoshop has
    Do you even know the meaning of the term "bug"? Edit: I mean in the context of computers, not zoology.
    Could you please post a screenshot with the pertinent Panels (Layers, Channels, Options Bar, …) visible?
    Which Tool do you use?
    Is a Selection active?
    What are the Tool’s settings (see Options Bar and if applicable Brush Panel)?
    What is the Layer structure and what is the active Layer’s position therein?

  • How to draw string vertically?

    Hi,
    The java drawString() method draws string horizontally by default, but I want to draw the string vertically, see an example below: I want to draw the string "abcdef" as below format:
    a
    b
    c
    d
    e
    f
    so, I thought of the AffineTransform, but I can not work it out.
    Who can help me? If you have other ways, they are welcome too.
    Thanks. Robin

    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    public class VText {
        public static void main(String[] args) {
            int w = 200, h = 300;
            BufferedImage image = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = image.createGraphics();
            g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                                RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
            g2.setBackground(UIManager.getColor("OptionPane.background"));
            g2.clearRect(0,0,w,h);
            g2.setPaint(Color.black);
            Font font = g2.getFont().deriveFont(18f);
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            String text = "Hello World";
            g2.drawString(text, 50, h - 25);
            String[] s = text.split("(?<=[\\w\\s])");
            float y = 25f;
            for(int j = 0; j < s.length; j++) {
                float width = (float)font.getStringBounds(s[j], frc).getWidth();
                LineMetrics lm = font.getLineMetrics(s[j], frc);
                float x = (w - width)/2;
                AffineTransform at = AffineTransform.getTranslateInstance(x, y);
                g2.setFont(font.deriveFont(at));
                g2.drawString(s[j], 0, 0);
                y += lm.getAscent();// - lm.getDescent();
            g2.dispose();
            JOptionPane.showMessageDialog(null, new ImageIcon(image), "",
                                          JOptionPane.PLAIN_MESSAGE);
    }

Maybe you are looking for

  • Unable to extend table in tablespace

    Hi, I have a Oracle Database 11g Release 11.1.0.6.0 - 64bit Production With the Real Application Clusters option. I'm receiving the unable to extend table T_DATA in tablespace USER I'm using ASM. This is the situation of datafiles of USER tablespace

  • Using View Object in Place of a Session Bean?

    I was researching on the forum approaches to storing session data and came across this interesting post: "What are you actually trying to acheive - if it is the storage of 'Session' type data for a particular user then you would create a view object

  • code tag

    Does the tlf support the <code> tag? If not, what would you recommend doing to make that happen? Thanks, Lance

  • Default PDF view after conversion

    Dear All, I'm often converting doc files (microsoft office 2010) to pdf files (Arobat Pro X). When performing this action I get the PDF file with Layout - Single Page Continious and I want it to be Default. In page display preferences I have the layo

  • Idoc Script Addition

    Can anyone explain this.... This code: <!--$intTest = 0.0002 + 0.0001--> <p>"0.0002" + "0.0001" evals to <!--$intTest--></p> Prints this on my page: <p>"0.0002" + "0.0001" evals to 3.0000000000000003E-4</p> In the documentation, it clearly states you