cancel
Showing results for 
Search instead for 
Did you mean: 

Start line chart from the origin

Former Member
0 Kudos

Hi,

I have input control to select the dates from and to. So the chart will display two lines, one current year and other previous year.

Say i select dates from September 2012 to June 2013, in this case the current year should start dates from Jan 2013 to June 2013 and previous year from September 2012 to June 2013. The line chart should start from the origin which is September 2012.

So the graph will be

Sept 2012 (Origin) -  line1

Oct 2012             - line1

Nov 2012  - line1

Dec 2012 - line 1

Jan 2013 - line 2

Feb 2013 - line 2

Mar 2013 - line 2

Apr 2013 - line 2

May 2013 - line 2

Jun 2013 - line 2

Appreciate your help.

Thanks,

Arun

Accepted Solutions (0)

Answers (1)

Answers (1)

arijit_das
Active Contributor
0 Kudos

Navigate to assign data in the chart and use [Year] object in Region Color.

Former Member
0 Kudos

That's what i am doing now, but it doesn't work.

For example - if my selection is from 2015.03.10 (Mar-10) to 2015.11.30 (Nov-30), the origin of the graph should be 2015.03.10 or Mar -10.

So the previous year line from march will show from March 10 to March 30 and the current year (2015) will only show until 24th March that's today. But the origin is March 10.

arijit_das
Active Contributor
0 Kudos

Do you need something like this:

Former Member
0 Kudos

Thats what i have currently. I need like this -

Red line is the current year and yellow line is the previous year.

0 Kudos

Hi Arun,

I'd suggest to define "Year" and "Month" separately e.g. in the database or using variables.

If doing so, you will get the result like this, when drag and drop the objects on the graph (reproduced with eFashion).

Note: I didn't use Input control here....so this solution isn't correct.

However I've tested further, and if you are using the returned strings

"Year" =FormatDate([Invoice Date];"yyyy")

and

"Month"=Month([Invoice Date])

in the graph, but using the input control on the date type "Date" you'll get the following:

Br,

Mark

arijit_das
Active Contributor
0 Kudos

You need to separate year from date before using the date in x-axis. For example, v_Date=FormatDate([DateObject];"dd-Mmm") and use v_Date in x-axis with year object in region color.

To sort the date values correctly, you need to create a key =FormatDate([DateObject];"MMdd") and use it in x-axis along with v_Date. Apply sort on the key and then hide the key dimension.

Former Member
0 Kudos

Hi Mark,

Thank you for your reply. Your example gives all the months in a year, but i don't need that.

For example if i am selecting from March to Novermber the origin should be March month.

So the graphs of previous year will have values from March to November where as current month will have only until till date so the graph look like below (Red current year and Yellow previous year)-

Thanks,
Arun

Former Member
0 Kudos

Replied as above.

Former Member
0 Kudos

It works for me as long as i select months in the same year say FEB to NOV of 2014.

When i select months across years like Feb of 2014 to Feb of 2015 then the chart goes blank.

My design is like this.

- I have three query for each year and merged as one. In the assign data category axis is month and region is year.