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.
Unfortunately, activation email could not send to your email. Please try again.

Add an arrow and a label to a radar chart

Thread ID:

Created:

Updated:

Platform:

Replies:

126389 Oct 12,2016 02:35 PM Oct 19,2016 08:35 AM Windows Forms 9
loading
Tags: Chart
Nicolas
Asked On October 12, 2016 02:35 PM

Hi, I would like to know if it is possible to add an arrow with its origin at the origin of the radar chart, and end-point at the edge of the Circle axis style, at a given angle, and attach a label to it (end point of the arrow) - Thanks in advance! - Nicolas

Nicolas
Replied On October 13, 2016 12:12 AM

Got the arrow fixed using Drawline and FillPolygon methods, if you have a better way, let me know! However, there are some questions left unanswered
- How to place a custom label at a given pointF on the chart;
- How to place a custom label on each point of a scatter diagram;

Thanks in advance! - Nicolas


Dharanidharan Dharmasivam [Syncfusion]
Replied On October 13, 2016 08:50 AM

Hi Nicolas, 

Thanks for using Syncfusion product. 
We have analyzed your query and we have created sample with respect to your requirement. In this by using Callout feature you can add custom label. Find the code snippet below, 

Code snippet: 
Windows forms: 

  //... 
    series.Style.DisplayText = true; 
    series.Style.Callout.Enable = true; 
    series.Style.Callout.DisplayTextAndFormat = "custom text"; 
    //... 


In the sample we have added custom label to all the points in the series. If you want you can add custom label to specific point also and you can place it anywhere in the chart by click and drag on the custom label. 

Screenshot: 
 

For your reference we have attached the sample. Kindly find the sample from below location, 
If this is not your scenario, kindly revert us. 

Thanks, 
Dharani. 


Nicolas
Replied On October 14, 2016 12:46 AM

Hi Dharanidharan, the item 1 (How to place a custom label at a given pointF on the chart - this can be any chart like scatter or radar, ...) has been left unanswered, and I will clarify, I would like to add several different labels, and be able to control its font, orientation, etc.

As for the answer you gave for the item 2 (How to place a custom label on each point of a scatter diagram), this does not help as the label is the same for all points. I would like to be able to add a 3rd value dynamically, say the client name related to this data. If it is not possible in the current configuration, maybe I could use this labeling but I would need to generate new series in the iteration

Thank you! - Nicolas

Nicolas
Replied On October 14, 2016 12:55 PM

Please consider Item 2 as closed, I used iteration which worked out, leaving Item 1 - Thanks! - Nicolas

Dharanidharan Dharmasivam [Syncfusion]
Replied On October 17, 2016 04:29 AM

Hi Nicolas, 
 
Thanks for your update and sorry for the inconvenience caused. 
We have prepared sample with respect to your requirement. You can add custom labels at specific point using CustomPoint feature. Kindly find the code snippet below, 
 
Code snippet: 
Windows forms: 
 
             //... 
            ChartCustomPoint cp1 = new ChartCustomPoint(); 
            //specify the required text 
            cp1.Text = "CustomText1"; 
            //specify custom point type as chart coordinates to place the custom text at any location in the chart 
            cp1.CustomType = ChartCustomPointType.ChartCoordinates; 
            //specify the coordinates to place the custom label in chart 
            cp1.XValue = 100; 
            cp1.YValue = 58; 
            //customize the custom label  
            cp1.Color = Color.Red; 
            cp1.Font.Size = 13; 
            cp1.Font.FontStyle = FontStyle.Italic; 
            this.chart.CustomPoints.Add(cp1); 
            //... 
 
 
Screenshot: 
 

For your reference we have attached the sample, Kindly find the attachment from below link, 
  
Thanks, 
Dharani. 



Nicolas
Replied On October 17, 2016 06:01 PM

Works like a charm! I was firstly a bit confused as I thought the coordinates in question were the ones for the control, but soon realized that these coordinate are those used in the chart and defined by the range. So this label works great for any label to be placed inside the chart. After some trial and errors, I noticed that the text will disappear when exceeding the chart edge, so here comes a sub-question - do you have an alternate way of placing a label for all regions of the control - thanks in advance! - Nicolas

Dharanidharan Dharmasivam [Syncfusion]
Replied On October 18, 2016 07:24 AM

Hi Nicolas, 
 
Thanks for your update. 
The behavior of customPoint feature is to render the text within the chart area only. As a workaround, by using the paint event, you can place the text for all regions of the control. Kindly find the code snippet below, 
 
Code Snippet: 
private void Form1_Load(object sender, EventArgs e) 
        { 
            this.chart.Paint += Chart_Paint; 
            //...  
        } 
private void Chart_Paint(object sender, PaintEventArgs e) 
        { 
            this.DrawString(e.Graphics, 10.0F, 80.0F); 
        } 
public void DrawString(Graphics formGraphics, float x, float y) 
        { 
            string drawString = "Custom Text 1"; 
            string drawString2 = "Custom Text 3"; 
            System.Drawing.Font drawFont = new System.Drawing.Font("Arial", 16); 
            System.Drawing.SolidBrush drawBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black); 
            System.Drawing.StringFormat drawFormat = new System.Drawing.StringFormat(); 
            formGraphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat); 
            formGraphics.DrawString(drawString2, drawFont, drawBrush, x, y+160,drawFormat); 
            drawFont.Dispose(); 
            drawBrush.Dispose(); 
        } 

Screenshot: 
 
For your reference we have attached the sample. Kindly find the sample from below location, 
  
Thanks, 
Dharani. 


Nicolas
Replied On October 18, 2016 12:50 PM

That works great! Additionally, we can rotate the text at a given angle using formGraphics.RotateTransform, and place it using TranslateTransform, a bit of headache there, but still  Thank you! - Nicolas

Dharanidharan Dharmasivam [Syncfusion]
Replied On October 19, 2016 08:35 AM

Hi Nicolas, 
 
Thanks for your update. Kindly revert us, if you require further assistance on this. 
 
Thanks, 
Dharani. 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;