Creating pie chart diagram in java  and converting into BMP file

hi all ,
my req. is to create draw a pie chart diagram and store
the picture in BMP. it is Possible. if so how ?
cheers
senthil

Hi Senthil,
This response is a bit late but I hope it can help in some way.  Your requirement (to create draw a pie chart diagram and store the picture in BMP) is possible and actually quite easy if you don't mind using two open source libraries.  In his previous response to this thread, Detlev mentioned JFreeChart for as a solution for charting however he also mentioned that it lacks support for BMP.  Although this is true, you can use the JFreeChart library (http://www.jfree.org/jfreechart/index.html) in conjunction with an imaging library to meet your requirement.  I have used JFreeChart on multiple projects and I highly recommend it.  For the imaging library you have many options, however the only one I have used is The Java Imaging Utilities (JIU - http://jiu.sourceforge.net/).  Using these two class libraries, you can generate your pie chart and save it to a BMP file with the following block of code:
     try
         JFreeChart chart = this.createChart();
         FileOutputStream streamOut = new FileOutputStream("your/files/path/BMPfile.bmp");
         BufferedImage image = chart.createBufferedImage(600, 300);
         if(image == null)
              reportError("Chart Image is NULL!!!!!!!!");
              return(false);
         RGB24Image rgbImage = ImageCreator.convertImageToRGB24Image(image);
         Codec codec = new BMPCodec();
         codec.setImage(rgbImage);
         codec.setOutputStream(streamOut);
         codec.process();
         codec.close();
         streamOut.flush();
         streamOut.close();
    }catch(IOException ioExcept)
         // throw or handle IOException...
         return(false);
    }catch(OperationFailedException opFailedExcept)
         // throw or handle OperationFailedException...
         return(false);
The first line inside the catch block calls a helper method that should create the actual chart using the JFreeChart library.  Once you have your chart instance (all chart types are represented using the JFreeChart class), you can then retrieve a BufferedImage of the chart (JFreeChart.createBufferedImage(int width, int height);).  In our situation, the BufferedImage class will act as an "intermediate" class, for both libraries (the charting and imaging) can make sense of BufferedImages.  The rest of the code deals with storing the generated chart (the BufferedImage) as a BMP file to disk.  The RGB24Image, Codec, BMPCodec, CodecMode, and OperationFailedException classes are all part of the JIU library.  Also, note that the storage  source is not solely limited to a File on disk; the Codec.setOutputStream(OutputStream os) method will accept any subclass of OutputStream.  This implies that not only can you store to the actual App Server disk (where your app is running) but also to sources such as Knowledge Management (KM) resources or even directly to the clients browser (in the case of an iView). 
Once again, sorry for the late response and let me know if you have any questions regarding the code above. 
Regards,
Michael Portner

