Share via

Scatter Plot Labeling with Images

Anonymous
2017-04-21T13:56:48+00:00

I found this bit of information on how to label a scatter plot here:  https://support.microsoft.com/en-us/help/213750/how-to-use-a-macro-to-add-labels-to-data-points-in-an-xy-scatter-chart-or-in-a-bubble-chart-in-excel

This is fantastic but does anyone know how to do exactly this, but instead of text labels have images as labels?

Thanks

-Mike Nelson

***Post moved by the moderator to the appropriate forum category.***

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2017-04-21T18:02:16+00:00

    Let's say that the path and filename for your images are located in the corresponding cells one column to the right of the series values, replace...

       For Counter = 1 To Range(xVals).Cells.Count

         ActiveChart.SeriesCollection(1).Points(Counter).HasDataLabel = _

             True

          ActiveChart.SeriesCollection(1).Points(Counter).DataLabel.Text = _

             Range(xVals).Cells(Counter, 1).Offset(0, -1).Value

       Next Counter

    with

        For Counter = 1 To Range(xVals).Cells.Count

            With ActiveChart.SeriesCollection(1).Points(Counter)

                .HasDataLabel = True

                With .DataLabel.Format.Fill

                    .UserPicture Range(xVals).Cells(Counter, 1).Offset(0, 1).Value

                    .Visible = msoTrue

                End With

            End With

        Next Counter

    Hope this helps!

    Was this answer helpful?

    0 comments No comments