Page 1 of 1
Function for calculating actual xyz values
Posted: Fri Oct 01, 2010 3:54 am
by 15057312
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...
Re: Function for calculating actual xyz values
Posted: Fri Oct 01, 2010 8:10 am
by 10050769
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,
Re: Function for calculating actual xyz values
Posted: Fri Oct 01, 2010 10:39 am
by 15057312
is there a property that takes the screen pixel value as input and gives the real value as a result?
Re: Function for calculating actual xyz values
Posted: Fri Oct 01, 2010 11:42 am
by 10050769
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,
Re: Function for calculating actual xyz values
Posted: Mon Oct 04, 2010 11:25 am
by 15657351
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).
Re: Function for calculating actual xyz values
Posted: Tue Oct 05, 2010 11:08 am
by 10050769
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,
Re: Function for calculating actual xyz values
Posted: Tue Oct 05, 2010 12:36 pm
by 15657351
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.
Re: Function for calculating actual xyz values
Posted: Wed Oct 06, 2010 4:28 am
by 15657351
I solved the problem by setting up a manual scale.
I am gradually learning my way around tchart.
Thanks for your help.
Re: Function for calculating actual xyz values
Posted: Wed Oct 06, 2010 7:40 am
by 10050769
Hello lilo,
I am glad that you solved your problem
.
Thanks,