Similar Messages

  • Problem creating pie-chart

    Post Author: ujain82
    CA Forum: Desktop Intelligence Reporting
    Hello,      I am using BO 6.1
    I am having trouble creating pie chart. I am calculating different count values from different data providers. Now I need to create a pie chart showing the proportion for each count as I can find the percentage of count.
    My scenario(task):I need count on persons depending on searching on complaint text. So for each search I have a data providers. Like this I am searching for 8 criteria. So I have different data providers for each search. I get person counts from each criteria.
    Now I want to show it in a pie chart. But I could not make it done.Does anyone faced a similar problem? How do I solve my problem?
    Any comments?

    Attached is part of the sub-vi where I am having the problem. I tell Excel which cells to use for the pie chart. If I use "Source 1" (8 cells) the pie chart is created successfully. If I use "Source 2" (14 cells) the pie chart only uses the first cell. I can go to the Excel file and select all 14 cells manually and the pie chart displays correctly. I also tried 9 cells with no luck, it seems that 8 cells are the limit. I am trying to find what is causing the limitation. I have also attached the sub-vi. 
    Attachments:
    Pie chart block diagram.JPG ‏61 KB
    M-51539-001 Create Pie Chart.vi ‏108 KB

  • How to create pie charts in BIP 11g using .XSL?

    Hi,
    Requirement is to create a multi sheet excel output. Because of this. I am going the XSL way and not RTF.
    Now, I need to create pie charts using XSL as part of the output.
    * Is it possible to create pie charts in .XSL? If so, any pointers?
    * I tried some SVG coding by referencing the below link but not result:
    <http://www.svgopen.org/2003/papers/CreatingSVGPieChartsThroughWebService/index.html#S2.1>
    * I also created the required chart in RTF and tried to use the underlying XSL-FO code. Not sure if I have used it in the right way. Has anyone tried doing that?
    If you have any info, please share.
    Thanks,
    Divya

    One more point : I came across a link which talks about Bar charts using XSLT :
    http://www.roguewave.com/Portals/0/products/imsl-numerical-libraries/java-library/docs/5.0.1/chartpg/xml_xslt.html
    so, I am hoping, there is a way to do pie charts as well?
    Thanks,
    Divya

  • Is there any Adobe product that can help me create crochet charts/diagrams?

    Is there any Adobe product that can help me create crochet charts/diagrams?

    I am not all that familar with Crochet, other than what my sisters and mother use to do 20+ years ago.
    What you could do is turn on the background grid and snap to grid. Find a grid size that will work for you (may be easier if you place an image for reference) Then with the pen tool you can create lines that follow the grid (assuming you want to print the grid)
    With the image placed you could add text for what color or change the lines color and print it out
    Anyway just an idea, it kind of hard to think with out seeing one. But then again if you have book of patterns you could use that as the reference. Just keep in mind that whats in that book is for your own use only, it can not be shared or sold to the public. As the book is protected by copyright laws. Any original work you do that is not in that book, is up to you on what you want to do with it.

  • Trouble creating pie-chart

    Post Author: ujain82
    CA Forum: WebIntelligence Reporting
    Hello,      I am having trouble creating pie chart. I am calculating different count values from different data providers. Now I need to create a pie chart showing the proportion for each count as I can find the percentage of count.
    My scenario(task):I need count on persons depending on searching on complaint text. So for each search I have a data providers. Like this I am searching for 8 criteria. So I have different data providers for each search. I get person counts from each criteria.
    Now I want to show it in a pie chart. But I could not make it done.Does anyone faced a similar problem? How do I solve my problem?
    Any comments?

    Post Author: Chris Chen
    CA Forum: WebIntelligence Reporting
    Hi ujain82,
    Because you have some data provider,so some metric may have no conjunction,i suggest that you creat variables to reuse them.

  • Pie chart with two measures and date dimension navigation not working

    Hi Experts,
    Pie chart with two measures and date dimension navigation not working. Any help is appreciated.
    Thanks
    V

    Hi Deepak,
    I had time dimension in the RPD.
    I have stacked bar chart with same time dim like year & month in the report. when I go to legand and set navigation it is working fine. But not with pie chart.
    I am not not sure what is the problem. When I click on Pie chart it is not navigating to the target report. Can it be any other issues..???

  • Create pie chart in jsp

    how to create pie chart in jsp based on sql server 2000 database
    please give example or code with explanation

    http://sourceforge.net/projects/jfreechart
    - Saish

  • Record Sound From a Microphone and convert it text file using jave applicat

    Hi, I want source code for recording sound from a microphone which is connected to a sound card fixed in my machine,and convert that sound file to a text file , so that i can compare that text later with the command which i have stored already in my computer.How to do this in Java ? If any one could help me in solving this problem, it would be very helpful for me !

    Have you looked into the JSAPI?
    http://www.esus.com/docs/GetQuestionPage.jsp?uid=1471

  • PSE12: How to create gridlines on the image page then converted into a pdf? [was: N276]

    I want to download an image from the internet, for example, batman, create gridlines on the image page then converted into a pdf.  where on adobe photo shop element 12 can I do this.

    On way is to define a pattern:
    https://forums.adobe.com/thread/875370?tstart=0
    Another way is this neat free grid generator filter:
    http://www.richardrosenman.com/software/downloads/
    1. Add a blank layer above the picture layer, fill with white, and set Blend Mode to Multiply.
    2. Apply the filter. There are many options. Here I chose black lines on white background with 20 square boxes across. Note that the background should be pure white (255,255,255) so as not to change the original picture.
    You can also find lots of grid images on the Internet, for example a Google search on "grid" or "grid paper". As in the previous method, add this image above your picture and set its Blend Mode to Multiply.  Again, the background should be pure white.

  • How to parse XSD in ABAP and convert into models

    Hello Experts,
    I have a scenario where XSD is available in ABAP and want to parse it and convert into object such as XSD Schema, XSD Complext Type, XSD Simple Type etc... (that is create a DOM model of XSD)
    Are there some standard APIs which can provide this feature?
    Thanks & Regards,
    Arpit

    Hi Arpit,
    If my understanding of your requirement is correct then the class - CL_FP_XSD_FOR_ABAPTYPES, should help you out.
    Let me know how this works out, or i am completely off your requirement.
    Regards,
    Chen

  • Clone Production Database and Convert into Read Write Mode

    Hi,
    Please help me for below question...
    How to Create Test Database from Production Database without transporting backup of Production Database to Test Database and the Test Database should be in different directory structure and converting into read write mode?
    Please find me a solution as early as possible...
    Thanks & Regards
    Akhil

    if you don't need to move backup from prod to dev you need to create rman catalog and have access on it from dev server , after that you will be able to duplicate your prod to dev without moving backup and database will be in Read write by default .

  • How to retrieve data from catsdb table and convert into xml using BAPI

    How to retrieve data from catsdb table and convert into xml using BAPI
    Points will be rewarded,
    Thank you,
    Regards,
    Jagrut BharatKumar Shukla

    Hi,
    This is not your requirment but u can try this :
    CREATE OR REPLACE DIRECTORY text_file AS 'D:\TEXT_FILE\';
    GRANT READ ON DIRECTORY text_file TO fah;
    GRANT WRITE ON DIRECTORY text_file TO fah;
    DROP TABLE load_a;
    CREATE TABLE load_a
    (a1 varchar2(20),
    a2 varchar2(200))
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY text_file
    ACCESS PARAMETERS
    (FIELDS TERMINATED BY ','
    LOCATION ('data.txt')
    select * from load_a;
    CREATE TABLE A AS select * from load_a;
    SELECT * FROM A
    Regards
    Faheem Latif

  • Is it wise to keep the Nikon camera files "DSC's"  after downloading them and converting to DNG files via Adobe converter for lightroom use. In other words do the DNG files have all the raw data I would ever need in processing or should I save the camera'

    Is it wise to keep the Nikon camera files "DSC's"  after downloading them and converting to DNG files via Adobe converter for lightroom use. In other words do the DNG files have all the raw data I would ever need in processing or should I save the camera's DSC files?

    DNG files do not contain some metadata supplied by the camera, which can be used by the manufacturer's software. Thus, if you don't keep the original Raw photo, you will lose this information.
    If your 1000% sure you're never going to use the manufacturer's software, then this isn't a problem. But who can be sure what software you will be using 10 years from now?

  • How to create a table with datatype blob and insert a pdf file (ravi)

    how to create a table with datatype blob and insert a pdf file,
    give me the explain asap
    1.create the table?
    2.insert the pdffiles into tables?
    3.how to view the files?
    Thanks & Regards
    ravikumar.k
    Edited by: 895044 on Dec 5, 2011 2:55 AM

    895044 wrote:
    how to create a table with datatype blob and insert a pdf file,
    give me the explain asapPerhaps you should read...
    {message:id=9360002}
    especially point 2.
    We're not just sitting here waiting to answer your question as quickly as possible for you.

  • It is possible to ckeck-out a drawing and converting into bitmap

    HI,
    it is possible to
    check out a drawing from dms and convert into bitmap image
    and upload the image in se78

    Hi Rani,
    from DMS point of view it is possible to convert an original to BMP format. Therefore you have to set up a conversion routine in customizing and link a converter to your system, which is able to convert the original in the desired format.
    First of all the converter has to be linked to the R/3 System by RFC connection in SM59. Please see
    the attached document which contains all necessary information about setting up the converter and conversion.
    Further customizing settings can be found in transaction SPRO under:
    Cross-Application Components
      > Document Management
          > Conversion of Original Application Files
    The conversion could be defined to be started in transaction CONV02, with status change or by using workflows. For using the conversion within workflows please see SAP note 687199 for further information.
    Best regards,
    Christoph
    P.S.: Please reward points for usefull information.

Maybe you are looking for