• 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.

Color chart

kyjak555

New Member
hello can you help me?

if the value increases from the previous one, the graph turns blue and if it decreases to red.
 

Attachments

  • Zošit2.xlsx
    20.4 KB · Views: 6
By VBA only I think. One way; this macro is run when you click the button at cell Z3:
Code:
Sub blah()
Set myPoints = Sheets("v.B KW CP").ChartObjects("Graf 1").Chart.FullSeriesCollection(1).Points
For i = 2 To myPoints.Count
  With myPoints(i).Format.Line
    If myPoints(i).Top > myPoints(i - 1).Top Then
      .ForeColor.RGB = RGB(255, 0, 0)
    Else
      .ForeColor.RGB = RGB(0, 112, 192)
    End If
  End With
Next i
End Sub

See https://peltiertech.com/conditional-formatting-of-lines-in-an-excel-line-chart-using-vba/
 

Attachments

  • Chandoo47946Zošit2.xlsm
    28.1 KB · Views: 2
Last edited:
kyjak555
It can do without VBA too,
as shown in above link.​
Here a sample.

If You can get some nice formulas
- then those could get it with five series ( black bordered range ).
 

Attachments

  • Zošit2.xlsx
    23.7 KB · Views: 18
HI VLETM i need chart for all year from KW 1 to KW 52 can you do it?
 

Attachments

  • Zošit2 (2).xlsx
    26.7 KB · Views: 3
kyjak555
Lines will display after You have chosen Line from No line to Solid line
Screenshot 2022-06-27 at 17.42.46.png Screenshot 2022-06-27 at 17.42.53.png
Your original sample has less data and
Your newer sample has more data.
... then it could do this way too.
 

Attachments

  • Zošit2.xlsx
    27.1 KB · Views: 3
Back
Top