Bar and Pie chart  display with values

Hi All...
I want implement the my swing application Bar and Pie chart functionality with vales, If both are disply same veues.
Thanx to Advance
Arjun

www.jfree.org

Similar Messages

  • Plot line, bar and pie chart

    Anyone can let me know where can i learn or tutorial on how to plot line, bar and pie chart by using java2D... (no third-party software)....
    thanks in advance.

    Here's a pie chart app I made for an earlier question:
    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class PieChart {
      public static void main(String[] args) {
        int[] data = {
          18, 95, 102, 87
        PieCharter pie = new PieCharter();
        pie.enterData(data);
        JFrame f = new JFrame("Pie Chart");
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(pie);
        f.setSize(400,300);
        f.setLocation(300,300);
        f.setVisible(true);
    class PieCharter extends JPanel {
      int[] data, percents;
      int dataTotal;
      final int
        PAD = 25,
        R_PAD = 5;
      public PieCharter() {
        setBackground(Color.white);
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        Font font = new Font("lucida sans unicode", Font.PLAIN, 16);
        g2.setFont(font);
        FontRenderContext frc = g2.getFontRenderContext();
        int width = getWidth();
        int height = getHeight();
        int cx = width/2;
        int cy = height/2;
        int dia = (int)Math.min(width, height) - 2*PAD;
        g2.draw(new Ellipse2D.Double((width - dia)/2, (height - dia)/2, dia, dia));
        // draw zero datum
        double radians = 0;
        int x = cx + (int)((dia/2) * Math.cos(radians));
        int y = cy - (int)((dia/2) * Math.sin(radians));
        g2.draw(new Line2D.Double(cx, cy, x, y));
        String s;
        int dataWidth, dataHeight, deltaR, rXInc, rYInc;
        for(int i = 0; i < data.length; i++) {
          radians += 2*Math.PI * data/dataTotal;
    x = cx + (int)((dia/2) * Math.cos(radians));
    y = cy - (int)((dia/2) * Math.sin(radians));
    g2.draw(new Line2D.Double(cx, cy, x, y));
    s = String.valueOf(percents[i]) + "%";
    dataWidth = (int)font.getStringBounds(s, frc).getWidth();
    dataHeight = (int)font.getLineMetrics(s, frc).getAscent();
    deltaR = (int)Math.sqrt(dataWidth*dataWidth + dataHeight*dataHeight)/2 + R_PAD;
    rXInc = (int)(deltaR * Math.cos(radians));
    rYInc = (int)(deltaR * Math.sin(radians));
    x += rXInc;
    y -= rYInc;
    x -= dataWidth/2;
    y += dataHeight/2;
    g2.drawString(s, x, y);
    s = String.valueOf(data[i]);
    dataWidth = (int)font.getStringBounds(s, frc).getWidth();
    dataHeight = (int)font.getLineMetrics(s, frc).getAscent();
    x = cx + (int)((dia/4) * Math.cos(radians - 2*Math.PI * data[i]/(2*dataTotal)));
    y = cy - (int)((dia/4) * Math.sin(radians - 2*Math.PI * data[i]/(2*dataTotal)));
    x -= dataWidth/2;
    y += dataHeight/2;
    g2.drawString(s, x, y);
    private void prepareData() {
    for(int i = 0; i < data.length; i++)
    dataTotal += data[i];
    percents = new int[data.length];
    int dataPlus = 0;
    for(int i = 0; i < data.length; i++) {
    dataPlus += data[i];
    percents[i] = Math.round(100 * dataPlus/dataTotal);
    public void enterData(int[] data) {
    this.data = data;
    prepareData();
    repaint();

  • Drilldown bar and pie charts

    I am looking for charts with drilldown feature. I need to drilldown to another chart or a report.
    can you please point me to any articles doing this from scratch? I looked the sample packaged application with charts but it does not have drilldown links,.

    For all charts, the first column "link" is what you're interested in
    The syntax for the select statement of a chart is:
    SELECT link, label, value FROM   ...
    Where:
    link is a URL. This URL will be called if the user clicks on the that point on the resulting chart.
    http://docs.oracle.com/cd/E11882_01/appdev.112/e11945/bar_chart.htm#BEHGDBBE
    unfortunately no examples here, but check inline help for expected SQL in charts. Just define a URL for your drill down destination.

  • Bar Chart and Pie Chart

    Hi!
    In My application i want to create few bar and pie chart.
    If is there any code for generating bar and pie chart,
    pl send me.
    If third party software is available tell me the details of it.

    Sure, this functionality would be nice to have right
    out of the box, but when you think about it: should
    Sun be distributing a reporting SDK and promoting bad
    practices anyhow? Implementing your reporting in
    disparate and distributed manners is just plain messy
    and definitely translates to a bad practice. Turning
    to a centralized reporting mechanism, driven by a
    reporting server that can handle the needs for 80% of
    your requirements is a helluva lot more thoughtful and
    mindful than implementing separate mini reporting
    engines encapsulated within each and every application
    that you deploy.Elegantly stated! On a practical point, my company built an Enterprised based reporting solution on top of Java technology within the windows environment (please be kind). Specifically we used Java, ASP and Javascript (no VBScript), and delivered the information using the Microsoft IE 4 and 5.
    However, since Microsoft chose to elminate Java from it's current browser (IE6), we have to throw two years of coding away. We are now in the process of moving backward (technically speaking) to a desktop reporting model using Java (no browser technology) that accesses an Enterprise database, or embedded Java database. None of our customers are using Netscape, so that was never an option. Microsoft's and Sun's inablity to cooperate almost decimated our company's product line (and it still may).
    So I agree with you that an Enterprise server based reporting solution is the best architecture, and yet here I am running away from it after a two year struggle with competing standards. Sometimes the best solution loses for reasons that are simply not technical in nature.

  • Bar chart and pie chart in same screen at a time

    hi experts,
    I am trying to display the bar chart and pie chart in two separate containers in same screen .I wrote code for this in PBO of screen by using the function module  GFW_PRES_SHOW , but it is showing one chart at a time which is lastly executed in the PBO.
    I need to display two charts in two container at a time by calling the same function modules two times first time for bar chart second time for pie chart by changing the  parameter 
    presentation_type      = 1 for bar chart
    presentation_type      = 31 for pie chart.
    please help me in this regard asap.
    Thanks,
    K.Rajesh.

    Hi..
    Instead of using the FMs .. you should use the Object oriented approach for the same.
    Brief steps:
    You should have 2 control areas and 2 containers.
    Define different instances of 2 controls and attach them to the 2 containers.
    Call individual methods to display the controls in PBO.
    This should show both at a time. It is really simple.
    As an example you can go to SE38. From the (sap) menu go to Environment -> Examples -> Control Examples.
    Here you will see lot of examples.
    Regards,
    Varun.

  • Bar of Pie Chart and Age Population Chart ?

    Hi,
    I've got the last version of numbers and I'am asked for an assignement to do a Bar of Pie Chart and an Age Population Chart.
    I tried everything and searched on the internet but couldn't manage to find what I'm looking for.
    Could anyone explain how to do those ?
    Thanks

    Hi Vic,
    So "Bar of Pie" wasn't a typo! Looks like Jerry (and I) had a different interpretation of what you were trying to do.
    What you have there is two separate charts, using two separate (but related) sets of Data.
    The Pie chart uses the data listed on the table to the left below—individual numbers for the pets whose count is three or greater, and a grouped count for the others.
    The Stacked Bar chart uses a separate data set, listed on the second table—the individual counts for those pets represented fewer than three times each.
    Here's a variation.
    Charts are using the default colours as assigned by Numbers.
    See the Numbers '09 User Guide for details on reformatting the charts.
    Regards,
    Barry

  • Crating bar graphs and pie charts

    hi every body
    in my application there is a need of bar graphs and pie charts can any body help me how to draw them

    try http://www.jfree.org/jfreechart/

  • Pie chart  display error

    Hi
    I created pie chart using CFCHART tag. In the chart display,
    data values overlap on one another in the display. How to rectify
    this error.
    Kindly help me in this regard.
    Advance thanks

    I am using  ColdFusion Report Builder 9 to generate a PDF, so there is no code to provide, but here is an example of my data:
    fruit
    count
    apples
    112
    oranges
    304
    bananas
    0
    pears
    0
    grapes
    16
    strawberries
    80
    plums
    48
    pineapples
    32
    blueberries
    16
    raspberries
    32
    apricots
    256
    tangerines
    705
    cherries
    1
    peaches
    0
    With 'label column: fruit' and 'value column: count', when I select 'data label: pattern', for my pie chart, the labels overlap.

  • Cfchart yaxis scale is wrong when combining bar and line charts

    Hi, I am trying to combine a bar and line chart ti display data.  Everything looks good except that the yaxis scale is off.  I set the scaleMin to 0 but that doesn't help.  Below is my code, the custom XML style and a screen shot.  My ultimate goal is to get the yaxis to start at 0, not -1,000 as is currently the case.  I have combined this data with each set represented as bar charts and do not have this problem.  It must be the combo of bar and line charts together.  Any assistance is most appreciated.
    <cfchart title = "#variables.ReportName# Seedlings Ordered"
        style = "../SO_R_overall.xml"
        Format = "PNG"
        pieSliceStyle = "solid"
        show3D = "no"
        showBorder = "yes"
        showLegend = "yes"
        tipStyle = "MouseOver"
        chartHeight = "#DefinedChartHeight#"
         chartWidth = "#DefinedChartWidth#"
        font="arial"
        fontsize="12"
        fontBold="yes"
        scaleFrom="0">
        <cfchartseries
            type="bar"
            seriesLabel="Goal"
            query="getDivisionGoalsByDivision"
            valueColumn="divisiongoal" 
            itemColumn = "division"
            dataLabelStyle="Value"
            seriesColor="99CCFF"
            >           
        </cfchartseries>   
        <cfchartseries
            type="line"
            seriesLabel="Ordered"
            query="getQTYordered"
            valueColumn="QTYordered" 
            itemColumn = "division"
            dataLabelStyle="Value"
            seriesColor="green"
            >           
        </cfchartseries>
    </cfchart>
    ***************** Custom Chart Style called *****************
    <?xml version="1.0" encoding="UTF-8"?>
    <frameChart is3D="false">
            <frame xDepth="3" yDepth="3" outline="#333333" lightColor="white"
            leftAxisPlacement="Front" rightAxisPlacement="Front" stripColor="#CCCCCC"/>
            <xAxis scaleMin="0">
                <labelStyle isHideOverlapped="false" orientation="Horizontal"/>
                <titleStyle font="Arial-10-bold" isMultiline="true">Division</titleStyle>
            </xAxis>
            <yAxis scaleMin="0">
                <titleStyle font="Arial-10-bold"/>
                <dateTimeStyle majorUnit="Year" minorUnit="Month"/>
                <labelFormat style="Pattern" pattern="#,##0"/>
            </yAxis>        
            <dataLabels font="Arial-10" foreground="black" autoControl="true"/>
            <legend>
                   <![CDATA[ $(rowLabel)  ]]>   
              </legend>
            <decoration style="RoundShadow"/>
            <popup background="#C8FFFFFF" foreground="#333333"/>
            <paint paint="Plain"/>
            <insets left="5" top="5" right="5" bottom="5"/>
    </frameChart>

    I should have also said that I am using 8.0 Pro.
    I want to have the output similar to an e-book.
    The issue (Sept-October of 19xx)
    Then the individual pages (bookmarked)

  • ITS and Pie Charts

    We need to display charts (bar and pie) in a Web report/application running on SAP 4.6 and ITS (no WebAS, no BSP, no Portal). We need those charts to be real-time (not saved as a static image). The charts are user-specific. How would you do it?
    I have few ideas:
    1. Build bar charts with HTML tables or image blocks. No pie charts are possible.
    2. Generate PDFs using Sapscript/Smartforms and call PDF from the Web page. Questions: Can you have charts in this solution? Can you generate those PDFs on the fly?
    3. Use Adobe SVG for client side charts (SVG viewer is required)
    4. Use ActiveX or Java Applets
    Thank you for advice.

    Kai,
    It's a great suggestion to use IGS. But I am still not sure how this would work. Yes, I can use classes in the ABAP dialog program to call IGS. But how do I pass the images to ITS?
    I see few possible scenarios. Am I close?
    1. Responding to a call from ABAP, IGS is generating a GIF image and saves it in a location accessible from the Web (e.g. ITS WGate or IGS server). IGS is returning a reference for the image name/location to the ABAP dialog program. The reference is passed to ITS HTML template.
    2. Responding to a call from ABAP, IGS is returning a bitstream of the image back to the calling program. There should be a way to save it as GIF in ABAP and post the GIF image to WGate as a MIME object. Also, if I can save it a GIF in SAP, I can alternatively build a smartform that would use that newly generated GIF and convert the document into a PDF an then display the PDF with a text and charts on the Web.
    3. You call IGS directly from ITS, not the ABAP. You pass parameters to IGS telling what chart do you need and what data to use. IGS returns a GIF image back to ITS.
    Can please provide some clarity here.
    Thank you,
    Andre Polakoff

  • To print an Pie Chart image with more than 1 slice is not working

    Hi friends,
    I'm using a version 12.0.4 and when I try to generate an Pie Chart image with more than 1 slice using the function saveImage() it's not working. The image is only generate when its return is just 1 value (1 peace of pie).
    Anybody help me?
    Regards!

    It's not unique for your setup, but it also happens in 12.0.11, so it's a bug.  Looks like it is throwing a null pointer for some bizzare reason when generating the GIF output by the ImageStorageServlet (per the NW logs). 
    Your best bet would be to log a ticket so it can be patched.
    12.1.7 seems to work fine.
    Edited by: Michael Appleby on Nov 23, 2010 2:39 PM

  • ActiveX and pie chart problem

    I am trying to create a bar of pie chart in Excel 2003. I am able to insert my data and create the chart, but I need to set the "SplitValue" to 6. I was able to find the property for doing this but I get an error when I run the vi (see attached).  Any thoughts?
    Solved!
    Go to Solution.
    Attachments:
    ActiveX Error.PNG ‏45 KB

    I think your problem is that you don't have "Index" wired for the ChartGroups property. Thus, it may be returning a collection of chart groups, but you are typecasting it to a single chart group.

  • Combination stacked bar and line chart

    Post Author: jl07
    CA Forum: WebIntelligence Reporting
    Is there a way to create a combination stacked bar and line chart in Web Intelligence XI R2 reports?
    This can be done in Excel and I'm thinking that it should be possible in WebI reports too.
    Thanks

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    JL07:
    This capability is not currently available in WebI (though it is available in Crystal).  Last fall I submitted this as an enhancement request.  It is being tracked under the following enhancement request:  ADAPT00676609 u2013 for the stacked bar chart, line graph issue.

  • Copying Graphs and Pie Charts generated in Analysis View to Email item using Excel VBA Macro Code

    Hi
    I am currently working on an exce VBA macro code that would help me take snapshots of the Graphs and Pie charts generated in QC for a particular application and copy the same to an email item using excel VBA macro code.
    I was able to write the code to create an email item. But I have no clue of how i can take snapshot of the graphs in Analysis View using excel VBA
    Any help would be highly appreciated.
    Thanks in Advance
    Regards
    Amit

    useramit,
    You are in the consumer end products forum.  You will also want to ask your question over at the Enterprise Business Community.
    Click the plus sign (+) next to Discussion Boards to drop down all the options for servers, networking and any other professionally related problems.
    http://h30499.www3.hp.com/

  • Regarding Pie Chart Display

    Hi this is Prasad,
                             I want to display a pie chart with the associated results from the query template.It is working fine if I have any values in the database.I want to Display the Text 'No Data is Found' if i dont have data in the database.Is it possible to display like this.Can anyone help on this.
    Thanks,
    Prasad.

    The 'No Data Available' message only displays when a fatal error occurs but not 0 rows (not desirable in this case).  How about adding the UpdateEvent in your PARAM tags and in the corresponding function doing something like this:
    var myApplet = document.APPLETNAME;
    var myChart = myApplet.getChartObject();
    if (parseInt(myChart.getNumberOfDataPoints(1)) > 0) {
       myChart.setTitle("You have pie slices");
    } else {
       myChart.setTitle("No Records Found");
    myApplet.setUpdateEventEnabled(false);
    myApplet.updateChart(false);
    myApplet.setUpdateEventEnabled(true);
    This should allow you to use standard stuff and not incorporate monkey business with hidden/visible divs and/or additional applets just for running separate queries.

Maybe you are looking for

  • Full of features: Lumia Denim Update

    Hey, Lumia Denim update has started rolling out to selected devices and markets, and will continue to rollout in several waves. A wider rollout of Lumia Denim to all Lumia devices running Windows Phone 8.1, is expected to begin in early January, foll

  • Audio out from FCE HD to USB audio iMic

    I use my Sys Prefs to set my audio out to a USB audio device (iMic), and all of my audio goes there EXCEPT for FCE HD 3.0 which insists on using the Mac Line Out... Any way to change this?

  • Script Alert "You should only run scripts from a trusted source."

    I created a small javascript which opens Photoshop and resizes some images. I want to be able to double-click the .JSX file from Windows Explorer, and have Photoshop execute the script. Likewise, I want to be able to run the .JSX file from the comman

  • PLS-00307: too many declarations of ' F ' match this call

    Hi friends, I have created a package(OL) using procedure overloading. Package Specification: CREATE OR REPLACE package SDR_SPRUSR.ol as procedure f (p number); procedure f (p varchar2); procedure f (p varchar2,q number); procedure f (p number,q varch

  • I had a problem with some midea downloaded by orbit not played by vlc

    ''some you tube downloaded by orbit, vlc media player cannot play. but if I use ilivid downloader vlc does it . its a big trouble beacause of the getit by orbit its iasy to use. its a trouble opening another downloader just to download the same video