Generating JFreeChart Bar chart in jsp

Hi Everyone,
I have never worked with charts earlier. I created one demo for generating a bar chart using a java class. I am using awt classes here. Chart was rendered successfully on running this java class. My problem is i want to integrate this class with a JSP, by involving servlets. I tried to do it many a times now but yet not successfull.
My requirement is, on the hit of 'generate chart' in one jsp, bar chart should be rendered.
Can somebody plz help???
Thanks in advance

Has no update on the problem mentioned. However, you can try elegantj charts. It creates customized, dynamic charts in few minutes.
Link: www.elegantjcharts.com

Similar Messages

  • Bar chart in jsp

    Hi,
    I want to develop bar charts using JSP.
    Can you please tell me the simplest way so that I can develop bar charts.
    Thanks

    If you want, you could draw the charts using the HTML5 canvas tag with some JavaScript to draw the chart on the canvas. Though if I remember correctly, to get this to work in IE6, you need to include the excanvas script on your page; not sure about IE7 and IE8.
    I make no claims as to whether this is a good approach for what you are doing, but it's another option.

  • How to display bar charts in jsp

    I need bar charts for web application.
    I search alot but I didn't find any solution.
    From where I can find the content for same?

    You're right I did read about Cewolf. Here's how
    You can simply define a chart by including a chart tag into your JSP like this:
    <cewolf:chart
    id="XYChart"
    type="xy"
    title="XYChart"
    <cewolf:gradient>
    <cewolf:point x="0" y="0" color="#FFFFFF"/>
    <cewolf:point x="0" y="300" color="#C8C8C8"/>
    </cewolf:gradient>
    <cewolf:data>
    <cewolf:producer id="xyData"/>
    </cewolf:data>
    </cewolf:chart>
    <cewolf:img chartid="XYChart" renderer="cewolf" width="400" height="300"/>
    keep coding..
    Ciao.
    Div

  • Changing fill type in JFreeChart Bar chart

    Does any one knows how to change the fill styles of a Bar in the Bar chart using JFreeChart ?
    Currently the fill type is Plain,But I want to use the crosses (*) and dots (.) as fill type.
    Thanks in advance
    Sampath

    Is there no answer to my question?

  • Creating Bar Charts using Java and Display in jsp

    Hi..Is it possible to create a servlet that processes data from database and display the values as Bar Charts in jsp pages. If its possible, is there any examples on how to achieve that?

    I don't get it. You already know what needs to be done to solve your problem, the only thing you are missing is the HOW. That's the easy part, if only you break down what you have to know:
    1) how do I show an image on a website (this is a basic HTML question actually, not actually related to servlets/JSPs directly)
    2) how do I fetch the path from a database (JDBC question) so that I can use this path to link to my image on disc
    So what is preventing you from figuring out how to do these two simple tasks? Some clever google searches should give you all the information you need in no time.
    by the way: are you sure that you need to store these paths in the database? Is this part of some file upload component?

  • Line chart in jsp

    Hai,
    i want to generate a line chart in jsp. can you plz help on this.
    plz dont suggest me any third party tools.
    Thanks in advance.

    Hai,Hie
    i want to generate a line chart in jsp. can you plz
    lz help on this.Yes.
    plz dont suggest me any third party tools.I can and I will: JFreeChart ;-P
    You don't want to use it, that's your perogative, but you'd have to write something yourself. Why would you want to do that when you can just use something that exists? Do you build your own cars from scratch?
    Thanks in advance.you're welcome in retrospect

  • Bar chart in MSword from SAP

    Hello,
    From R3 we have to launch MSWord, open a new file and generate a bar chart therein with R3 data. Any ideas of how we can get this graphic generated?
    Thanks in advance,

    Hi
    Refer to this beautiful contribution by Serdar &#350;im&#351;ekler
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/204d1bb8-489d-2910-d0b5-cdddb3227820">An Easy Reference for OLE Automation</a>
    Regards
    Raj

  • Problems with date in stacked bar charts

    I am having a lot of problems trying to generate stacked bar charts where one of the fields is a date. Using the chart generator in word, the stacked bar charts work perfectly if I use (for example) Labels=Country, Series=Product, Values=Quantity(Sum) . The correct quantities are shown.
    However if I change Country to Expiry (date), the quantities are all wrong ? Such that I have no idea how it is obtaining the values.
    The generated code is :
    <Graph depthAngle="50" depthRadius="8" pieDepth="30" pieTilt="20"
           seriesEffect="SE_AUTO_GRADIENT" graphType="BAR_VERT_STACK">
      <Title text="" visible="true" horizontalAlignment="CENTER"/>
      <LocalGridData colCount="{count(xdoxslt:group(.//G_MED,  'EXPIRY'))}"
                     rowCount="{count(xdoxslt:group(.//G_MED,  'PRODUCT'))}">
        <RowLabels>
          <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              select=".//G_MED" group-by="PRODUCT">
            <Label>
              <xsl:value-of select="current-group()/PRODUCT"/>
            </Label>
          </xsl:for-each-group>
        </RowLabels>
        <ColLabels>
          <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              select=".//G_MED" group-by="EXPIRY">
            <Label>
              <xsl:value-of select="current-group()/EXPIRY"/>
            </Label>
          </xsl:for-each-group>
        </ColLabels>
        <DataValues>
          <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              select=".//G_MED" group-by="PRODUCT">
            <RowData>
              <xsl:for-each-group select="current-group()" group-by="EXPIRY">
                <Cell>
                  <xsl:value-of select="sum(current-group()/QUANTITY)"/>
                </Cell>
              </xsl:for-each-group>
            </RowData>
          </xsl:for-each-group>
        </DataValues>
      </LocalGridData>
    </Graph>Any help would be greatly appreciated !
    Cheers,
    Brent

    Thank you all for your replies so far:
    @Alex: You are right, using your short script in sqlplus gives me also 2009 as result
    So, I am now posting the essential excerpts of the procedure because the whole one is to large:
    function insert_szrl (my_fremd_name varchar, my_elementadresse varchar,
    my_zeitstempel varchar, my_wert float,
    my_status varchar, my_zyklus varchar,
    my_offset integer,
    my_quelle varchar, my_nzm_daten integer) return integer is
    begin
    my_date := to_date (substr (my_zeitstempel, 1, 10), 'dd.mm.yyyy') + my_tageswechsel +1/24;
    if my_zyklus = 'mm' then
    my_zeitstempeldate := add_months(to_date(last_day(to_date(my_date, 'dd.mm.yyyy')), 'dd.mm.yyyy'),-1) +1 + (my_tageswechsel+1/24);
    my_days := to_date(last_day(to_date(my_date, 'dd.mm.yyyy')), 'dd.mm.yyyy') - add_months(to_date(last_day(to_date(my_date, 'dd.mm.yyyy')), 'dd.mm.yyyy'),-1);
    my_year := to_number(to_char(to_date(my_date,'dd.mm.yyyy'), 'yyyy'));
    ptime.umschalttage_tuned (my_year, my_ws, my_sw);
    end if;
    While debugging the complete procedure I see since the start only a date which looks like '01.04.2009 07:00:00'
    Edited by: user10994305 on 19.05.2009 15:58
    Edited by: user10994305 on 19.05.2009 15:58

  • Anychart bar charts generated for each row of a report

    I am looking for ideas on, or existing examples of how the above requirement could be implemented in Apex 3.2.1.
    My initial thoughts are to:
    - use a pipeline table function as the report region source
    - generate the JavaScript for creating bar charts with one series of 48 points, as a column returned by the table function.
    The source data will be unlikely to be more than 15-20 records pulled from a well indexed underlying record set of several million records.
    My worry is that this may not be a particularly responsive solution and I would like to know if anyone can validate or improve on my approach?
    Cheers
    FunkyMonkey

    You would need to define a separate column to hold the required output for each possible parameter value in the first column.
    Each column would need to be conditional, where the condition is based upon the value in the first column, which you can reference using #column_name# syntax.
    Try that...
    CS

  • How to Generate Chart (line chart, bar chart)!

    I want to generate Graphic Chart using Java,(e.g. line chart, bar chart).
    Is any Class can easy to generate Chart??
    thanks!

    petes1234 wrote:
    meacod wrote:
    Dimpu wrote:
    i need the source code how to generate the graphs using the Java
    Give me teh codes?
    And yes, this thread is old.Also note how the poster here politely requests help along with the use of the word "please". Very instructive. He'll get far here.Indeed, you are wise in the ways of the fool **bows politely**

  • Jfreecharts- stacked bar chart query

    Hi all,
    I am using JfreeCharts for building an application which reports the usage metrics of two servers over a period of time.
    Each server does a number of operations which can be broadly grouped under 6 heads and these broad divisions are being used for reporting.
    When I use Stacked bar chart for creating the bar graph image, the order in which the bars get displayed is wierd. The dates start from 25th Feb to 28th Feb. Hence I am expecting the bars for the data from the dates 25th... 26th...27th and 28th; but the bars that come up are the 25th ... 26th... 28th and the 27th... Is there a group utility which can be used to order the grouping??? I am posting my code used for grouping the data.
    map = new KeyToGroupMap("G1");
    renderer = new GroupedStackedBarRenderer();
    for (int i = 0; i < (metricsList2[0].size()); i++)
    map.mapKeyToGroup(((XxccrCropsdbColourgrp)(metricsList2[0]).get(i)).getAttributeName1(), ((XxccrCropsdbColourgrp) (metricsList2[0]).get(i)).getAttributeName2());
    renderer.setSeriesToGroupMap(map);
    From the database the groups being sent are G1,G2,G3 and G4 which correspond to the 4 dates mentioned above.
    Help will be highly appreciated....
    Madhu

    The actual problem is when I am adding data to the map for the grouping , the data is getting jumbled up... The groups which are added to the map are not added in order.

  • How do i Create charts using JSP/Servlet & Database

    I have to create charts which shows the graph of stock exchange.
    i have a database that keeps the data for creating charts.
    But i did not know how to create charts using jsp-servlet.
    Any Example might help me to go forward.
    Any help will be really appreciated.
    Please Advice me.

    JFreeChart - You can generate the charts then convert them to image formats (PNG and JPEG) all using the JFreeChart API
    http://www.jfree.org/jfreechart/

  • Help!! how to use ms office chart in jsp

    I want to use ms office chart in jsp for getting real time statistical chart.
    but I don't know how to satart.
    give me an example please,(including the code is better)
    thanks

    Do you need MS Office? Try Cewolf, a tag library for JFreeChart:
    http://cewolf.sourceforge.net/
    Regards,
    Dave Gilbert
    JFreeChart Project Leader

  • Stacked bar chart with single group

    Post Author: rt50896
    CA Forum: Charts and Graphs
    Dear all,   I have a question about stacked bar chart with one group value(normally more than one group value is ok)   ex. YYYYMM      PRODUCT    AMT        -
            200601          ABC            1000        200602          ABC              300        200603          ABC              500       .....   the data collection is as above,then chart display: x-axis as YYYYMM,y-axis as PRODUCT...   but why this case the bar chart color not the same for each YYYYMM? and legend not display one PRODUCT as ABC only?   the bar chart display like this:   http://tkfiles.storage.live.com/y1po30C7CH6eW9phoLAXH89MBGwFLYdEZ3kOMQXUQzDzwM-VNnffibEwqPI8TIUNBm1f7uKTjnkaOI   ps. crystal report version is 8.5Regina

    Thanks, Jeff. I did try this but for whatever reason it doesn't make a difference. I think it is because if there's no data for a given series for a certain week, there is no entry in the data set that is sent to AnyChart.
    I was able to get around the issue by "filling in" the missing weeks from each data series. To generate the list of "Week Of" dates for a given date range, I used this code:
    select
         trunc (each_day) as week_of,
         0 as effort
    from (
         select
              (to_date(:p920_start_date,:app_date_format) + 2 - to_char(to_date(:p920_start_date,:app_date_format),'D') - 1) + level each_day
         from dual
         connect by level <= to_date(:p920_end_date,:app_date_format) - to_date(:p920_start_date,:app_date_format) + 1
    where
         to_char (each_day, 'D') = '2'This creates an effort entry of 0 for each week within the date range; I use the Monday date of a week as the "Week Of" date. I then union this with my actual data and summarize by week and viola, I get the weeks in order. This also has the benefit of showing a week for which there are no entries in any of the three series.
    Thanks for taking a look at this.
    Mike

  • Stacked Bar Chart with Multiple Series Sort Question

    Hi,
    Apex version 4.1.1
    I have a stacked bar chart with three separate series, one showing customer effort, another showing project effort and the third showing other effort, summarized by calendar week. The x-axis of the chart is the calendar "week of" date, and the y-axis has a bar for each of the three series. Not every type of effort occurs every week.
    When AnyChart renders the chart, the order of entries on the x-axis seems to be dependent both on which series are present in a given week as well as the "week of" date. Weeks with all three series sort in order by calendar date, followed by weeks where just the 2nd & 3rd series are present, followed by weeks where just the 3rd series is present. See this [url http://tinypic.com/r/b9zdt/6] picture of the chart  noting the "week of" dates. Note that the months go Sep-Oct-Nov-Aug-Oct.
    Is there a way to force AnyChart to sort the x-axis in chronological order regardless of whether there is data for all three series for a given week? I have looked through the AnyChart XML reference but cannot find a way to do this.
    Incidentally, I can solve the sorting problem by combining all three series into a single query:
    select
      null as link,
      week_of as label,
      sum(customer_effort) as "Customer Effort",
      sum(project_effort) as "Project Effort",
      sum(other_effort) as "Training, Admin and Other Effort"
    from ...But if I do this, I cannot figure out how to have each bar on a given week link to a different detail page, e.g., if I click on a bar representing customer effort I want to link to one page, but if I click on a bar representing project effort, I want to link to a different page. I have had a look at the [url http://apex.oracle.com/pls/apex/f?p=36648:59:1570983160946101::NO:::] chart examples  posted on apex.oracle.com, but cannot figure out how to apply to multiple series in a single query.
    Thanks,
    Mike

    Thanks, Jeff. I did try this but for whatever reason it doesn't make a difference. I think it is because if there's no data for a given series for a certain week, there is no entry in the data set that is sent to AnyChart.
    I was able to get around the issue by "filling in" the missing weeks from each data series. To generate the list of "Week Of" dates for a given date range, I used this code:
    select
         trunc (each_day) as week_of,
         0 as effort
    from (
         select
              (to_date(:p920_start_date,:app_date_format) + 2 - to_char(to_date(:p920_start_date,:app_date_format),'D') - 1) + level each_day
         from dual
         connect by level <= to_date(:p920_end_date,:app_date_format) - to_date(:p920_start_date,:app_date_format) + 1
    where
         to_char (each_day, 'D') = '2'This creates an effort entry of 0 for each week within the date range; I use the Monday date of a week as the "Week Of" date. I then union this with my actual data and summarize by week and viola, I get the weeks in order. This also has the benefit of showing a week for which there are no entries in any of the three series.
    Thanks for taking a look at this.
    Mike

Maybe you are looking for

  • Media Encoder CC audio question

    I have a ProRes standard def file (.mov) with 2 stereo pairs of audio.  I am trying to export it to a DVCPROHD Quicktime (.mov) with the same audio configuration.  This seems to be impossible.  My audio export options as a Quicktime file with this co

  • WSUS errors - no longer able to sync with MS

    Our environment is SCCM 2012 R2 CU1.  We have a primary site server with local SQL (2012) on a Windows 2012 R2 server.  We also have WSUS and the SUP on this server as well. Permissions were changed on the C:\Program Files\Update Services folder.  Tr

  • Do I 'need' an audio interface on modern Macs?

    Hi there Don't think I've posted on here in nearly 10 years but I'd be really glad of some help. I currently record on a 2003 eMac running 10.3.9 using Garageband 06. I record directly into the audio in via a tube preamp. I am considering finally upg

  • Transferring music from iPhone and iPad to iMac

    Just bought a new iMac. How do I get my music converted from old records and cassettes onto it from my iPhone and iPad?

  • Form Builder - What is it and How to use it  ?

    Hi All . If you are familiar with Form Builder , please refer me any document or links . I have heard about form builder but i did not find any documents on it . i am using ECM 11g . Thanks, Amitava Email : [email protected]