We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ChartCustomPoint with image

Dear Support,
I'm trying to add ChartCustomPoints to a Line Chart using following code snippet, but nothing is drawn.

ChartImageCollection m_Imgs = new ChartImageCollection(this.imageList1.Images);

ChartCustomPoint cp = new ChartCustomPoint();
p.Text = "text";
cp.XValue = 10;
cp.YValue = 10;
cp.Images = m_Imgs;
cp.Symbol.ImageIndex = 0;

cp.Alignment = ChartTextOrientation.Smart;
this.oChartControl.CustomPoints.Add(cp);

The imageList1 is
private System.Windows.Forms.ImageList imageList1;
filled with some png with following attribs
ColorDepth = Depth32bit,
ImageSize = 24x24


Where's my mistake?

Best regards

Domenico Mozzone
Setteidea - Italy


2 Replies

VK Vijayabharathi K Syncfusion Team November 2, 2010 10:31 AM UTC

Hi Setteidea,

Thank you for using Syncfusion products.

You can add image type to symbol property of custom points. We suggest you to set “ChartSymbolShape.Image” to symbol property of chart custom points. Kindly find the code snippet below to achieve this,

[C#]
cp.Images = new ChartImageCollection(this.imageList1.Images);
cp.Symbol.Shape = ChartSymbolShape.Image; // Set Image to shape property.
cp.Symbol.ImageIndex = 0;
cp.Symbol.Size = new Size(24, 24);

Let me know if you have any other concerns.

Regards,
Vijayabharathi K





DM Domenico Mozzone November 5, 2010 07:21 AM UTC

Thank you very much,
problem solved.

Domenico Mozzone
Setteidea srl - Italy


Loader.
Live Chat Icon For mobile
Up arrow icon