Search code examples
c#vb.netmschart

Custom MarkerStyle in MS Chart Control


How can I use alphabets as MarkerStyle in MS Chart control using VB.Net? The defaults (square, triangle, circle, etc.) are insufficient.

Select Case UCase(strCharSymbol)
    Case "+"
        .MarkerStyle = MarkerStyle.Cross
    Case "0", "O"
        .MarkerStyle = MarkerStyle.Circle
    Case "*"
        .MarkerStyle = MarkerStyle.Star10
    Case "^"
        .MarkerStyle = MarkerStyle.Triangle
    Case "#"
        .MarkerStyle = MarkerStyle.Square
    Case Else
        .MarkerStyle = MYCUSTOMMARKER(strCharSymbol)
End Select

Solution

  • The MarkerStyleare fixed and cannot be customized. But still you can use the MarkerImage property to set an image as an marker.

    To achieve your goal, you have to create alphabet images and give their path in the MarkerImage property. In your code, do the below change.

    Case Else
        .MarkerStyle = MarkerStyle.None;
        .MarkerImage = 'Path of the image