Can I draw a k-line graph with jfreechart for a Mac app on 10.8?

Hi,
  I want to draw a k-line graph on mac, and I haven't find a lib better than jfreechart on doing that work until now, so how can I use it in xcode?
Regards

I believe this version works in 10.6.8.
http://support.apple.com/kb/DL1507

Similar Messages

  • Exporting from a 2D line graph with .jpeg extension

    Is there any way to export from an ordinary 2D line graph with .jpeg extension so that with using this image i will improve my result of exporting excel.
    e.g. i have found and example and added a button as you will see when you run this code.I will click this button and it will export this line graph with extension .jpeg so that i will see it as an ordinary image at my home directory.
    Thanks for any helpful comment
    Regars,
    Serhat
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author led1433
    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class LineGraph
        public static void main(String[] args)
            int x1 = 1000,y1 = 0;
            JFrame f = new JFrame();
            JButton exportToJPegButton = new JButton("EXPORT WITH JPEG");
            exportToJPegButton.setToolTipText("Exports Graph with extension *jpeg");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            exportToJPegButton.setSize(200,25);
            f.add(exportToJPegButton).setLocation(x1, y1);
            f.getContentPane().add(new GraphPanel());
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class GraphPanel extends JPanel
        final int
            HPAD = 60,
            VPAD = 40;
        int[] data;
        Font font;
        public GraphPanel()
            data = new int[] {
                120, 190, 211, 75, 30, 290, 182, 65, 85, 120, 100, 101
            font = new Font("lucida sans regular", Font.PLAIN, 16);
            setBackground(Color.white);
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            int w = getWidth();
            int h = getHeight();
            // scales
            float xInc = (w - HPAD - VPAD) / 11f;
            float yInc = (h - 2*VPAD) / 10f;
            int[] dataVals = getDataVals();
            float yScale = dataVals[2] / 10f;
            // ordinate
            g2.draw(new Line2D.Double(HPAD, VPAD, HPAD, h - VPAD));
            // tic marks
            float x1 = HPAD, y1 = VPAD, x2 = HPAD - 3, y2;
            for(int j = 0; j < 10; j++)
                g2.draw(new Line2D.Double(x1, y1, x2, y1));
                y1 += yInc;
            // labels
            String text; LineMetrics lm;
            float xs, ys, textWidth, height;
            for(int j = 0; j <= 10; j++)
                text = String.valueOf(dataVals[1] - (int)(j * yScale));
                textWidth = (float)font.getStringBounds(text, frc).getWidth();
                lm = font.getLineMetrics(text, frc);
                height = lm.getAscent();
                xs = HPAD - textWidth - 7;
                ys = VPAD + (j * yInc) + height/2;
                g2.drawString(text, xs, ys);
            // abcissa
            g2.draw(new Line2D.Double(HPAD, h - VPAD, w - VPAD, h - VPAD));
            // tic marks
            x1 = HPAD; y1 = h - VPAD; y2 = y1 + 3;
            for(int j = 0; j < 12; j++)
                g2.draw(new Line2D.Double(x1, y1, x1, y2));
                x1 += xInc;
            // labels
            ys = h - VPAD;
            for(int j = 0; j < 12; j++)
                text = String.valueOf(j + 1);
                textWidth = (float)font.getStringBounds(text, frc).getWidth();
                lm = font.getLineMetrics(text, frc);
                height = lm.getHeight();
                xs = HPAD + j * xInc - textWidth/2;
                g2.drawString(text, xs, ys + height);
            // plot data
            x1 = HPAD;
            yScale = (float)(h - 2*VPAD) / dataVals[2];
            for(int j = 0; j < data.length; j++)
                y1 = VPAD + (h - 2*VPAD) - (data[j] - dataVals[0]) * yScale;
                if(j > 0)
                    g2.draw(new Line2D.Double(x1, y1, x2, y2));
                x2 = x1;
                y2 = y1;
                x1 += xInc;
        private int[] getDataVals()
            int max = Integer.MIN_VALUE;
            int min = Integer.MAX_VALUE;
            for(int j = 0; j < data.length; j++)
                if(data[j] < min)
                    min = data[j];
                if(data[j] > max)
                    max = data[j];
            int span = max - min;
            return new int[] { min, max, span };
    }

    GraphPanel stays the same.
    public class JpegExport {
        public static void main(String[] args) {
            final GraphPanel graphPanel = new GraphPanel();
            JButton exportToJPegButton = new JButton("EXPORT WITH JPEG");
            exportToJPegButton.setToolTipText("Exports Graph with extension *jpeg");
            exportToJPegButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    exportToJpeg(graphPanel);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(exportToJPegButton, BorderLayout.NORTH);
            f.getContentPane().add(graphPanel, BorderLayout.CENTER);
            f.setSize(400, 400);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        private static void exportToJpeg(GraphPanel graphPanel) {
            try {
                int w = graphPanel.getWidth();
                int h = graphPanel.getHeight();
                BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                graphPanel.paint(g2);
                g2.dispose();
                ImageIO.write(image, "jpeg", new File("export.jpg"));
            } catch (IOException e) {
                e.printStackTrace();
    }

  • Can I draw a freehand line in a Fill & Sign document?

    Can I draw a freehand line in a Fill & Sign document? I have filled in the form but need to draw a freehand line to indicate the markings on our horse's face.

    Hi franc60007656,
    You can draw a straight line only in a fill and sign document and not a free hand line.
    Regards,
    Rahul

  • Mail will not work, it says "you can"t use this version of mail with this version of mac os x. mail version 4.5 help please

    Mail icon displays the following "you can't use this version of mail with this version of mac os x"
    Mail version 4.5
    It was ok on friday, my daughter used the mac to update her ipod to ios6, would this cause a problem?
    All my updates are up to date.
    Any help, thanks.

    !! WARNING !!
    about the September 2012
    "Security Update 2012-004"
    If you've got "Mail.app" in a folder OTHER THAN the root "Applications" folder,
    MOVE "MAIL.APP" TO THE APPLICATIONS FOLDER
    **BEFORE** INSTALLING THE "004" UPDATE!!
    Because *IF* you use OSX's integrated Software Update app from the Apple menu to do the "004" updating, and *IF* your Mail.app is NOT in the Applications folder, then buddy, you've got some sitdown fixit time ahead of ya and/or some internet tie-up time downloading the "004" update file itself.
    Been through it all, already.  In fact, just got done getting my Mail back up & running. And I tried everything short of attempting to unpacking my "Mail.pkg" receipt file using... whatever... even Pacifist couldn't get it out. So that fixit "Plan D" died quick. And I'm not savvy enough to use Terminal commands to do "Plan E," so that SUDO stuff was my brick wall.
    So I compressed my entire "Mail" subdirectory that contain all my emails, for safekeeping during the required surgery, or whatever would work, leaving the original Mail directory where it was. In case something bad happened in all my fixit whatevers, the one thing I *didn't* want to cross paths with was a hosed Library -> Mail folder. Then I'd be pssd. But I can wipe out that ZIP now 'cause all's well now. After 6 hrs of downloading thru a mobile broadband hotspot running at only 14KB/sec speed due to my having gone over my T-Mobile hotspot plan's bandwidth amount (throttled-down after reaching the limit, tho not cut off completely. Kinda nice, but it's a huge speed drop).
    I tried moving the two Mail.app versions around, compressing them & then trashing the original so they wouldn't be recognized, blabla, even booted my Mac in Safe Mode & reinstalled the "MacOSX 10.6.8 (Snow Leopard) Update Combo.dmg" update file, which in the past has fixed many problems. But after restarting, not this one.
    Like a dummy who ignored knowing better, I had my Mail.app in a folder other than the Applications folder, with only an alias to that being in the Applications folder. NOT GOOD ENOUGH. The updater don't see that as nuthin special or useful.
    So if you've got, like I've got, "old" icons for Mail.app (v4.5) in your Finder toolbar & in your Dock that all point to "Mail.app v4.5" in whatever folder you've got that in, other than in the Applications folder (where Apple apparently REQUIRES that it be located, and ONLY there, at least for OSX updating purposes), then after you download & autorun that "004" updater using Software Update, NONE of your pre-existing Mail icons will work. And MOST aggravatingly, **NOR** will your brand-new "Mail.app v4.6" work that came out of the "004" updating installation.  So basically, your Mail.app's... all of 'em.... are hosed. But only if you run the "004" update without your "Mail.app v4.5" being located in your Applications folder and ONLY in your Applications folder. And duplicates of Mail.app, scattered around your HDD??  Always a problem with many Apple apps.... The Apple software engineers apparently like 'em to be in the Applications folder, and in ONLY there, and ONLY the latest version, and ONLY 1 single copy of each on your entire HDD. They just don't seem to stress that enough, it appears. Kind of an oversight for them to not emphasize that, IMO...
    My recommendation for this particular September 2012 "004" update:
    If you run Software Update, and if you see the "Security Update 2012-004" listed as available for download, UNCHECKMARK IT.  DO NOT DOWNLOAD IT USING SOFTWARE UPDATE !  Instead, download the actual update file itself.
    Same thing, only a different way of doing it. Most importantly, you'll be skipping the auto-installation that Software Update performs.
    AND you'll have that update file on your HDD for future fixits, should a nasty "unfixable" problem come up.
    First, #1. Do a filename search for "Mail" (Option-Command-Spacebar). Scroll down to where the "Apps" are located in the list under the "Kind" column heading. First, find your Mail.app that's v4.5. Get that bugger into your Applications folder if it's not already there. Next, Trash all other "Mail.app" apps you see in that same list that you may have elsewhere on your HDD.
    #2. Go here: https://support.apple.com/kb/DL1586
    And download the actual "004" DMG update file: "SecUpd2012-004.dmg"
    And of course, it's a biggie.... 270MB... so watching grass grow may be involved here if you've got a slow connection (go to a MacDonalds & do it, like I shoulda done).
    3. After downloading, I'd recommend closing down all apps, emptying the Trash, and restarting.
    Then, after restarting, run Disk Utility's "Repair Disk Permissions."
    Then, doublecheck that the Mail.app version 4.5 is in your Applications folder.
    THEN fire up & install "SecUpd2012-004.dmg."
    Reboot.
    After the reboot, your Mail.app version 4.5 in the Applications folder will have become Mail.app version 4.6 in the Applications folder, and all will be well again.
    And you can dump that zipped-up "Username -> Library -> Mail" folder then, too.
    Happy Mac'in!
    Kevin Kendall
    Macbook 7,1
    (Apple's very last all-white Macbook model)
    2.4GHz - 256GB Crucial SSD - 8GB Crucial RAM
    OS 10.6.8 Build 10K549 + Win 7 Ultimate thru VMWare Fusion v5.0.1

  • How to work with otool for pre check app befor submit to app

    any body  work with otool for pre check app befor submit to app.

    Searching in Google, I found these explanations :
    Timmy OTool is a graphical front end for the command line tool "OTool". It can be used to examine frameworks, applications, static libraries, plugins, and more.
    Like the two others helpers, I can't see any link with this forum theme.
    May you take care of forums deicated themes before entering one of them ?
    Yvan KOENIG (VALLAURIS, France) jeudi 16 juin 2011 16:27:11
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !
    Oops, posted too late

  • I'm having problems with Outlook for the Mac, anyone else?, I'm having problems with Outlook for the Mac, anyone else?

    I have recently purchased a Mac.  I'm very dissapointed at the way Outlook 2011(the newest version, what?!?)interfaces with the Mac.  I used the contacts feature all the time when I had a microsoft system.  Now, I can't do that with Outlook for the Mac.  Does anyone have any alternative Apps that they've used for Business contacts?  Thanks much.

    thank you both for your responses.  I'm having trouble mostly with a way to handle my business contacts. I'm self employed and when I had Outlook for Microst(before I switched to Apple)I was so pleased with this softward. Esp the way it would keep track of any correspondense between me and my customer.  I could also track billing thru Outlook contacts. 
    Now, I get my mail thru outllook and use ical and @contacts.  I see that I can have a separate group of contacts thru @contacts, but, it's not the same or nearly as good as Outlook contacts for Microsoft.
    So, right now I'm really disapointed with my Mac purchase and hoping to find an app that will help.  I will investigate Thunderbird.
    thanks again.

  • Where can i find a list of compatible ssd's for Apple Mac Pro 3.33GHz Six Core Mid 2012 Desktop/PC.

    where can i find a list of compatible ssd's for Apple Mac Pro 3.33GHz Six Core Mid 2012 Desktop/PC?

    http://www.storagereview.com/best_drives
    http://www.storagereview.com/buying_an_ssd_the_top_10_brands_that_matter
    Prices have crashed. Look and you can find Samsung 128's and others for $89 sometimes.
    It is not just moving the OS and data apart, though it does matter, and more from you should never have the OS cluttered with data, been doing that for... 35 yrs. 0.01 ns vs 10 ms. 60k IO's per second. Reads in 220MB/sec but held back from making full use of SATA 6G.
    OWC Mercury Aura Pro Express 6G SSD, the first and only third party SSD compatible with the new 2012 MacBook Air.
    http://thessdreview.com/category/our-reviews/

  • I get the message "Install Adobe Flash" can't be opened because it was not downloaded from the Mac App Store. This is the first time I have gotten the message. What do I need to do?

    I get the message "Install Adobe Flash" can't be opened because it was not downloaded from the Mac App Store. This is the first time I have gotten the message. What do I need to do?

    Hi Sandra,
    you'll need to edit the security settings to install programs 'Mac App Store and identified developers'
    Open the Systems Preference and go to Security & Privacy.  There will be a section in the 'General' tab for 'Allow apps downloaded from:"  The default selection is 'Mac App Store'.  Change this setting to 'Mac App Store and identified developers".
    This screenshot is taken on OS X 10.10 (Yosemite), so it may look slightly different if you're on a different OS X version.
    Maria

  • ""Install Adobe Flash Player.app" can't be opened because... not downloaded from the Mac App Store"

    I jsut upgraded to 10.9 and it is up to date and also my safari is up to date (no updates available for it). My safari is saying that my flash is out of date. when I follow the links it lets me download but when I double click to install it tell me "“Install Adobe Flash Player.app” can’t be opened because it was not downloaded from the Mac App Store.". When I install the flash UNinstaller and try to install that, it tells me the same. I ALSO found the exact same problem when I tried to install the acrobat installer (some tried to download a pdf and the page told me that my acrobat reader 'might' be out of date). Any thought?

    You're running up against the GateKeeper.
    Download the offline installer: Flash Player 12.0.0.44 (Mac OS X) by right clicking and choosing "Download Linked File As".
    Mount the DMG and when it opens, right click the installer and choose "Open".
    You'll see a warning. Click "Open" again.
    It will run from there.

  • I can't download anything on the Mac App store. It says This Apple ID cannot be used for the Mac App Store.

    I can't download anything on the Mac App store. It says This Apple ID cannot be used for the Mac App Store.

    I went into settings, iTunes & App Store and tapped on my appleID, then signed out. I went back into the App Store on my phone and tried to download the app and then signed in again, and it worked!

  • This message appears whenever I try to open a file downloaded from internet: can't be opened because it was not downloaded from the Mac App Store

    Just bought a new Imac OX 10.9. Installed contents from previous Time Machine. All looks good. But, now, when I try to open any file downloaded from interent (like the Amazon mp3 downloader, for example or a plugin update) I get this message:
    "XXX can’t be opened because it was not downloaded from the Mac App Store" . Help! Thanks

    Got it solved! System preferences, security & privacy icon, general: allow apps downloaded from Mac Store and Identified developers! Phew!

  • Can i use an ipad as an external moniter for a mac or pc? if so, then how?

    can i use an ipad as an external moniter for a mac or pc? if so, then how?

    Or you can use home sharing for free, but it will only allow you to play movies and music from itunes.
    Or you can use any remote desktop software
    https://www.google.com/webhp?hl=en&tab=ww#hl=en&safe=off&output=search&sclient=p sy-ab&q=remote+desktop+apps+from+itunes&oq=remote+desktop+apps+from+itunes&gs_l= hp.3...2689.2689.1.3799.1.1.0.0.0.0.105.105.0j1.1.0.les%3B..0.0...1c.1j2.siVpuwV plPU&bav=on.2,or.r_gc.r_pw.r_qf.&fp=29f1d2d1223cbee7&biw=1280&bih=636

  • How can i draw a straight line with a brush?

    i know the pencil tool can draw a straight line with anchor points. is there a setting for the pencil tool that can mimic a 30 point brush, low hardness (faded side to side) at about an 80 degree angle or is there a way to make a straight line with the brush tool using a mouse?
    i know this image is a bit blurry. what i want to do is replace the 2 white angled lines with the 30 point brush effect 230 pixels wide. the project on the left of the pic is a 2ft by 4ft canvas. any ideas? please help.

    Hello Mike, I wonder if you can help, no one else can. I asked this question on the forum in August Brush line fades on start with anchor points
    Only on Photoshop CC does this happen, drawing a diagonal line with shift key, instead of line starting dark & then fading out, it does the reverse, starts on nothing & then darkens towards anchor point. I am on trial versions & can't purchase until this is cleared up.

  • ADF Line Graph with dynamic series - can do ?

    I want to implement a drill-down from a high level line graph into a lower level line graph. The master graph may have 4 series in it, and each of these 4 series may have 6 - 8 different sub-series that need to be shown in the lower level graph (so up to 30 in all sub-series). Rather than create 4 of the lower level graphs, what I'd like to be able to do is create the lower level graph once using a VO which reads the master graph context. The definition of a graph model however in the ADF at first glance doesn't appear to cater for this. Have others done this ?
    Thinking that if I could:
    a) define the detail VO so that it used generic columns for the series amounts
    b) was able to override the series attribute name/label used for the legend etc. by way of code (backing bean?) for each series again based on context
    c) was able to optionally hide a series that was not needed (as defined by the generic detail VO) for a given master context
    ... then maybe I'd have a chance. But b) and c) don't look catered for.
    Anyone?
    Using 11.1.

    For the record, I gave this a go, and was able to get it working satisfactorily. There was no way as far as I could tell to set the visibility of a series. So essentially, what I've been able to do is set the series label to blank, set the line width to 1 (min, doesn't seem to honor 0), and the color to white to match the background of the chart ... for those series that are superfluous in a given chart render. It works fine except for the fact that if you've used the highlight rollover series effect, if you move the mouse over the legend area where the "hiding" series are, you get a bit of flashing on the legend entries that are displayed.
    Ideally, we'd have a way of actually taking these out entirely. If there's a way to do it, I'd be interested in hearing about it.
    Thanks.

  • Can not draw a solid line after drawing a dashed line

    I have been using a Graphics2D object in order to paint onto a buffered image and then transition that to a panel for viewing. The way the program works requires me to create the dashed line first through BasicStroke. After doing this I have tried to reset the setStroke with multiple new pens including BasicStroke(), BasicStroke(1.0f), and BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0.0f, new float[] {1,0}, 0.0f).
    Any ideas as to why I am still incapiable of drawing a solid line?

    Any ideas as to why I am still incapiable of drawing
    a solid line?Without seeing any code, I could guess, but my guess and a quarter won�t even buy you a newspaper around here now a days.
    Seriously though, you need to create a short, self contained, compilable example. Look here for an explanation on how to create this:
    http://www.physci.org/codes/sscce/

Maybe you are looking for