Search code examples
activexteechart

Line Chart Pointer color Change


I am using the pointer '+' in my code. In the legend it is displayed in black color.I want that to be displayed as legend color.

If I change the property from editting=>series=>pointer=>default- TRUE it works fine for me. Can you let me know how this can be achieved through code.

Thanks Akshay


Solution

  • I'm not 100% sure about your which is your exact question. If I understood correctly you should change pointer's pen color:

    TChart1.Series(0).asLine.Pointer.Pen.Color = TChart1.Series(0).Color
    

    A complete VB6 example:

    Private Sub Form_Load()
        TChart1.Aspect.View3D = False
    
        TChart1.AddSeries scLine
        TChart1.Series(0).FillSampleValues 10
        TChart1.Series(0).asLine.Pointer.Visible = True
        TChart1.Series(0).asLine.Pointer.Style = psCross
        TChart1.Series(0).asLine.Pointer.Pen.Color = TChart1.Series(0).Color
    End Sub
    

    If this doesn't help please provide more detailed information about your requirements.