Function for calculating actual xyz values

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Function for calculating actual xyz values

Post by lilo » Fri Oct 01, 2010 3:54 am

Is there a builtin function to calculate the actual xyz values of coordintes for ternary plots? Not the screen pixel values...or will i have to write my own?

pixels to real coords...

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

Re: Function for calculating actual xyz values

Post by Sandra » Fri Oct 01, 2010 8:10 am

Hello lilo,

You can calculate x,y and z values, using property of ternary series XValues(),YValues(),ZValues(), that returns the real values of Chart.

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

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Function for calculating actual xyz values

Post by lilo » Fri Oct 01, 2010 10:39 am

is there a property that takes the screen pixel value as input and gives the real value as a result?

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

Re: Function for calculating actual xyz values

Post by Sandra » Fri Oct 01, 2010 11:42 am

Hello lilo,

Sorry, I haven't understood good, your question.
is there a property that takes the screen pixel value as input and gives the real value as a result?
Yes exist. I suggest you that use method YScreenToValue() and XScreenToValue() that returns the corresponding Y and X values of a Screen position between Axis limits.

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

lilo
Newbie
Newbie
Posts: 29
Joined: Thu Sep 30, 2010 12:00 am

Re: Function for calculating actual xyz values

Post by lilo » Mon Oct 04, 2010 11:25 am

For Ternary Plot, this property outputs drawing x and y coordinates as used by the chart. I am not sure if this is a bug or not. Is there a formula to convert these values to axes coordinates?



I am wanting to draw lines on the ternary plot programatically using drawline, but my coordinates are in axes coordinates (0-100).

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

Re: Function for calculating actual xyz values

Post by Sandra » Tue Oct 05, 2010 11:08 am

Hello lilo,

I have made a simple example using Mouse Move event for return the XScreenValues() and YScreenValue() and values are correct for me. Please, could you check it works as you want. if it doesn't work as you like, please modifies code because we try to help you find a solution.

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Styles.Ternary series1;
        private void InitializeChart()
        {
            series1 = new Steema.TeeChart.Styles.Ternary(tChart1.Chart);
            series1.FillSampleValues();
            tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
         }

        void tChart1_MouseMove(object sender, MouseEventArgs e)
        {
               this.Text = "X:   " + Math.Truncate(series1.XScreenToValue(e.X)).ToString() + "Y:   " + Math.Truncate(series1.YScreenToValue(e.Y)).ToString();
        }
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

lilo
Newbie
Newbie
Posts: 29
Joined: Thu Sep 30, 2010 12:00 am

Re: Function for calculating actual xyz values

Post by lilo » Tue Oct 05, 2010 12:36 pm

I am using the same code, but the values i am getting are incorrect. I have autoscale set to true and axes in percentage.
The x axes shows 7 min and 49 max
The y axis shows 11min and 69 max at the apexes of the triangle.
Should I be using some kind of offset value?
I am using vb2010 express.

lilo
Newbie
Newbie
Posts: 29
Joined: Thu Sep 30, 2010 12:00 am

Re: Function for calculating actual xyz values

Post by lilo » Wed Oct 06, 2010 4:28 am

I solved the problem by setting up a manual scale.

I am gradually learning my way around tchart.

Thanks for your help.

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

Re: Function for calculating actual xyz values

Post by Sandra » Wed Oct 06, 2010 7:40 am

Hello lilo,

I am glad that you solved your problem :).

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