Labels displaying outside series element

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Newbie
Newbie
Posts: 4
Joined: Tue Dec 11, 2018 12:00 am

Labels displaying outside series element

Post by » Thu Oct 24, 2019 3:38 pm

Hi,

Last year I upgraded TeeChart from the 2012 version to the 2017 one. Everything went fine until now a client noticed that on some chart elements the labels that were displaying inside the chart element now are displaying outside them (below). When doing the upgrade I didn't notice it so probably I did not check it. The code for the labels hasn't changed and it's the same alignment. Below is an example of the code for the labels:
currElement.AddLabel(new CChartClasses.CSeriesLabel(currBlock.getCbeoRouteGroupRef().IB.getUKey() + "-" + currBlock.getUKey(), CChartInterfaces.eSeriesLabel.eHAlignCentre, CChartInterfaces.eSeriesLabel.eVAlignCentre));
I attached 2 examples of charts, TeeChart Example - 2012 and TeeChart Example - 2017 which show how the labels are displayed with the TeeChart.dll from 2012 and 2017 (display code is the same).
Is there a setting or something else that needs to be set/done in the newer version in order to display the labels like before?

Thank you
Attachments
TeeChart Example - 2012.jpg
Uses TeeChart version from 2012
TeeChart Example - 2012.jpg (203.77 KiB) Viewed 16855 times
TeeChart Example - 2017.jpg
Uses TeeChart version from 2017
TeeChart Example - 2017.jpg (92.87 KiB) Viewed 16855 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Labels displaying outside series element

Post by Christopher » Fri Oct 25, 2019 6:56 am

Hello,

of course we will look into this issue, and in order to do so it would be very helpful to us if you could create a minimal, reproducible example (e.g. here) with which we can visualize the problem. Please feel free to use our upload service for this example project.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Newbie
Newbie
Posts: 4
Joined: Tue Dec 11, 2018 12:00 am

Re: Labels displaying outside series element

Post by » Tue Oct 29, 2019 8:37 pm

I don't have a small program yet but I have another example with the dll from 2017. Second picture shows the chart with no zoom in (original) and in the first one I zoomed in. You will notice that with one exception, which would be corrected if I zoom more in, the labels get inside as they should be from the beginning (with the 2012 version they are inside). Any ideas? This is a different chart than the previous one. For the previous one zooming in doesn't help, the labels still stay outside.

Thank you.
Attachments
TeeChart Example - 2017 - Zoomed In.jpg
Zoomed in
TeeChart Example - 2017 - Zoomed In.jpg (72.63 KiB) Viewed 16799 times
TeeChart Example - 2017 - No Zoom In.jpg
Original chart, no zoom in
TeeChart Example - 2017 - No Zoom In.jpg (115.51 KiB) Viewed 16799 times

Newbie
Newbie
Posts: 4
Joined: Tue Dec 11, 2018 12:00 am

Re: Labels displaying outside series element

Post by » Wed Oct 30, 2019 8:54 pm

Hi,

I added a small project that I got from one of the forums and modified. This applies mostly to the message and attachments I added the second time where the labels didn't fit inside the Gantt charts and were displayed under them but after zooming in they displayed inside the charts. The example shows how when the form opens and it's not big enough some longer labels are displayed under the charts. The issue here is that in my application when I used the 2012 TeeChart dll the labels did fit inside the charts but now with the 2017 TeeChart dll they no longer fit and some are displayed under the charts. Can something be done about it?
Attachments
TeaChaDemo.zip
Zipped project
(11.1 KiB) Downloaded 1037 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Labels displaying outside series element

Post by Christopher » Thu Oct 31, 2019 9:07 am

Can something be done about it?
I think so. I beleive the Marks.AutoPosition property wasn't in the v2012 version, so turning that off seems to replicate what you had, at least here.

Code: Select all

    Steema.TeeChart.Styles.Gantt ganttSeries1;

    public Form1()
    {
      InitializeComponent();
      InitializeChart();

      ganttSeries1.Marks.AutoPosition = false;
    }

    String[] heatNumber;

    private void InitializeChart()
    {

      this.m_chart.Aspect.View3D = false;
      m_chart.Walls.Visible = false;
      m_chart.Legend.Visible = false;
      // this.m_chart.Header.Text = "Available number of heats";
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Newbie
Newbie
Posts: 4
Joined: Tue Dec 11, 2018 12:00 am

Re: Labels displaying outside series element

Post by » Thu Oct 31, 2019 3:34 pm

Hi Christopher,

Setting the AutoPosition property to false like you suggested fixes all of the problems I had.
Thank you very much for your help.

Post Reply