Scale And Marks

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
mikethelad
Newbie
Newbie
Posts: 58
Joined: Thu Jul 05, 2012 12:00 am

Scale And Marks

Post by mikethelad » Fri Jul 13, 2012 2:25 pm

On the sample graph I have set the scale to 0 to 100, by

WebChart1.Chart.Axes.Left.SetMinMax(0,100);

I want it be in qty's of 10 and not 5, ie 10,20,30 etc

Also

I wish to show the marks as values an not as per the bottom axis label, data is being added like:-

footer = mnth + "_" + year + "\n(n=" + totaln + ")";
line1.Add(7, footer);
Attachments
Graph.JPG
Graph.JPG (54.56 KiB) Viewed 10464 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Scale And Marks

Post by Narcís » Mon Jul 16, 2012 7:48 am

Hi mikethelad,
I want it be in qty's of 10 and not 5, ie 10,20,30 etc
You should set Increment property then:

Code: Select all

      tChart1.Axes.Bottom.Increment = 10;
I wish to show the marks as values an not as per the bottom axis label, data is being added like:-
You can set Label.Style like this:

Code: Select all

      tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
For further information about axis settings please read tutorial 4. Tutorials can be found at TeeChart's program group.
Best Regards,
Narcís Calvet / 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

mikethelad
Newbie
Newbie
Posts: 58
Joined: Thu Jul 05, 2012 12:00 am

Re: Scale And Marks

Post by mikethelad » Mon Jul 16, 2012 11:16 am

Hi, scale change works fine. The axis label, is correct how I have it, I want the mark on the line to show the value

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Scale And Marks

Post by Narcís » Mon Jul 16, 2012 12:16 pm

Hi mikethelad,
I want the mark on the line to show the value
Sorry, I understood you wanted the values as bottom axis labels. In that case what you need to change is Marks.Style:

Code: Select all

      tChart1[0].Marks.Style = Steema.TeeChart.Styles.MarksStyles.Value;
Best Regards,
Narcís Calvet / 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

mikethelad
Newbie
Newbie
Posts: 58
Joined: Thu Jul 05, 2012 12:00 am

Re: Scale And Marks

Post by mikethelad » Mon Jul 16, 2012 2:02 pm

Thanks, that works, see new graph, is there anyway to overcome the following:-

1. Overlap of the marks?

2. How to show the % symbol after the mark value

3. 1st and last one not showing
Attachments
graph.JPG
graph.JPG (39.12 KiB) Viewed 10434 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Scale And Marks

Post by Narcís » Mon Jul 16, 2012 2:16 pm

Hi mikethelad,
1. Overlap of the marks?
Yes, you can do something similar as in the example Pep posted here.
2. How to show the % symbol after the mark value
Either using one of the percent related MarksStyles values or manually adding it to the mark text with the GetSeriesMark event:

Code: Select all

    void Form1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
    {
      e.MarkText += "%";
    }
3. 1st and last one not showing
Using MinimumOffset and MaximumOffset, for example:

Code: Select all

      tChart1.Axes.Bottom.MinimumOffset = 5;
      tChart1.Axes.Bottom.MaximumOffset = 5;
Best Regards,
Narcís Calvet / 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

mikethelad
Newbie
Newbie
Posts: 58
Joined: Thu Jul 05, 2012 12:00 am

Re: Scale And Marks

Post by mikethelad » Mon Jul 16, 2012 3:59 pm

What calls the GetSeriesMark event, have tried in the afterdraw but no lucj

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Scale And Marks

Post by Narcís » Mon Jul 16, 2012 5:22 pm

Hi mikethelad,

Series call it. You have to subscribe the series to this event.
Best Regards,
Narcís Calvet / 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

mikethelad
Newbie
Newbie
Posts: 58
Joined: Thu Jul 05, 2012 12:00 am

Re: Scale And Marks

Post by mikethelad » Tue Jul 17, 2012 8:25 am

Sorry don't understand how to :-

"Series call it. You have to subscribe the series to this event."

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

Re: Scale And Marks

Post by Sandra » Tue Jul 17, 2012 10:15 am

Hello mikethelad,

You must subscribe and call the GetSeriesMark event when you initialize chart. You can do something next:

Code: Select all

...
 tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
            line1.GetSeriesMark += new Series.GetSeriesMarkEventHandler(series_GetSeriesMark);
            line2.GetSeriesMark +=new Series.GetSeriesMarkEventHandler(series_GetSeriesMark);
            line3.GetSeriesMark +=new Series.GetSeriesMarkEventHandler(series_GetSeriesMark);
        }

        void series_GetSeriesMark(Series series, GetSeriesMarkEventArgs e)
        {
            if (tChart1.Series.IndexOf(series) == 0)
            {
                e.MarkText = series.XValues[e.ValueIndex].ToString() + " %";

            }
            else if (tChart1.Series.IndexOf(series)==1)
            {
                e.MarkText = series.XValues[e.ValueIndex].ToString() + " %";
            }
            else if (tChart1.Series.IndexOf(series) == 2)
            {
                e.MarkText = series.XValues[e.ValueIndex].ToString() + " %";
            }
        }
As you see, in previous code, I have subscribed and called the event for each series in the initialization of chart and it works fine for me. I recommend you always call the event in the initialization of Chart to avoid problems.

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

mikethelad
Newbie
Newbie
Posts: 58
Joined: Thu Jul 05, 2012 12:00 am

Re: Scale And Marks

Post by mikethelad » Tue Jul 17, 2012 10:26 am

Thanks, the following has worked:-

line1.GetSeriesMark += new Steema.TeeChart.Styles.Series.GetSeriesMarkEventHandler(line_GetSeriesMark);

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

Re: Scale And Marks

Post by Sandra » Tue Jul 17, 2012 1:49 pm

Hello mikethelad,

I am glad that your problem solved. :D

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

Post Reply