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.
Similar Messages
-
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 -
Defining a scatter chart with multiple series
I am trying to create a scatter chart with two series. I am using CR8.5 and CR2008.
I am having difficulty with my data being presented correctly when I attempt to define the scatter chart. The data is temperature and weather use/sqft for two different years.
Year Period Temp Energy Use/sqft Year Period Temp Energy Use/sqft
2012 1/2012 52 3.7172 2013 1/2013 52 3.1712
2012 2/2012 62 3.7015 2013 2/2013 57 3.1449
2012 3/2012 70 3.7937 2013 3/2013 63 3.2039
2012 4/2012 76 3.9882 2013 4/2013 71 3.4551
2012 5/2012 82 4.2213 2013 5/2013 81 3.9903
2012 6/2012 87 4.4875 2013 6/2013 85 4.3650
2012 7/2012 90 4.4727 2013 7/2013 87 4.2072
2012 8/2012 86 4.6154 2013 8/2013 87 4.2560
I would expect to see something similar to the attached images of an excel files scatter chart. When I defined the scatter chart in Crystal Report, I need to define a field for 'On change of', and 2 'Values to show'.
I understand that this would not show the expected scatter chart but I went this direction as the series is to be the year.
On change of:
- Year
Show values:
- Temp
- Energy Use/Sqft
Problem is the sum of both is being shown. I am trying to keep the series together by year and showing each record as retrieved from the database.
Thank you,
JimYou can try using this charting tool for generating scatter charts:
http://htmldb.oracle.com/pls/otn/f?p=31517:58
Denes Kubicek -
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,
MikeThanks, 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 -
AreaChart : Customizing HorizontalAxis of a chart with Multiple Series
Hi there,
My area chart has 5 series which has same x_value while different y values and a value which i want to show as label.
all series have dataProvider with following object
{x: x_value, y:y_value, l:label_value}
series xField is using "x" which is also showing values from x at x-xis (horizontal) axis.
My problem is
I want to use same xField=x but i want to show "l" as label values.
How can i do that?
I tried using a LinearRenderer on horizontal axis and provided a custom label function, but i only get "x" value and NOT "l" to show label.
ThanksI wasn't able to do something like what you describe, but I was able to do this:
I defined column A of the table as a Header Row, selected the cells in the table, and chose this chart type (2D 2 Axis):
Then I clicked the chart and in the pane at the right checked 'Axis Name' in the Axis tab and added the axis names.
Maybe this can give you an idea of how you can illustrate the relationships that you want to show.
SG -
Chart with multiple series (SQL?)
Hello everyone,
I have an sql question relating to flash charts in APEX 3.
I have a table "TREND" that has data like this :-
WEEK LOCN COST
===== ==== =====
45........A......10
46........A......12
47........A......15
45........B......18
46........B......16
47........B......11
45........C......13
46........C......14
47........C......10
How do I create an sql statement that can compile multiple values for a chart at runtime. In other words I want a chart that can show three LOCN lines (A,B and C) over the WEEKs (x axis) in the table.
Using the standard chart source only gives one value on the chart ..........
SELECT NULL link, LOCN label, COST value FROM TREND
I need something like this ..........
SELECT link, label, value1, value2, value3 FROM TREND
But I don't know how to transpose my data into that format, can anyone help ?
I need my data to look like this I think :-
WEEK A B C
===== == == ==
45....10.18.13
46....12.16.14
47....15.11.10
Thanks,
Jack.Hi Jack,
you have 2 possibilities.
1) You can create 3 distinct series sql statements (with the "Add Series" button) where you restrict the query to LOCN. Disadvantage: The table is scanned 3 times.
2) You can create just one series where the distinct series values are mapped to columns. eg:
SELECT NULL AS LINK
, WEEK AS LABEL
, SUM(DECODE(LOCN, 'A', COST, 0)) AS A
, SUM(DECODE(LOCN, 'B', COST, 0)) AS B
, SUM(DECODE(LOCN, 'C', COST, 0)) AS C
FROM TREND
GROUP BY WEEKAdvantage: Table is just scanned once.
Patrick
My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/ -
Line Graph with Multiple Series not displayed(Install Missing Plugins)
Hi All,
I have created a Graph - Line Graph.
I have created more then one Series.
The graph is not being displayed, it asks to download missing plugins.
Where as when I have a singe chart series the graph is displayed.
What are the missing plugins, where can I find those.
I am using Mozilla 5.0.
Regards
Arif KhadasPlease Help!
-
Resource Gantt Chart with Multiple Series (Apex 4.1.1)
Hi,
I am building a resource gantt and I want to show different types of entry in different colours.
My series query is:
select null,
time_record_id,
username,
null,
to_timestamp(to_char(event_date + (start_time/24),'YYYY-MM-DD HH24:MI'),'YYYY-MM-DD HH24:MI') start_date,
to_timestamp(to_char(event_date + (end_time /24),'YYYY-MM-DD HH24:MI'),'YYYY-MM-DD HH24:MI') end_date
from
oly_time_record
where
work_code = 'OFFICE'
order by 5, 3;which works well to show me the times when a user is going to be in the OFFICE.
I now want to add additional bars to the chart that shows me the times that a user is going to be 'WORKFROMHOME'.
The 'OFFICE' time should show Green bars and the 'WORKFROMHOME' should show Red Bars.
This is quite easy on normal charts, where you can add extra series but the Resource Gantt does not seem to allow more than one series.
Does anyone have any ideas about how I can get what I need?
Thanks,
MartinHi Martin,
there are a lot of examples of gantt charts in this forum.
Take a look here:
http://apex.oracle.com/pls/apex/f?p=36648:60
Markus -
Candlestick chart problem with multiple series
Hello,
I added one mx:CandlestickSeries object and couple additional
mx:LineSeries objects to the chart. All series are represented but
still I have one problem. More series I add - less candles are
becoming of CandlestickSeries data. It seems that there should be
any scaling option for all series in the chart or something like
this, but I cannot find it. I'm still new in Flex Can anyone halp
me with this?
Thanx in advance
marukasI've added screenshots to get better view of the problem.
Here is chart with addtional series:
Chart
with multiple series
And here nothing is changed except that additional line
series were removed:
Chart
with only one CandlestickSeries
Is it possible to get the same candles as in 2nd view with
addiotnal series added? -
Creating SVG Chart with multiple lines
Hi All,
I want to create a chart with multiple lines.
Ex: I have one emp table with empno, sal and deptno columns.
I want to print deptno in x axis and no of employees on y axis.
I want to print one line for employees with sal > 15000 and one more line for employee with sal =< 15000
So one line will show no of employees with sal more than 15000 for each dept. Similar case for the other line and these 2 lines should be in different colors.
For one line the query will go as
select link, deptno, count(empno)
from emp where sal > 15000 group by null, deptno
Is this possible to draw this chart?
Thanks,
ManojI wasn't able to do something like what you describe, but I was able to do this:
I defined column A of the table as a Header Row, selected the cells in the table, and chose this chart type (2D 2 Axis):
Then I clicked the chart and in the pane at the right checked 'Axis Name' in the Axis tab and added the axis names.
Maybe this can give you an idea of how you can illustrate the relationships that you want to show.
SG -
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,
ChrisHello,
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/ -
Multiple Line Charts with Column Chart
I want to show two line charts with a column chart. Everything goes on the screen fine, except the two line charts origination point always starts at the same point despite the numbers being different. For example, the ls1 might read 280, 190, 180 and the ls2 is 175, 188, 177 but both origination points start at 280. The other two datapoints should also be close together but they have a substantial gap of about 50 between them. Obviosuly I want to have two separate lines. I have also tried moving the line series below the first lines series with no success.
<mx:ColumnChart dataTipFunction="formatDataTip"id="
myChart" dataProvider="
{FCVData}" showDataTips="
true"selectionMode="
single"change="event.stopImmediatePropagation()"
width="
100%" height="95%" y="50">
<!-- vertical axis -->
<mx:verticalAxis>
<mx:LinearAxis title="mytitle" labelFunction="defineVerticalLabel"id="
v1"baseAtZero="
true" />
</mx:verticalAxis>
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="
{MYData}" categoryField="
YEAR"
/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries id="
pb"color="
#FFFFFF"xField="
YEAR" yField="B
UDGET" displayName="
Budget"hideDataEffect="
zoomOut" showDataEffect="
zoomIn">
<mx:fill>
<mx:SolidColor color="{colColor1}"/>
</mx:fill>
</mx:ColumnSeries>
<mx:LineSeries id="ls2" dataProvider="
{MYData}" yField="
ACTUAL"displayName="
Actual"
>
<mx:itemRenderer>
<mx:Component>
<mx:DiamondItemRenderer/>
</mx:Component>
</mx:itemRenderer>
<mx:lineStroke>
<mx:Stroke color="
{lineColor2}" weight="
5" alpha="
.5"
/>
</mx:lineStroke>
<mx:verticalAxis>
<mx:LinearAxis id="v3" baseAtZero="true"/>
</mx:verticalAxis>
</mx:LineSeries>
<mx:ColumnSeries
id="
asytd"color="
#FFFFFF"xField="
YEAR" yField="
SPEND" displayName="
Spend "hideDataEffect="
zoomOut" showDataEffect="
zoomIn">
<mx:fill>
<mx:SolidColor color="{colColor2}"/>
</mx:fill>
</mx:ColumnSeries>
<mx:LineSeries id="ls1" dataProvider="
{MYData}" yField="
PLAN"displayName="
Plan"
>
<mx:itemRenderer>
<mx:Component>
<mx:CrossItemRenderer/>
</mx:Component>
</mx:itemRenderer>
<mx:lineStroke>
<mx:Stroke color="
{lineColor1}" weight="
5" alpha="
.5"
/>
</mx:lineStroke>
<mx:verticalAxis>
<mx:LinearAxis title="title" id="v2" baseAtZero="true"/>
</mx:verticalAxis>
</mx:LineSeries>
</mx:series>
<mx:verticalAxisRenderers>
<mx:AxisRenderer placement="left" axis="{v1}"/>
<mx:AxisRenderer placement="right" axis="{v2}"/>
<mx:AxisRenderer visible="false" placement="right" axis="{v3}"/>
</mx:verticalAxisRenderers>
</mx:ColumnChart>Hi,
Still Trying:
I've now got this code to function:
var i:int = 0;
for each (var cat:* in event.result.chart.categories.category){
//mx.controls.Alert.show(cat.label);
var z:int = 0;
for each (var valuee:* in event.result.chart.dataset){
//mx.controls.Alert.show(event.result.chart.dataset[z].seriesName);
//mx.controls.Alert.show(valuee.sete[i].value);
z++;
i++
which works fine, how can I get in into Array to make a dataset for the flex charts?
Thanks,
Elad -
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> -
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!
SabineHi,
Youll 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 -
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
jimYou 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
Maybe you are looking for
-
How to create drive partition in window 8.1
i have number of doubt on partition of disk management. i have new dell laptop, little difficult to using the same and i want to partition of the c disk and want to create d disk, but i unable to perform the same. when i click to the shrink volume an
-
I want to have access to some PDF's and pictures for example on my iPad when i saved it to iCloud on my MacBook. Is that possible? How? (Sry for my bad English, I'm from Germany and didn't use iCloud before )
-
Problem with USB port in HP 15-G009AX
I have a HP 15-G009AX notebook with windows 8.1 (64 bit). Previously all USB ports were working fine when I had the 32 bit version of windows 8.1. After installing the 64 bit version, one of the USB 2.0 ports on the right hand side is not working pro
-
Ff 4b12 no longer prints properly - adds multiple spaces between characters
b11 worked great. printing from gmail to either my HP 1022N or to primo pdf now adds the extra spaces. IE works fine as does FF3.6.13. How do I go back to 4.b11 until this is resolved?
-
Hi, I can't find it myself: I have a server connected to the internet with a static IP adress. My internetprovider registered a domainname that points to my IP-adress (mydomain.com) Unfortunately I made a typo. Bad luck. I keep finding the wrong doma