Hi,
I have requirement in which I need to give different colors to Grid Lines in Left Axis.
Can you help me on this ?
Thanks,
CS
Assign different Color to GridLine for Axis in Line Graph
Assign different Color to GridLine for Axis in Line Graph
- Attachments
-
- Color.JPG (22.66 KiB) Viewed 3975 times
Re: Assign different Color to GridLine for Axis in Line Graph
Hi CS,
I'd recommend you to hide the grid lines and use ColorLine tools to draw each line in the color you want. For example:
I'd recommend you to hide the grid lines and use ColorLine tools to draw each line in the color you want. For example:
Code: Select all
Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.AddSeries scFastLine
TChart1.Series(0).FillSampleValues
TChart1.Axis.Left.GridPen.Visible = False
TChart1.Environment.InternalRepaint
Dim i As Integer
For i = 0 To TChart1.Axis.Left.Labels.Count - 1
TChart1.Tools.Add tcColorLine
With TChart1.Tools.Items(i).asColorLine
.Axis = TChart1.Axis.Left
.Value = TChart1.Axis.Left.Labels.Item(i).Value
.Pen.Color = RGB(Rnd * 254, Rnd * 254, Rnd * 254)
End With
Next i
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |