Creating a multi series line chart with different data providers

I have 3 data providers of the same structure i.e ArrayCollection of DataElement and want to use them to create a multiseries line chart. I do not have just 1 dataProvider that can be used but 3 different data providers of the same structure that i want to use each for different series.
[Bindable] private var orangeSales : ArrayCollection =
                new ArrayCollection(
                    [ { sales: 101000, month: new Date( '01/01/2008' ) },
                        { sales: 960000, month: new Date( '02/01/2008' ) },
                        { sales: 475000, month: new Date( '03/01/2008' ) },
                        { sales: 425000, month: new Date( '04/01/2008' ) }
            [Bindable] private var appleSales : ArrayCollection =
                new ArrayCollection(
                    [ { sales: 991000, month: new Date( '01/01/2008' ) },
                        { sales: 140000, month: new Date( '02/01/2008' ) },
                        { sales: 565000, month: new Date( '03/01/2008' ) },
                        { sales: 255000, month: new Date( '04/01/2008' ) }
            [Bindable] private var bananaSales : ArrayCollection =
                new ArrayCollection(
                    [ { sales: 891000, month: new Date( '01/01/2008' ) },
                        { sales: 147560, month: new Date( '02/01/2008' ) },
                        { sales: 295000, month: new Date( '03/01/2008' ) },
                        { sales: 574000, month: new Date( '04/01/2008' ) }
I want to create a line chart with orangeSales, appleSales and bananaSales as three different lines on the chart for different dates specified.
<mx:ColumnChart showDataTips="true" >
        <mx:horizontalAxis>
            <mx:CategoryAxis
                dataProvider="{orangeSales}"
                categoryField="month"
                />
        </mx:horizontalAxis>
        <mx:series>
            <mx:LineSeries displayName="OrangeSales" yField="sales" xField="month" dataProvider="{orangeSales}"/>
            <mx:LineSeries displayName="AppleSales" yField="sales" xField="month" dataProvider="{appleSales}"/>
            <mx:LineSeries displayName="BananaSales" yField="sales" xField="month" dataProvider="{bananaSales}"/>
        </mx:series>
</mx:ColumnChart>
Please help!

Sorry for the confusion. Actually I must be doing some thing wrong like using ColumnChart to display a line chart or something like that.
I have now realized that a multi series line chart can be built by having a different data provider for each of the LineSeries object.
So the code below would create a multi series line graph :
[Bindable] private var orangeSales : ArrayCollection =
                new ArrayCollection(
                    [ { sales: 101000, month: new Date( '01/01/2008' ) },
                        { sales: 960000, month: new Date( '02/01/2008' ) },
                        { sales: 475000, month: new Date( '03/01/2008' ) },
                        { sales: 425000, month: new Date( '04/01/2008' ) }
            [Bindable] private var appleSales : ArrayCollection =
                new ArrayCollection(
                    [ { sales: 991000, month: new Date( '01/01/2008' ) },
                        { sales: 140000, month: new Date( '02/01/2008' ) },
                        { sales: 565000, month: new Date( '03/01/2008' ) },
                        { sales: 255000, month: new Date( '04/01/2008' ) }
            [Bindable] private var bananaSales : ArrayCollection =
                new ArrayCollection(
                    [ { sales: 891000, month: new Date( '01/01/2008' ) },
                        { sales: 147560, month: new Date( '02/01/2008' ) },
                        { sales: 295000, month: new Date( '03/01/2008' ) },
                        { sales: 574000, month: new Date( '04/01/2008' ) }
I want to create a line chart with orangeSales, appleSales and bananaSales as three different lines on the chart for different dates specified.
<mx:ColumnChart showDataTips="true" >
        <mx:horizontalAxis>
            <mx:CategoryAxis
                dataProvider="{orangeSales}"
                categoryField="month"
                />
        </mx:horizontalAxis>
        <mx:series>
            <mx:LineSeries displayName="OrangeSales" yField="sales" xField="month" dataProvider="{orangeSales}"/>
            <mx:LineSeries displayName="AppleSales" yField="sales" xField="month" dataProvider="{appleSales}"/>
            <mx:LineSeries displayName="BananaSales" yField="sales" xField="month" dataProvider="{bananaSales}"/>
        </mx:series>
</mx:ColumnChart>

Similar Messages

  • APEX multi series line chart with different markers for each series

    I am using APEX 4.0 and trying to create a multi-series line chart that will have a different for each series.
    Does anyone know how to accomplish this?
    Edited by: user4635837 on Apr 19, 2011 7:22 AM

    Hello -
    It is possible to do.
    Another user in this forum has written some code snippets to assist in creating your own custom XML for charting. That reference can be found http://apex.oracle.com/pls/apex/f?p=36648:30:418355095936797::NO:::
    Look this over and it should get you moving in the right direction.
    What you are trying to do isn't terribly difficult. In fact, I did it fairly easily as can be seen http://apex.oracle.com/pls/otn/f?p=28155:4:362637005964920:::::
    First, create a Hidden page item.
    Next, create a process that runs before regions
    That process will create the XML for your line chart and store it in the hidden page item. Use the above references for assistance in setting up the PL/SQL in the process
    Then, create your custom XML for your chart. Replace the #DATA# tag in the custom XML with your hidden page item.
    It is a bit daunting at first, but once you get the hang of it, it really isn't that bad.
    Austin

  • Line chart with different length series?

    Hello,
    I would like to draw a line chart with three different series.
    1. Previous year
    2. Current year (until now)
    3. Estimate (2 months)
    I've got 12 values for the previous year, 4 values for the current year (January to April) and 2 estimated values for May and June.
    When I define the three series, each is stretched over the whole width of the chart. How can I avoid that and force for instance the April values to be displayed above each other? Is it possible at all with this type of chart? (In Excel, it's quite easy...)
    Thanks for any help!
    Sabine

    Hi,
    You’ll have to write a query for your series 2 and 3 that has the same number of data points as your series 1 query, in your example that would be 12. Line series charts are always stretched over the full width by design. The months for which you have no data, would have a value of NULL. Please note that there is one issue, which has been fixed in 2.2, that causes the charting engine to only render dots instead of lines for series 2, 3, …, if they have a NULL value at the last data point. So if I understand your requirements correctly, you should try this on our 2.2 hosted beta instance, and then upgrade to 2.2 when it comes out.
    Regards,
    Marc

  • Problem creating line chart with character data

    Post Author: burkartt
    CA Forum: Charts and Graphs
    CR Developer v. 11.5.0.313
    I want to create a line chart with data from a SQL2K table to show how much server time each application uses per day. All data is defined a character.
    HWA,4/24/2007,01:44.6HWA,4/25/2007,12.28HWB,4/24/2007,4.6HWC,4/24/2007,55.55HWC,4/25/2007,01:22.3HWE,4/24/2007,01:16.1HWE,4/25/2007,0.59
    I want one horizontal line per application where the X-axis represents the date and the Y-axis represents the server time. I have tried all column combinations for "On Change Of" and "Show Value(s)". What confuses me is why are Count and Discount the only Summary Options for the "Show Value(s)" data?
    Thank you,
    tim

    Post Author: V361
    CA Forum: Charts and Graphs
    I created a group based on date, day, then created the chart and put it in the group footer, on change of server, show sum of time, you will get a seperate chart for each day.  I am not sure if this will help, or will just do.  Since you have CR XI, you may want to look at the gauge chart also....

  • Line chart with different "colors": Values not available are displayed as 0

    Hello,
    I defined a line chart with more than one lines (aka "colors" in the chart wizzard) - each line representing the (monthly) values of a year. x axis are the 12 months of the year; y axis are the values.
    When one defines such a line chart in BIP client there is a choice between sum, average and count for the data values.
    This is no problem for my template as there is only one value per month/year - so I used sum.
    The problem: for the actual year there are no values for future months . But bip nevertheless shows 0 for this month/year... Can one prevent this?
    Regards
    Peter

    Solved it finally - unavailable values must explicitly be passed to the report with nothing contained in the value tag.

  • Multiple series chart with differing dates

    Is there a way to display multiple series on a chart when the
    data for the horizontal axis doesn't match up? For example:
    if data1 (val, date) is (10, 01/05/2008) (15, 02/08/2008)
    (20, 03/01/2008)
    and data2 (val, date) is (8, 01/12/2008) (25, 02/10/2008)
    (30, 03/14/2008)
    how would I get the data to display on a multiple series
    chart. Right now, I am using a CategoryAxis for the horizontal
    axis. If I do something like this:
    hAxis.dataProvider = data1;
    hAxis.categoryField = "date";
    it will show only the series for data1, but not data2.

    Thanks for the reply.
    That link tells you how to add multiple axis to a chart which
    is what I'm doing, but unless you want to have two horizontal axis
    on the bottom (which looks terrible) or put one on the top and one
    on the bottom (which looks awkward), this solution is not very
    good.
    The problem is that the data ranges for the horizontal are
    the same, but the individual timestamps are slightly different,
    sometimes off by only a few hundredths of a second.
    To attempt to work around this, I merged the two arrays, but
    that seemed to mess up the display of the data.
    Is there not a way to just draw the second series on top of
    the first without having to lock it to the axis? It seems like the
    answer is no when using the standard packages. But is there a way
    to override this and get it to draw properly?

  • Two charts with different data on single report

    Hi there,
    I've a requirement to report on two weeks, past week and current week. The data is grouped by a type.The report should  display separate charts side by side, one chart for the past week and the other for the current week, for comparision purposes. The details can display the data together for the two weeks.
    Is it possible to select data on charts?
    I'm using Crystal Reports for Visual Studio 2005.
    Any help is highly appreciated.
    Thanks,
    Seshu

    Insert two subreports and create the charts in them.

  • Line chart with more than 15 data series - color problem

    Hi all,
    I've built a line chart with 32 data series (user can control, which of them are displayed at a time). For series 16 to 32 I did manipulate the URL in the browser directly, because Application Express does only display parametrs for up to 15 series. This works fine so far except of displaying the colors. For each sieries I defined a different color. 29 of my 32 series are displayed in the desired color. But series 29, 31 and 32 are displayed in a default-color (#0099CC). It seems that this is a SVG-problem. In the SVG-source I find the wrong color. When I export my application, I see the right color.
    Thanks for help,
    Chris

    Hello,
    Which version of APEX are you using?
    Go to your Flash Chart attributes - get into your series (click the icon) in the section of Series Query you'll find the maximum rows.
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://apex-evangelists.com/
    -- http://apexblogs.info/

  • Influence of hierarchy navigation on different data providers

    Hello WAD gurus,
    We use few analysis items with different data providers in the same template. The items navigation should influence each other . Therefore, we have maintained entries in list "Affected data providers". Most navigation steps affect the other item, however, navigation on hierarchies doesn't affect other Items.
    Is there any solution to this situation?
    Thanks in advanced.
    Miri.

    Hello WAD gurus,
    We use few analysis items with different data providers in the same template. The items navigation should influence each other . Therefore, we have maintained entries in list "Affected data providers". Most navigation steps affect the other item, however, navigation on hierarchies doesn't affect other Items.
    Is there any solution to this situation?
    Thanks in advanced.
    Miri.

  • Line Chart with Multiple Series

    Post Author: JayZee
    CA Forum: Charts and Graphs
    HI
    I am trying to create a line chart with multiple series for trend analysis on CR XI but not having much luck, I thought it would be so simple to do!
    My data is provided summarized on the server and is returned as 12 rows:
    Month       Year1        Year2      Year3      Year4     Year5January      100           80          75           90          120February      85           25           40           25          80etc for the rest of the months
    My problem is that I can only get the chart to accept the values to display as a summary and not just as the data pulled back from the server.  I have read an article on the support site for Crystal 6.0  but it doesn't seem to translate well into XI.
    If necessary I could redesign the table to bring back un-summarized data but that is quite a big job.
    Any help greatly appreciated.
    Jay

    Post Author: Tim Wise
    CA Forum: Charts and Graphs
    In the chart expert, put Month in the 'On change of' box and put each year in the 'Show values' box. This puts the month on the x-axis and plots each year as a line.
    Is that what you want?
    I did this in CR 2008 using your data in an Excel sheet.

  • Line chart with 2 different y axis

    hi,
    i have a question on line chart in apex. i'm using apex 4.2. is it possible to generate a line chart with 2 different y axis? here's a sample data to illustrates what i'd like the chart to look like.
    date price percent
    1/1 1 100
    1/2 2 90
    1/3 3 80
    1/4 4 70
    the x-axis will be the date column. the left y-axis would be the price column. and the right y-axis would be the percent column.
    i know i can plot multiple lines in a chart thru different series. but they're based on the same x and y axis range. thanks
    jim

    You beat me to it.
    One of the problems I'm having is that the begining and ending point(s) coincide. So, instead of two completely separate lines, I have an area bounded by the series 1 line on top and the series 2 line on the bottom. Since the points overlay, the values of those points also display one on top of the other. I'll have to see if there is a way to separate the series. I've had 3 separate series before, but never with two y-axis.
    Regards,
    Howard

  • JavaFX, Display Line Chart with additional text

    Hello:
    I am new to Java and JavaFX. I have been able to create a line chart that has four series using example code from the Oracle Javafx Documentation home. Below is the syntax used to create the line chart once the series info has been populated:
    Scene scene = new Scene(lineChart,800,600);
    lineChart.getData().addAll(series1, series2, series3, series4);
    When I display the chart, I would also like to display additional text.
    My chart measures four different averages by month. I would like to use the text to give more info about each series (ex: 6 month and 1 year total avg for each series). The Line Chart and the text that I want to add do not need to be related. I will calculate the 6 & 12 month avg and list it in the text separately.
    I am struggling to find a way to display the line chart with a separate text field. If anyone can point me to some sample code that does something similar I would greatly appreciate it.
    Thanks,
    Troy

    Hi,
    My data points in my line chart are an average for a single month for each series.
    Ideally I would like a table as shown below centered under the Line Chart if possible (I was unable to use underscores or spaces to build the example. The + signs would really just be a line and the ' are used for spaces):
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++``````````````++``Series 1```++```Series 2```++``Series 3```++``Series 4``++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++6 Month Avg````++```5.6`````++``````7.8 ```++ ````4.8`````++`````8.4``++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++12 Month Avg```++```6.9`````++``````9.3 ```++ ````2.5`````++```5.7````++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Edited by: user8835022 on Jul 26, 2012 3:35 AM

  • Flash line chart with multiple lines

    Here a newbie with apex...
    Created a flash line chart with as source the following sql statement:
    select null link, year, sum(total_cost) from cost
    group by year
    a chart has been created with a single line. i wanted every year on an own line.
    The way i could do this is with multiple series like:
    select null link, year, sum(total_cost) from cost
    where year =2008
    select null link, year, sum(total_cost) from cost
    where year =2009
    But this not a good solition, cause now i've to add every year a new serie
    hope to get some help from here... txn in advanced.

    tnx for your reply...
    I will explain myself more by a picture of the wanted result, see below:
    [Click here for the example image|http://img44.imageshack.us/img44/3444/grapha.jpg]
    In your reply you wright you think i can create the graph with pl/sql process. After seeing my example you still think that's needed?
    Hope you or some else can help... tnx in advanced.
    greetings

  • Line Chart with more than 15 datapoints

    I'm using Apex 3.1.
    I am trying to create a line chart with more than 15 data points. Apparently 15 is the default. Question is, How do I change the default?
    The Wiki has advice for changing the "Maximum Rows" parameter, but "Maximum Rows" is not to be found, either in the chart attributes or series attributes.
    http://wiki.shellprompt.net/bin/view/Apex/ChartIssues
    I have encountered this limitation with SVG line charts and Flash line and scatter charts. Seems like it must be an easy thing to figure out; I feel embarassed asking such a question. But I've been through all the application property pages, much of the documentation, and several tutorials... Where can I change this? It's driving me nuts!
    Thanks
    Fred

    Hello,
    Which version of APEX are you using?
    Go to your Flash Chart attributes - get into your series (click the icon) in the section of Series Query you'll find the maximum rows.
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://apex-evangelists.com/
    -- http://apexblogs.info/

  • Charts with Multiple Data Series in One Color

    I am trying to create a pie chart to reflect the different areas of my budget in four categories. However, my budget is divided into several smaller categories across several columns and I can only get the cells in the first column to register even though the additional cells show up in the Inspector as part of the series.

    Jerry,
    Thanks for the info. I'll give that a read when I get home today. In a roundabout way I tried part of that. I created my chart with my data for Mammallia and the time periods. Then I selected the occurrences for Synapsids and dropped them in, but it added them to the first data set in the chart? I'm guessing I was doing something wrong, but I'm unsure of what. Numbers/Excel has never been a strong subject for me, but I'll try your advice and see what I come up with.
    Reading your post again, the last way seems the most simple and I feel a little foolish for not thinking of that myself. Oh well, that's how we learn right? Thanks for your help!! You saved me a lot of hassle.
    Best regards,
    Mitch

Maybe you are looking for

  • Table for List of Active  Data Sources

    Hello All, I have a requirement like, to collect List of Active Data Sources from which extractions are happening for the past one year. Actually i have many Data sources which are in Active State but extractions are happening only on some of the Act

  • OracleXE Windows installation failure (SQL Plus failure)

    winXP pro SP2 AMD Athlon, Oracle 10 g express edition: OracleXE.exe product version 10.2 1. I have just downloaded OracleXE 2. After several successful steps of installation (five new services are installed, four of them running) Creating database st

  • Can 2 invoice number be created with the same Purchase Order number

    HI, I have created one invoice number with a Purchase order number 4500020000. Now is it possible to create a another invoice number with the Same PO

  • How to use templates

    I have some templates that I would like to use but I don't know how to import them into dreamweaver cs4. How do I put my templates into dreamweaver so that I can use them? Please help

  • Java Error (NoClassDefFoundError)

    Hello! There, Here are some error with my java program. I have successfully compiled my simple java program without any error, but that is not running while I am try to run that there were an error occurring like this: Exception in thread "main" java