Overlapping series marks

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Mark G
Newbie
Newbie
Posts: 5
Joined: Mon Dec 24, 2012 12:00 am

Overlapping series marks

Post by Mark G » Fri Mar 22, 2013 8:42 pm

I have 3 vertical bar series, side stacked, with marks visible (above the bar) with the "Auto Mark Position" option checks. Often, the marks overlap making the values unreadable. Is there a way to ensure that the marks will not overlap? Or maybe to hide the marks and show them only when the mouse hovers over a bar? I would prefer to have them always visible, but I am getting complaints about the overlapping values making the chart unreadable.

Thanks-

Mark

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Overlapping series marks

Post by Sandra » Mon Mar 25, 2013 11:38 am

Hello Mark,

To avoid that marks overlap when you use stack marks I recommend use property of MarksOnBar that allow you draw the marks on the bar, as do in next lines of code:

Code: Select all

  public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Styles.Bar bar1, bar2, bar3;
        private void InitializeChart()
        {
            bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            bar2 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            bar3 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            bar1.FillSampleValues(5);
            bar2.FillSampleValues(5);
            bar3.FillSampleValues(5);
            bar1.MarksOnBar = true;
            bar2.MarksOnBar = true;
            bar3.MarksOnBar = true;
            
            bar1.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
        }
On the other hand, you have other options, one is use custom position of marks as do in next thread. Other option is use mark tips tool as do in the demo example All features\Welcome !\Tools\Mark tips that allow you show marks only when the mouse hover over a bar. If you have any problems please let me know.

I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Mark G
Newbie
Newbie
Posts: 5
Joined: Mon Dec 24, 2012 12:00 am

Re: Overlapping series marks

Post by Mark G » Mon Mar 25, 2013 2:14 pm

Putting the marks on the bars does not really work, as if the bars are the same height and the mark value is wider than the bar width (as when the numeric value is large) then the value still overlap. I will investigate your other options.

Thanks-

Mark

Post Reply