+ Reply to Thread
Results 1 to 11 of 11

Show Tasks as Lines and Show Time Points' bars on X-Axis

  1. #1
    Registered User
    Join Date
    05-02-2016
    Location
    India
    MS-Off Ver
    office 365
    Posts
    12

    Show Tasks as Lines and Show Time Points' bars on X-Axis

    Hello,

    Need Chart.PNG

    I want to Show Tasks as Lines, specified with Duration at specified height.

    Along with that, I want to show some points of a day viz. Sunrise, Sunset etc Verically as bar on X-Axis.

    Both Lines and Bars should reflect Date-Time as specified in Data and not at equivalent distance.


    I have figured out exactly what I need in a picture attached.

    Any help on this is welcomed.

    Thank You
    Last edited by pjvyas; 09-25-2019 at 10:25 AM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Show Tasks as Lines and Show Time Points' bars on X-Axis

    It looks to me like an XY scatter chart should do this just fine. Are you familiar with creating scatter charts (https://support.office.com/en-us/art...5-104A9018B86E )? Since your data includes date/time information, are you familiar with how Excel stores dates/times as serial numbers (http://www.cpearson.com/Excel/datetime.htm )?

    Assuming your date/time stamps are true numbers/dates/times (and not text strings), then I would expect to do something like:
    1) I need to add the ending date/time and position for the D segment. Enter/calculate the ending time for D in G7 and Enter 20 in I7.
    2) Select G3:G7,I3:I7 and insert a scatter chart. Check that Excel created the chart correctly (with column G as the X values and column I as the Y values).
    3) Select the data series -> Format series -> somewhere in the format series dialogs (in 2007 it is under "marker fill") is a "vary colors by point" option. You should now have the horizontal, multicolored line that indicates each task.

    For the vertical lines, we can add a second data series, add vertical error bars to that series, and format the error bars.
    4) This data series will also need an arbitrary height value to position the points in the chart. In D2:D8, enter 30 (or whatever seems appropriate).
    5) Select the chart -> bring up the Select Data dialog -> Add data series -> B2:B8 as the X Values for the new series and D2:D8 as the Y values for the new series.
    6) Select the new data series and add error bars (In 2007, this is on the Chart -> Layout menu). 2007 will add both vertical and horizontal error bars. Delete the horizontal error bars.
    7) Select the vertical error bars -> Format -> negative error bars only and set them to 100% -> other formats as desired.
    8) Add data labels to the new data series and enter the appropriate text in those data labels. 2007 does not support "values from cells" for the data labels, so you will need to manually enter the text for each data label, or use an external utility like Rob Bovey's free XY chart labeler add-in (appspro.com ). Newer versions (starting in 2013, I believe) have built in support for data labels from cells.

    That should get you something very close to what you show in the picture.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    05-02-2016
    Location
    India
    MS-Off Ver
    office 365
    Posts
    12

    Re: Show Tasks as Lines and Show Time Points' bars on X-Axis

    Hi,
    I raally appreciate your quick reply.
    It helped me. But please take a look, I have attached another picture with example; added things as you said.


    1 Added Ending point for D in G7. Also Height in i7.
    2 Added Height for second data series' points as you said but labels couldn't show on the X-Axis, So tried putting height 0 and set error bar to Plus; for specific value; added new column E.

    BUT Still Missing:
    1 How to show Four Horozontal Lines A, B, C, D? I want to format each of them differently.
    2 Removing Grid also removes the bottom line at 0 crossing all the Labels.
    3 Is there any alternative to Error Bar? Because it does not let me format Each error bar differently. I want to make Sunrise Bar as Yellow.

    Attachment 642844

    Thank You

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Show Tasks as Lines and Show Time Points' bars on X-Axis

    Attachment must not have attached properly. Make sure you are clicking on "go advanced" and then finding the "manage attachments" link to bring up the working file uploader.

    1) You did not find a "vary colors by point" option when formatting the data series? Of course, you can always select each data point/segment (click on the series once to select the series, then click on the desired data point to select the point/segment) and bring up the format data point dialog and change line color that way. You will need to repeat the process for each segment. Alternatively, you can add each segment as its own data series. It all depends on exactly what you are trying to do here (and maybe why you are unable to have Excel automatically vary colors by point).

    2) Not sure what you mean here (because I can't see the new picture, probably). It suggests that you have the chart formatted to not display the horizontal axis. If that is the case, add the axis back into the chart.

    3) A few alternatives other than error bars. Add each desired "error bar color" as a separate data series. Or use start and end points for the vertical lines, which you can then format just like you did for the four horizontal lines the first data series. The basic idea is described here: https://peltiertech.com/Excel/Charts/AddLine.html

  5. #5
    Valued Forum Contributor
    Join Date
    10-14-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    353

    Re: Show Tasks as Lines and Show Time Points' bars on X-Axis

    Chart type Bars will do the job:
    Only the data labels should be fixed

    Barchart.JPG
    Attached Files Attached Files
    Kind regards,
    Piet Bom

  6. #6
    Registered User
    Join Date
    05-02-2016
    Location
    India
    MS-Off Ver
    office 365
    Posts
    12

    Re: Show Tasks as Lines and Show Time Points' bars on X-Axis

    Hello,
    Thanks for reply.

    I am attaching Both Picture as well as Excel file.

    1. Yes I tried vary by color option, it changed the Markers' color but I then click on solid line but it didn't separate 4 lines but became one line.
    Then I again choose no line. But now the Vary by color option is not shown where it was earlier.

    2. Yes, I have removed axis as It was showing non-required Date&times. I can bring back the axis but how to not-show those default data labels?

    3. Will Try this...and will be back.

    Thanks
    Attached Images Attached Images
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-02-2016
    Location
    India
    MS-Off Ver
    office 365
    Posts
    12

    Re: Show Tasks as Lines and Show Time Points' bars on X-Axis

    Hi PietBom,

    I tried that but seems complicated. Is there any alternate method?

    1. I want to Show Tasks as formatable Lines, specified with Duration at specified height.

    2. Along with that, I want to show some points of a day viz. Sunrise, Sunset etc Verically as formatable bars on X-Axis.

    3. Both Lines and Bars should reflect Date-Time as specified in Data and not equidistant.

    Thannks
    Last edited by pjvyas; 09-28-2019 at 11:33 AM.

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Show Tasks as Lines and Show Time Points' bars on X-Axis

    1) (vary colors by point). I'm not sure I understand exactly what you tried. When I tested it, I created the chart as an XY scatter lines without markers and checked the vary colors by point option, and Excel gave me a different color for each segment. I have never seen that option disappear from the format axis dialog, so I cannot comment on why Excel is not allowing you to format the series the way you describe. The option is there for me in 2007 and gives a result very similar to your desired picture. Since your copy of Excel 2007 (you are using 2007 like your profile indicates, right?) seems to be behaving differently from mine, I'm not sure what recommendation to make.

    2) (Axis labels). Somewhere in the format axis dialog is a drop down with your axis labels options. The options are something like "none -- low -- high -- next to axis". Simply choose none for the axis labels.

  9. #9
    Valued Forum Contributor
    Join Date
    10-14-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    353

    Re: Show Tasks as Lines and Show Time Points' bars on X-Axis

    I have no alternative method at this moment, sorry.
    But I modified the tool as you requested.
    VBA was used for some effects.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-02-2016
    Location
    India
    MS-Off Ver
    office 365
    Posts
    12

    Re: Show Tasks as Lines and Show Time Points' bars on X-Axis

    Thanks PietBom for your new Ideas.
    It gives the desired outputs; I don't say I am a Beginner but don't know advanced VBA.
    I tried to workout as MrShorty suggested and its done.
    Thanks so much for your help.
    Will be posting the final output in the other reply.
    Thanks

  11. #11
    Registered User
    Join Date
    05-02-2016
    Location
    India
    MS-Off Ver
    office 365
    Posts
    12

    Re: Show Tasks as Lines and Show Time Points' bars on X-Axis

    Hello MrShorty,

    Thanks for your elaborated replies.
    They really helped.


    1. I was creating lines with Marker; now it's ok. But still If I add new series to the chart, that option (vary colors by point) does disappear.

    2. Yes, Axis labels to "None" worked.


    I did as you said "....Or use start and end points for the vertical lines,"

    I had to make lot of series. Now all series are formatable.

    Still will have to try what happens if I add new rows of Input. (Please check the excel file attached and give your view if there is better way.)

    Thanks a lot for Your Help.
    Attached Images Attached Images
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 9
    Last Post: 10-17-2017, 12:22 PM
  2. Replies: 2
    Last Post: 10-19-2015, 02:59 AM
  3. [SOLVED] Show Required Tasks
    By SeagullWardy in forum Excel General
    Replies: 2
    Last Post: 06-12-2012, 02:23 PM
  4. A way to show conflicting start/end date tasks
    By garricko in forum Excel General
    Replies: 2
    Last Post: 05-05-2010, 08:11 PM
  5. Show Data Lables show Amount & Persentage at the same time
    By ComcoDG in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-29-2008, 04:54 AM
  6. Replies: 1
    Last Post: 08-29-2006, 07:21 AM
  7. [SOLVED] Function to show percentage of tasks complete
    By Mirthrindr in forum Excel General
    Replies: 1
    Last Post: 07-31-2006, 09:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1