Articles in this section

How to display images for data points in a WinForms Chart

In the  WinForms Chart control, you can display images for data points by using an ImageList control. This allows you to add images to series symbols by setting the ChartSymbolShape  property to Image and specifying the image using the ImageIndex property within ChartSymbolInfo class.

Steps to display Images for data points


Step 1: Adding an ImageList control to your form.

ImageList imageList = new ImageList(); 
imageList.ImageSize = new Size(15, 15);
imageList.Images.Add(Image.FromFile("Resources\\Flower.png")); 
imageList.Images.Add(Image.FromFile("Resources\\Star.png"));
Dim imageList As New ImageList()
imageList.ImageSize = New Size(15, 15)
imageList.Images.Add(Image.FromFile("Resources\Flower.png"))
imageList.Images.Add(Image.FromFile("Resources\Star.png"))
Step 2: Setting the ChartSymbolShape  to Image
series.Style.Symbol.Shape = ChartSymbolShape.Image;
series.Style.Symbol.Shape = ChartSymbolShape.Image
Step 3: Assigning images using the ImageIndex property of the ChartSymbolInfo  class.
series.Style.Images = new ChartImageCollection(imageList.Images);
series.Style.Symbol.ImageIndex = 1; // Index of image in ImageList
series.Style.Symbol.Size = new Size(15, 15);
series.Style.Images = New ChartImageCollection(imageList.Images)
series.Style.Symbol.ImageIndex = 1 ' Index of image in ImageList
series.Style.Symbol.Size = New Size(15, 15)

Output:


Display images for data points in a WinForms Chart




Conclusion

I hope you enjoyed learning about how to display images for data points in WinForms Chart.

You can refer to our WinForms Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied