• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Timeline Chart - Milestones Conditional Format

jonastiger

Member
Hi
I'm running Excel 2019
I wonder if is it possible to apply conditional format to milestones in a timeline chart.

I attached a sample created over a template I took from chandoo.org and it is similar to my own file

Thank you in advance for your time
 

Attachments

  • project-timeline_sample.xlsx
    14 KB · Views: 4
Like this?:
72240
If so then a macro blah which calls another with arguments:
Code:
Sub blah()
FormatLabels "Project Milestones in Time Line", "Chart 1", "Series2"
End Sub

Sub FormatLabels(SheetName, ChartName, mySeriesName)
With Sheets(SheetName).ChartObjects(ChartName).Chart
  Set DLabelRng = Range(Split(.FullSeriesCollection(CVar(mySeriesName)).Formula, ",")(1)).Offset(, 1)
  cllNo = 1
  For Each dlbl In .FullSeriesCollection(2).DataLabels
    With dlbl.Format
      .Fill.ForeColor.RGB = DLabelRng.Cells(cllNo).Interior.Color
      .TextFrame2.TextRange.Font.Fill.ForeColor.RGB = DLabelRng.Cells(cllNo).Font.Color
    End With
    cllNo = cllNo + 1
  Next dlbl
End With
End Sub
Click button at cell D30 in the attached.
You can also include the text of the Installation column in the labels as well.
 

Attachments

  • Chandoo45364project-timeline_sample_01.xlsm
    21.8 KB · Views: 4
Thank you very much for your help. It's a very good approach, but I had something different in mind (may be my explanation was wrong). Instead labels, I would like to apply format conditional to the marks.
Is that possible?
 
I did try that at first but I could only change all the marks to the same colour, not individually.
What you could do is add another line chart on top of the existing one and adjust its markers.
I've just noticed the Dummy series values could be sourced from the height column instead of the column of zeroes, but I don't what the function of the column of zeroes is about - could you point me to where you got this template from so I don't mess up its functionality.
In haste, I applied a dirty fix to the attached; press the button.
 

Attachments

  • Chandoo45364project-timeline_sample_02.xlsm
    21.7 KB · Views: 3
Last edited:
jonastiger
You're using term Conditional Formatting ... with Marks ...
Instead of above term ...
this sample will refresh Markers colors as D-column after You've clicked Your chart.
I left Your original version named with (2)-ending.
 

Attachments

  • project-timeline_sample.xlsb
    24.8 KB · Views: 14
Back
Top