Page 1 of 1

VerticalAxes.Right and Show Left Axes Range

Posted: Fri Mar 02, 2007 8:08 pm
by 9641080
Hi, i have the following Problem .
I have for example the following Values (show in the bottom Axes Dates)
100,200,300,400,500 .. 1000

100 are 0 percent and 1000 are 100 percent. I wanna now show in the left Scale Values from 100 to 1000

and on the right Axes i wanna Percent Values from 0 to 100

Now when i say .Styles.VerticalAxes.Right the Left Axes are not shown.
and the (fastline) is scalled to the right Axes.

How can i solve this Problem ?

Greetings Martin

Posted: Mon Mar 05, 2007 10:26 am
by 9348258
Hi Martinx

If you want the Right and Left Axes you have to say "both" as below code:

Code: Select all

fastLine1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Both;
You can calculate the %, in the "_GetAxisLabel" event as below code:

Code: Select all

private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
        {
            string fmt = "{0:##,##0.##} %";

            if (sender==tChart1.Axes.Right)               
            {
                double Value = Convert.ToDouble(e.LabelText);
                double percent = Value * 100 / fastLine1.MaxYValue();
                e.LabelText = string.Format(fmt, percent);

            }   
}

Hi Edu

Posted: Tue Mar 06, 2007 6:34 pm
by 9641080
>fastLine1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Both;
that i have already done.
but my values are always orientated to the left . remember i want habe on the left values from
0 to 1000
and on the right percents from 0 to 100

now a fastline should display i have values 200,500,1000

the maxvalue is 1000 so i have values
(200/1000)*100 =20
(500/1000)*100 =50
(1000/1000)*100 =100
but when i show the fastline
they always scale the values to the left axes and not really show.

i want to scale it to the right axes (0-100)

can you help me ?

Posted: Wed Mar 07, 2007 12:07 pm
by 9348258
Hi martinx

You can fix, that Chart begins to 0 with "SetMinMax" property as below code:

Code: Select all

 private void Form1_Load(object sender, EventArgs e)
        {
            tChart1.Aspect.View3D = false;
            tChart1.Axes.Left.SetMinMax(0, 1000);
            tChart1.Axes.Right.Grid.Visible = false;
            tChart1.Axes.Right.SetMinMax(0, 1000);

            for (int i=1;i<=10;i++)
            {
                fastLine1.Add(i, 100 * i);
            }
            fastLine1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Both;
        }

        private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
        {
            string fmt = "{0:##,##0.##} %";

            if (sender==tChart1.Axes.Right)               
            {
                double Value = Convert.ToDouble(e.LabelText);
                double percent = Value * 100 / fastLine1.MaxYValue();
                e.LabelText = string.Format(fmt, percent);
            }    
        }

Posted: Sat Mar 10, 2007 8:00 pm
by 9641080
Hi edu,
> private void tChart1_GetAxisLabel(object sender, >Steema.TeeChart.GetAxisLabelEventArgs e)

i have not the problem with the labels i have the problem with the axes. (sorry iam german, and i am not sure to really to explain it)
i have on the left axes set min 0 max value 1000 ( an example) values
on the right axes i wanna have min 0 and max 100 (percent)
for example i have a value 500 the maxvalue is 1000
so i calculate the following value
(500/1000)*100 = 50 so i set tchart1.series(0).add(date,50)
(the series is a fastline)

(i set fastLine1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Both)

but the added values are not really visible i scaled always to the left and not to the right (0 to 100)

normally the line should go from the left side (500) to the right side (50)
but it always seems that he gets only the 50


i hope you understand what i want ?

greetings

Posted: Sat Mar 10, 2007 8:12 pm
by 9641080
Hi Edu, again me :)

i tested now serveral things. it only works when i say
fastLine1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.RIGHT !!

then it shows the correct values (for example (1000/1000)*100=100

but now the left axes is not displayed (with the values from 0 to 1000)
i also cannot show the left axes. is there a property that it will be displayed ?

Greetings

Posted: Sat Mar 10, 2007 8:24 pm
by 9641080
Hi , and again.
I have now tryed the following.
fastLine1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.both
and scaled the left axes from 0 to 100 and the right axes from 0 to 1000 (the opposite of the last message)
then it works it shows me the correct axes and the correct values . but why it doesn't work when i wanna have on the left 0 to 1000 (minimum and maximum) and on the right axis (0 to 100)
greetings again :lol:

Posted: Mon Mar 12, 2007 9:24 am
by 9348258
Hi Martinx

Here It's working fine using the last release (Build 2.0.2586.24038) and the code that I posted the last day. Which TeeChart version are you using? Could you please try with the last version?

If the problem persist could you please send us a simple example project we can run "as-is" to reproduce the issue here?

You can post your files either at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup or at our upload page

Posted: Mon Mar 12, 2007 10:31 am
by 9641080
hi edu, thanks for your reply. i use the current version 2.0.2586.24039 (from the lastest update)
i sent you know my sample code where you can take a look on it.

greetings martin

Posted: Mon Mar 12, 2007 10:34 am
by 9641080
Okay i have sent it now :)

Posted: Mon Mar 12, 2007 10:35 am
by 9641080
i have upload. because in the newsgroup it doesn't work

Betreff '@edu->vertical axes problem', Konto: 'www.steema.net', Server: 'www.steema.net', Protokoll: NNTP, Serverantwort: '437 (648) Transfer Failed - Do Not Try Again -- The Article is too large', Port: 119, Secure (SSL): Nein, Serverfehler: 437, Fehlernummer: 0x800CCCA9

Posted: Tue Mar 13, 2007 9:01 am
by 9348258
Hi Martinx

To achieve what you request you need to do something as in the code snippet I previously posted.

In your example you are adding in the serie the value of % and not the real value. You have to add the value and then calculate the % in the "GetAxisLabel" event as I told you.