Hi Nick,
Thanks for contacting Syncfusion support. We have analyzed your queries. Please find the response for your queries below.
Query1: I would like the title text as close as possible to the top of the first layout
Answer: We can place the chart title at the desired position in the chart area using the below code.
[C#]
chartControl1.Title.Position= Syncfusion.Windows.Forms.Chart.ChartDock.Floating;
chartControl1.Title.Location = new Point(180, 0); |
In the above code, we have set the title position as floating and set the location as (180,0). Now the chart title will be place at 180px from left and 0px from the top margin. Please find the below screenshot.
Query2: By default, ChartAreaMargin is 10,10,10,10 and if I try to change the Top value via code, the default seems to still overriding my value. I had to change the value from the designer to have it stick. Is this normal behaviour?
Answer: Before we proceed further, we would like to explain that, ChartAreaMargin is space between border and chart. Please find the below screenshot.
In the above screenshot, we have set the border style as fixedsingle. Now we can see that 10px space is given between the border and chart.
Using below code we have set ChartAreaMargin as 0,0,0,0.
[C#]
chartControl1.ChartAreaMargins.Top = 0;
chartControl1.ChartAreaMargins.Bottom = 0;
chartControl1.ChartAreaMargins.Left = 0;
chartControl1.ChartAreaMargins.Right = 0;
chartControl1.Title.Position = Syncfusion.Windows.Forms.Chart.ChartDock.Floating;
chartControl1.Title.Location = new Point(180, 0); |
Please find the output of the chart below.
In the below link, we have attached sample for your reference.
If you are still facing any concern, please let us know by attaching the sample in which reported issue is occurring. And also, details about Essential studio version which you are using. This would be helpful for us to provide the solution that meet your requirement.
Regards,
Sanjith.