Combined Chart with Jfreechart

I am using jfreechart-0.9.3 for drawing 4 charts on the same plot. I want to have two of them horizontally and two vertically next to eachother. When I tried to imitate the code of Demo combined charts by jfreechart (which only draws two charts next to eachother horizontally), I can't do that vertically. Because there is no
com.jrefinery.chart.HorizontalXYBarRenderer and com.jrefinery.chart.VerticalDateAxis classes. How can I make it vertically? Is there any other classes which could be usefull in jfreechart?
The code of two horizontal charts looks like this:
import com.jrefinery.chart.JFreeChart;
import com.jrefinery.chart.ChartPanel;
import com.jrefinery.chart.XYPlot;
import com.jrefinery.chart.XYItemRenderer;
import com.jrefinery.chart.VerticalXYBarRenderer;
import com.jrefinery.chart.HorizontalDateAxis;
import com.jrefinery.chart.VerticalNumberAxis;
import com.jrefinery.chart.CombinedXYPlot;
import com.jrefinery.chart.tooltips.TimeSeriesToolTipGenerator;
import com.jrefinery.data.BasicTimeSeries;
import com.jrefinery.data.TimeSeriesCollection;
import com.jrefinery.data.Day;
import com.jrefinery.data.XYDataset;
import com.jrefinery.data.IntervalXYDataset;
import com.jrefinery.date.SerialDate;
import com.jrefinery.ui.ApplicationFrame;
import com.jrefinery.ui.RefineryUtilities;
* A demonstration application showing a time series chart overlaid with a vertical XY bar chart.
public class CombinedXYPlotDemo extends ApplicationFrame {
* Constructs a new demonstration application.
public CombinedXYPlotDemo(String title) {
super(title);
JFreeChart chart = createCombinedChart();
ChartPanel panel = new ChartPanel(chart, true, true, true, false, true);
panel.setPreferredSize(new java.awt.Dimension(500, 270));
this.setContentPane(panel);
* Creates a combined XYPlot chart.
private JFreeChart createCombinedChart() {
// create a parent plot...
CombinedXYPlot plot = new CombinedXYPlot(new VerticalNumberAxis("Value"),
CombinedXYPlot.HORIZONTAL);
// create subplot 1...
IntervalXYDataset data1 = this.createDataset1();
XYItemRenderer renderer1 = new VerticalXYBarRenderer(0.20);
renderer1.setToolTipGenerator(new TimeSeriesToolTipGenerator("d-MMM-yyyy", "0,000.0"));
XYPlot subplot1 = new XYPlot(data1, new HorizontalDateAxis("Date"), null, renderer1);
// create subplot 2...
XYDataset data2 = this.createDataset2();
XYPlot subplot2 = new XYPlot(data2, new HorizontalDateAxis("Date"), null);
XYItemRenderer renderer2 = subplot2.getRenderer();
renderer2.setToolTipGenerator(new TimeSeriesToolTipGenerator("d-MMM-yyyy", "0,000.0"));
// add the subplots...
plot.add(subplot1, 1);
plot.add(subplot2, 1);
// return a new chart containing the overlaid plot...
return new JFreeChart("Horizontal Combined Plot",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
* Creates a sample dataset.
private IntervalXYDataset createDataset1() {
// create dataset 1...
BasicTimeSeries series1 = new BasicTimeSeries("Series 1", Day.class);
series1.add(new Day(1, SerialDate.MARCH, 2002), 12353.3);
series1.add(new Day(2, SerialDate.MARCH, 2002), 13734.4);
series1.add(new Day(3, SerialDate.MARCH, 2002), 14525.3);
series1.add(new Day(4, SerialDate.MARCH, 2002), 13984.3);
series1.add(new Day(5, SerialDate.MARCH, 2002), 12999.4);
series1.add(new Day(6, SerialDate.MARCH, 2002), 14274.3);
series1.add(new Day(7, SerialDate.MARCH, 2002), 15943.5);
series1.add(new Day(8, SerialDate.MARCH, 2002), 14845.3);
series1.add(new Day(9, SerialDate.MARCH, 2002), 14645.4);
series1.add(new Day(10, SerialDate.MARCH, 2002), 16234.6);
series1.add(new Day(11, SerialDate.MARCH, 2002), 17232.3);
series1.add(new Day(12, SerialDate.MARCH, 2002), 14232.2);
series1.add(new Day(13, SerialDate.MARCH, 2002), 13102.2);
series1.add(new Day(14, SerialDate.MARCH, 2002), 14230.2);
series1.add(new Day(15, SerialDate.MARCH, 2002), 11235.2);
return new TimeSeriesCollection(series1);
* Creates a sample dataset.
private XYDataset createDataset2() {
// create dataset 2...
BasicTimeSeries series2 = new BasicTimeSeries("Series 2", Day.class);
series2.add(new Day(3, SerialDate.MARCH, 2002), 16853.2);
series2.add(new Day(4, SerialDate.MARCH, 2002), 19642.3);
series2.add(new Day(5, SerialDate.MARCH, 2002), 18253.5);
series2.add(new Day(6, SerialDate.MARCH, 2002), 15352.3);
series2.add(new Day(7, SerialDate.MARCH, 2002), 13532.0);
series2.add(new Day(8, SerialDate.MARCH, 2002), 12635.3);
series2.add(new Day(9, SerialDate.MARCH, 2002), 13998.2);
series2.add(new Day(10, SerialDate.MARCH, 2002), 11943.2);
series2.add(new Day(11, SerialDate.MARCH, 2002), 16943.9);
series2.add(new Day(12, SerialDate.MARCH, 2002), 17843.2);
series2.add(new Day(13, SerialDate.MARCH, 2002), 16495.3);
series2.add(new Day(14, SerialDate.MARCH, 2002), 17943.6);
series2.add(new Day(15, SerialDate.MARCH, 2002), 18500.7);
series2.add(new Day(16, SerialDate.MARCH, 2002), 19595.9);
return new TimeSeriesCollection(series2);
* Starting point for the demonstration application.
public static void main(String[] args) {
CombinedXYPlotDemo demo = new CombinedXYPlotDemo("Combined XY Plot Demo");
demo.pack();
RefineryUtilities.centerFrameOnScreen(demo);
demo.setVisible(true);

I don't believe it supports putting them vertically and horizontally... only one way or the other. ...
Although, 0.9.3 is pretty old... what about a newer version... I haven't played with those charts in about 9 months, so my info is a little out of date. Problem is, after 0.9.6 (I think) they changed a lot of the packages around so a lot needs to change.

Similar Messages

  • Plotting a combination chart with a combo box for selection

    Hi:
    I am a newbie using xcelcius and I need help on the following:-
    I need to create a combination chart that plots 3 years data by month, and I need a combo box selection at the top that allows me to select user display for each difference region. I manage to create one that plots only 2008 data with a combo-box selection, but I have no idea how to do it for a combi chart in xcelcius. Any advise?

    Hi Ning,
    I assume your data are like this:
    Region             Year     Jan     Feb     Mar
    APJ             2006     $234.45     $310.34     $321.54
    APJ             2007     $314.35     $319.12     $256.89
    APJ             2008     $425.54     $354.34     $285.73
    North Asia     2006     $534.64     $642.35     $484.64
    North Asia     2007     $631.74     $654.13     $754.34
    North Asia     2008     $754.31     $423.65     $634.32
    South East Asia     2006     $536.42     $576.35     $525.42
    South East Asia     2007     $426.78     $876.43     $643.75
    South East Asia     2008     $634.87     $425.77     $732.43
    If this, you can set the insertion type of combo box is "Filtered Rows", see steps:
    1) For Combo Box, bind General > Labels to the Region column.
    2) Set General > Data Insertion > Insertion Type is "Filtered Rows" (you can refer to following flash to see how "Filtered Rows" works).
    3) Set its Source Data are Year, Jan, Feb, ... columns and Destination to blank cells.
    4) Bind Chart to the destination data.
    Now when you select APJ from Combo Box, it will insert all the rows of APJ data to the desitination cells which will be displayed in Chart.
    Hope this can help!

  • Apex 4 Combined chart with multiple y axis

    Hi
    I am trying to create a Combined Line chart & Bar chart using Multiple y-axis
    ie Line chart using one y-axis and Bar chart using another y-axis.
    In Apex 4 so for i am able to to create Combined chart by adding 2 series.. but i am unable to specify y-axis for each.
    Can any one help me how i can do this.
    Thanks
    Prabahar

    I managed to do it.
    Below I will post a working example of sql code and chart XML:
    SQL CODE:
    select NULL LINK,
    trunc(AUTH.AUTHDATETIME) "AUTHDATETIME",
    count(AUTH.AUTHDATETIME) "{n:Computer;t:Spline;y:ex}",
    sum(AUTH.amount) "{n:Video;t:Spline}"
    FROM schema.AUTH
    group by trunc(AUTH.AUTHDATETIME)
    order by 2 desc
    <?xml version = "1.0" encoding="utf-8" standalone = "yes"?>
    <anychart>
    <settings>
    <animation enabled="false"/>
    <no_data show_waiting_animation="False">
    <label>
    <text></text>
    <font family="Verdana" bold="yes" size="10"/>
    </label>
    </no_data>
    </settings>
    <margin left="0" top="" right="0" bottom="0" />
    <charts>
    <chart plot_type="CategorizedVertical" name="chart_1269902745139534">
    <chart_settings>
    <title enabled="False" />
    <chart_background>
    <fill type="Solid" color="0xffffff" opacity="0" />
    <border enabled="false"/>
    <corners type="Square"/>
    </chart_background>
    <data_plot_background>
    </data_plot_background>
    <axes>
    <y_axis >
    <scale type="Logarithmic" minimum="1" log_base="5"/>
                   <title><text>Video Sales</text></title>
                   <labels><format>{%Value}{numDecimals:0}</format></labels>
    </y_axis>
    <x_axis>
    <scale mode="Normal" />
    <title enabled="false"/>
    <labels enabled="true" position="Outside">
    <font family="Tahoma" size="10" color="0x000000" />
    <format><![CDATA[{%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
    </labels>
    <major_grid enabled="True" interlaced="false">
    <line color="Black" />
    </major_grid>
    <minor_grid enabled="True">
    </minor_grid>
    </x_axis>
              <extra>
    <y_axis name="ex">
    <title><text>Computer Sales</text></title>
    <labels><format>{%Value}{numDecimals:0}</format></labels>
    </y_axis>
    </extra>
    </axes>
    </chart_settings>
    <data_plot_settings enable_3d_mode="false" >
    <line_series>
    <tooltip_settings enabled="true">
    <format><![CDATA[{%Name}{enabled:False} - {%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
    <font family="Tahoma" size="10" color="0x000000" />
    <position anchor="Float" valign="Top" padding="10" />
    </tooltip_settings>
    <label_settings enabled="true" mode="Outside" multi_line_align="Center">
    <format><![CDATA[{%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}]]></format>
    <background enabled="false"/>
    <font family="Arial" size="10" color="0x000000" />
    </label_settings>
    <line_style>
                             <line enabled="true" thickness="1" opacity="1" />
    </line_style>
    <marker_settings enabled="True" >
    <marker type="Circle" />
    </marker_settings>
    </line_series>
    </data_plot_settings>
    #DATA#
    </chart>
    </charts>
    </anychart>
    Originally I used as an example below resource:
    http://anychart.apex-evangelists.com/pls/apex/f?p=755:46:0::NO:46::
    Thanks.
    Edited by: Jopa on 23.07.2010 1:07
    Edited by: Jopa on 23.07.2010 1:08

  • Stacked Bar and combination chart

    Hi Guys,
    Does anyone know if it is possible to do a combination chart with a stacked bar chart and line chart.
    Thank you
    Jess

    Jess_C,
    There is no predefined chart to solve ur purpose. Try to sync both the charts and use Manul scaling.
    Thanks.
    Karthik

  • Problem with logarithmic scale in combination chart

    Hi Experts,
    I have a combination chart where in primary axis i am showing column chart and in the secondary axis, i am showing line chart. Now as the range of values used in the column chart is big, I have to use logarithmic scale in primary axis. But if i do so, the line chart is also being affected. The markers for negetive values in the line chart plotted in secondary axis disappears if I apply logarithmic scale in primary axis.
    Is it a bug ?
    I am using Xcelsius 2008 SP3.
    Thanks and Regards

    Hi:
       Yes, I also noticed this problem, seems when you set primary axis as "Logarithmic", the secondary axis with negative value "<0" will be ignored as "0". I think it should be an issue.
       A quick work around here is, swith your primary axis and your secondary axis, when you set seconary axis as "Logarithmic", the negative values in primary axis will not be ignored.
    Hope it helps.

  • How do you combine a stacked column chart with a clustered column chart

    Hello,
    I am trying to combine a stacked column chart with a clustered column chart. I know that in Excel there is a way to trick that described on the next site: http://people.stfx.ca/bliengme/ExcelTips/Columns.htm
    Is that possible with BI Publisher?
    Thank you very much!
    Codruta Crisan

    Finally I get it myself:
    You need to use graph type as BAR_VERT_STACK2Y and the declare the series that you want to see on the first Y vertical bar as assignedToY2="false" and the ones that you wanr to see on the second Y vertical bar as assignedToY2="true".
    In my case I use 4 Series, 2 stack on the first clustured column and 2 stacked on the second (2Y) clustured colum....see below
    graphType="BAR_VERT_STACK2Y">
    <SeriesItems>
    <Series id="0" assignedToY2="false" color="#BBD6E7"/>
    <Series id="1" assignedToY2="false"/>
    <Series id="2" assignedToY2="true" color="#004A96"/>
    <Series id="3" assignedToY2="true"/>
    </SeriesItems>

  • Bar Charts with Non-Stacked Subgroups

    I'm trying to create a report in CR2008 for my elementary school principals that will display how many students received a specific grade each of the three marking periods (T1, T2, and T3) per grade level per subject area (Math, PE, etc.).  I was able to do this with a separate chart for each marking period, but would like to combine the charts into a single chart that has the grades (such as ADV, PRO, or BLB) across the bottom, and has the trimester scores as subgroups, so it looks something like this:
                   3    123     23   1     1
                  23    123    123   123   12
    Kinder Math  123    123    123   123   123    123
                 ADV    PRO+   PRO   APP   BASI   BLB
    Each of the grades would have three subgroups (bars) representing the three trimesters.  The y-axis scale would be the count of students who received each grade, with the maximum value set to the total number of active students at the end of the year (plus a small fudge factor in case the T3 enrollment is smaller than the T1 or T2 enrollment).
    The database (SQL Server 2005) I'm pulling from has table I'll call Grades; it's joined to a table called Students to get the grade level.  Each record in Grades has the following data in it (names have been changed to make them make more sense here, and only relevant fields are shown):
    StudentID, CourseNum, Section, T1_Active, T1_Grade, T2_Active, T2_Grade, T3_Active, T3_Grade
    If a student was enrolled in a specific CourseNum and Section at the end of a marking period, the XX_Active field will be "A"; if it's not, it should be skipped in the counting.  Because of this it is very possible that the count for a specific grade/trimester is zero, especially at the outliers (ADV and BLB).
    In Chart Expert >> Data >> Advanced, the current charts are set up using:
    On change of Grade.T1_Grade
    Show value(s): Count of Grade.T1_Grade
    (Substitute T2 or T3 for the second and third charts.)  Unfortunately, I have no clue what to choose for these values to get a combined chart.
    My questions:
    1) Does CR support bar graphs with subgroups that aren't stacked?  Does it support having three subgroups?
    2a) If so, what would be my next step to making this work?  Is the secret in running totals, formulas, arrays, or something else?  Maybe creating a view in the database that rearranges the data to make it easier to work with?
    2b) If CR doesn't support this directly, would it be worth while to fake it with six separate bar charts u2013 a chart just for ADV next to a chart just for PRO+, etc. u2013 or would the performance penalty be too much?  Would I need to have them each in their own subreport, or could they all live on the same level?  Is this the way I'd need to go if I also wanted to put trend lines over or above each letter grade group?
    Thank you in advance for any pointers you can give me.
    Jim
    Edited by: jimsteph on Jul 8, 2010 2:33 PM

    If you can create a view, that would be very helpful, by making the view, you are pushing some of the work to the
    server, so... "Hopefully" the report will be quicker. I don't think making six seperate charts would be all that much load on the
    server, or cr. If you do that, would you stack the charts? and just make the top stacks with Transparent backgrounds?
    Rather than add a view on the server u2013 there's talk that the next version of the gradebook program will completely refactor the database u2013 I did a SQL Command (I can't remember where I read about that tip over the last couple of feverish days, but my hat's off and I owe someone a frosty adult beverage!) that created a simplified table.  I then used that to create a Cross-Tab (my original report approximated one using a whole bunch of Running Totals).
    I then tried to make the chart, and got completely frustrated u2013 again u2013 until I accidentally created a chart from the Cross-Tab (right-click on the Cross-Tab and choose Insert Chart ).  I had no idea you could do that, and it ended up being exactly what I wanted.
    I have CRXI, if you go to the Sample reports, you will see one called Chart.rpt, this has multiple examples of some of the
    charts you can create. Perhaps a 3D riser chart would meet your requirements. HTH If not, can you provide some different samples?
    I would have never thought to look for the samples.  Thank you!  Now that I've got my immediate problem solved it's time to look at the samples and see what possibilities exist for future reports.
    Jim

  • 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

  • Stacked Column Chart with Lines

    Requirement:
    User stacked Column chart to display data for defects for 4 departments.
    1 or 2 lines to show baseline for defects(constant).
    Is there anyway that I can do that just like we can create one in Excel?
    (stack a Stacked column chart with a line chart is not a solution.)
    Any advises?
    Thanks,
    Wen

    Hi Wen,
    I realise that you are not going to get this to work with a standard component on its own. I think it might be possible to acheive it with overlaying barcharts and combination charts.
    My assumption is that you are looking for something that has a stack with 3 separate items in it. Two target lines crossing over the stacked chart.
    I will have a look at this to see if I can come up with something. Let me know if this is not your requirement.
    No, I don't work for SAP. I think those that do have the SAP logo beside them.
    Regards
    Alan

  • Date/Time on X-Axis with JFreeChart

    Hi guys,
    I've asked this question on the JFreeChart forums, but got no response.
    If anyone has any experience with JFreeChart, help would be most appreaciated.
    I am drawing a XY Line Chart to display CPU usage retrieved from a database. The user can search with specific dates/times (eg: from: 24/2/2005 to: 16/4/2005) - and then these results would be graphed.
    My question is, how do I use dates/times on the X-axis using JFreeChart?
    The results I am getting from the DB would be a time-stamp and CPU usage.
    Here is my current code, but it wont work with a time-stamp:
    public static class ChartTest   {
        public ChartTest()
            // create a dataset...FOR LOOP
            XYSeries dataSet = new XYSeries("CPU Usage");
            TimeSeries closing = new TimeSeries( "Closing Value", Day.class );
         for(int h=0; h < newArray[0].length; h++)
            for(int i=0; i < newArray.length; i++)
               dataSet.add(newArray[i][h], newArray[i][h++]);
            XYDataset xyDataset = new XYSeriesCollection(dataSet);
            // create a chart...
            JFreeChart lineGraph = ChartFactory.createXYLineChart
                        ("Mitch's CPU Usage Test",  // Title
                          "Time",           // X-Axis label
                          "CPU Load",           // Y-Axis label
                          xyDataset,          // Dataset
                          PlotOrientation.VERTICAL,        //Plot orientation
                          true,                //show legend
                          true,                // Show tooltips
                          false               //url show
            // create and display a frame...
            ChartFrame frame = new ChartFrame("CPU Usage Test", lineGraph);
            frame.pack();
            frame.setVisible(true);
        }

    The JFreeChard demo should give you the idea
    package demo;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.text.SimpleDateFormat;
    import javax.swing.JPanel;
    import org.jfree.chart.*;
    import org.jfree.chart.axis.DateAxis;
    import org.jfree.chart.plot.XYPlot;
    import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
    import org.jfree.data.time.*;
    import org.jfree.data.xy.XYDataset;
    import org.jfree.ui.*;
    public class TimeSeriesDemo1 extends ApplicationFrame
        public TimeSeriesDemo1(String s)
            super(s);
            XYDataset xydataset = createDataset();
            JFreeChart jfreechart = createChart(xydataset);
            ChartPanel chartpanel = new ChartPanel(jfreechart, false);
            chartpanel.setPreferredSize(new Dimension(500, 270));
            chartpanel.setMouseZoomable(true, false);
            setContentPane(chartpanel);
        private static JFreeChart createChart(XYDataset xydataset)
            JFreeChart jfreechart = ChartFactory.createTimeSeriesChart("Legal & General Unit Trust Prices", "Date", "Price Per Unit", xydataset, true, true, false);
            jfreechart.setBackgroundPaint(Color.white);
            XYPlot xyplot = (XYPlot)jfreechart.getPlot();
            xyplot.setBackgroundPaint(Color.lightGray);
            xyplot.setDomainGridlinePaint(Color.white);
            xyplot.setRangeGridlinePaint(Color.white);
            xyplot.setAxisOffset(new RectangleInsets(5, 5, 5, 5));
            xyplot.setDomainCrosshairVisible(true);
            xyplot.setRangeCrosshairVisible(true);
            org.jfree.chart.renderer.xy.XYItemRenderer xyitemrenderer = xyplot.getRenderer();
            if(xyitemrenderer instanceof XYLineAndShapeRenderer)
                XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer)xyitemrenderer;
                xylineandshaperenderer.setDefaultShapesVisible(true);
                xylineandshaperenderer.setDefaultShapesFilled(true);
            DateAxis dateaxis = (DateAxis)xyplot.getDomainAxis();
            dateaxis.setDateFormatOverride(new SimpleDateFormat("MMM-yyyy"));
            return jfreechart;
        private static XYDataset createDataset()
            TimeSeries timeseries = new TimeSeries("L&G European Index Trust", org.jfree.data.time.Month.class);
            timeseries.add(new Month(2, 2001), 181.8);
            timeseries.add(new Month(3, 2001), 167.3);
            timeseries.add(new Month(4, 2001), 153.8);
            timeseries.add(new Month(5, 2001), 167.6);
            timeseries.add(new Month(6, 2001), 158.8);
            timeseries.add(new Month(7, 2001), 148.3);
            timeseries.add(new Month(8, 2001), 153.9);
            timeseries.add(new Month(9, 2001), 142.7);
            timeseries.add(new Month(10, 2001), 123.2);
            timeseries.add(new Month(11, 2001), 131.8);
            timeseries.add(new Month(12, 2001), 139.6);
            timeseries.add(new Month(1, 2002), 142.9);
            timeseries.add(new Month(2, 2002), 138.7);
            timeseries.add(new Month(3, 2002), 137.3);
            timeseries.add(new Month(4, 2002), 143.9);
            timeseries.add(new Month(5, 2002), 139.8);
            timeseries.add(new Month(6, 2002), 137.0);
            timeseries.add(new Month(7, 2002), 132.8);
            TimeSeries timeseries1 = new TimeSeries("L&G UK Index Trust", org.jfree.data.time.Month.class);
            timeseries1.add(new Month(2, 2001), 129.6);
            timeseries1.add(new Month(3, 2001), 123.2);
            timeseries1.add(new Month(4, 2001), 117.2);
            timeseries1.add(new Month(5, 2001), 124.1);
            timeseries1.add(new Month(6, 2001), 122.6);
            timeseries1.add(new Month(7, 2001), 119.2);
            timeseries1.add(new Month(8, 2001), 116.5);
            timeseries1.add(new Month(9, 2001), 112.7);
            timeseries1.add(new Month(10, 2001), 101.5);
            timeseries1.add(new Month(11, 2001), 106.1);
            timeseries1.add(new Month(12, 2001), 110.3);
            timeseries1.add(new Month(1, 2002), 111.7);
            timeseries1.add(new Month(2, 2002), 111.0);
            timeseries1.add(new Month(3, 2002), 109.6);
            timeseries1.add(new Month(4, 2002), 113.2D);
            timeseries1.add(new Month(5, 2002), 111.6);
            timeseries1.add(new Month(6, 2002), 108.8);
            timeseries1.add(new Month(7, 2002), 101.6);
            TimeSeriesCollection timeseriescollection = new TimeSeriesCollection();
            timeseriescollection.addSeries(timeseries);
            timeseriescollection.addSeries(timeseries1);
            timeseriescollection.setDomainIsPointsInTime(true);
            return timeseriescollection;
        public static JPanel createDemoPanel()
            JFreeChart jfreechart = createChart(createDataset());
            return new ChartPanel(jfreechart);
        public static void main(String args[])
            TimeSeriesDemo1 timeseriesdemo1 = new TimeSeriesDemo1("Time Series Demo 1");
            timeseriesdemo1.pack();
            RefineryUtilities.centerFrameOnScreen(timeseriesdemo1);
            timeseriesdemo1.setVisible(true);
    }

  • How to combine rows with small numbers into single "other" row?

    How can I combine rows with value 6(for example) or lower to single row representing the SUM of all this values and label OTHER, so the pie chart will have a chance to display all small values combined?
    I'm using Numbers 09

    HI Peter,
    When you write a decimal number, is the decimal separator a period ( . ) or a comma ( , )? If it's a comma, then the syntax error can be corrected by replacing the list separator in the formula, a comma in Jerry's formula, with a semi colon ( ; ):
    =SUMIF(B; "<6"; B)
    (Added): The two Bs appear in blue 'lozenges' in Jerry's image because that is the way cell (or column) references are displayed in Numbers when a formula has correct syntax.
    Regards,
    Barry
    Message was edited by: Barry

  • Secondary Axis Label in Combination Chart

    Hi Everyone,
    I´m trying to make a Pareto Diagram with a Combination Chart, but I need a secondary Y axis for my cumulative frecuency. Is that possible???
    Thanks in advance.

    Hi Jessica,
    It is possible to do  Pareto Diagram with combination chart.Do like this take one measure on Primary Axis and select second measure and enable the secondary axis and map the values.
    Regards,
    Ramana
    Edited by: RamanaReddy Varra on Jul 27, 2011 11:38 AM

  • Stacked Bar Combination Chart in Reports

    Afternoon
    I have a requirement for a chart that is a stacked bar chart chart with the addition of a line chart.
    The combination chart allows Bars and Lines, but can't see how to change this to a stacked bar. Is there a setting I can change in the XML?
    Report Builder 10.1.2.0.2
    Any ideas?
    Regards
    Richard

    Solved my own problem.
    Add graphType="BAR_VERT_STACK" to the "Graph version..." as below:
    <Graph version="3.2.0.22" markerDisplayed="false" markerShapeInLegend="false" graphType="BAR_VERT_STACK">
    Also ensure the bar series are set to "MT_BAR" and line is set to MT_MARKER

  • Openoffice spreadsheet draw combination charts  programatically

    hi all,
    we need to develop a project that is an extension in OO so that it could display a mutitype chart we have drawn in Excel.
    Essentially, we have a combination chart consists of a candle stick chart and a line chart appearing together. OO could not display it!
    (see http://qa.openoffice.org/issues/show_bug.cgi?id=27363).
    We have research the problem for a while and figure that the easiest way is to develop an extension in Java using the Netbean Integration tool. Probably, adding a new chart type so that it is matched to the excel version. In chart2, it appears that they have changed the structure to a MVC model and under the diagram service, a coordinate system could have a list of charttype. So it appears that it is possible to draw a chart with different charttype on it even without the extension. However, we have not tried the chart2 API as we can't find a working example and SUN is not very helpful either and they discourage us to use chart2.
    (see http://graphics.openoffice.org/chart/chart2codestructure.html)
    can you give us advise how to approach this problem ?
    documentation resources , code snippets to call chart2 api from java code and any other helpful suggestion will be very welcomed.
    thanks.

    ok let me put it simply :
    com:sun:star:chart2 is not written in java, it is all written in C++ with those horrible IDL files which I don�t want to know about.
    However, i do think UNO make it possible to be used in a java environment.
    i searched the OOo website and also the web for an example snippet of a java program that calls com:sun:star:chart2 ; but i didn't found anything.
    it would be great if SUN engineers in this forum show me an example of how to use the OOo chart2 API in a java program.
    thanks.

  • Creating X/Y chart with X-Axis labels in between

    Hello all.
    I would like to create a Numbers 09 scatter/XY chart with the X-Axis labels between the gridlines instead of on them.   How can I do this with a line chart also?  Or, does thids format require a Combination chart?  If so, how can what I'm trying to create be made?

    I'll give you the basic steps. I might miss one or two along the way.  The basic steps are to create the chart, remove all the unecessary parts of the chart and set the fill color to none, create & format the table, slide the table under the chart, align the two, then lock them.
    Create a chart from your data. I said the chart above was a line chart but it was actually a scatter chart.
    I'd recommend making up a few "special" data points (overwriting a few points in your actual data for the time being) that you can use to align the table and chart.  In the chart above, I used something like (1.5, 0.1) and (30.5, 0.9), two points that should align exactly with the X & Y gridlines if the chart and table are properly aligned.
    Set the min and max for both axes.
    Size and place the chart where you want it
    Set the fill color to none
    Remove the value labels, gridlines, axes, etc.
    Create a plain table with the necessary number of columns and rows. The one above has 32 columns and 7 rows.
    Put the value labels in the table. I vertically centered the Y axis labels in the cells using the icon on the toolbar. I didn't horizontally center the X axis labels but maybe I should have.
    Make the table borders the color & thickness you want.  At this point, the X&Y axis labels will also have borders.
    Turn on Border Selection in the Table menu
    Select the borders you want to remove and change them to no line. You click on a border to select the entire thing then click again to select a segment. You can command-click to select multiple border segments. Be careful you don't miss when clicking or your entire selection will disappear. I recommend selecting & changing a few at a time
    Select the table and send it to the back using Arrange/Send to Back.
    Slide the table under the chart.
    With the entire table selected so that it has the little squares at the corners and sides, drag on the squares to get the table about the right size. Hold down Command when dragging to turn off snaps. Try it without Command and you'll see what I mean.
    Use the Table Inspector to fine-tune the row & column sizes so the table "gridlines" match the chart. You are trying to line up the gridlines with your two "special" data points. You might want to adjust the size of the chart some too.
    You can move the table around by dragging to get it close to where it should be. You can select the chart and use the arrow keys to move it pixel-by-pixel.
    You'll have to repeat the steps above until everything is aligned. Then you can get rid of those "special" data points.
    When it all looks good, lock the table and chart so nothing gets changed or moved accidentally.
    That was it off the top of my head. It comes out to alot of steps but once you've done stuff like this a few times it gets easy.

Maybe you are looking for

  • Display all SAXExceptions during parsing

    How can I display all SAXExceptions generated when a SAXParser validates a XML document against a schema? I want the parser to continue until the end of the document and display all parse errors by an errorhandler. Currently, the parser halts at the

  • Last Execution Date of a Query

    Hi Exparts Can any one tell me, how to see the execution of the BI Queries ? My problem is I want to check that when did my end user has last seen the report,This statstics will give me an insight on  BI reports usability. Top mangement is interested

  • Hp D110 when printing works doc get out of memory error

    get out of memory error when print icon selected from Works

  • Raw Support for Leica X Vario Camera?

    Is There Raw (DNG) support a Leica X Vario camera?  I've currently dowloaded LR 5.7 and tried tio import two DNG files from the camera and the software won't read them.  any idea about what is going on. Need help Regards

  • How to install printer on RG11B ?

    Hello I'm having problems installing my Officejet 5110 printer on USB port of my RG11B Wireless gateway with print server. I'm running XP Home. Printer works fine when I install directly on my laptop (wireless 802.11b). But when i connect my printer