Page 1 of 2
Points Style Property
Posted: Fri Oct 01, 2010 1:37 am
by 15057312
How to set the points style property in code?
To change points from square, circle etc...
Re: Points Style Property
Posted: Fri Oct 01, 2010 1:38 am
by 15057312
for ternay plot
Re: Points Style Property
Posted: Fri Oct 01, 2010 1:54 am
by 15057312
OK, I have the solution.
Use pointer.style
Re: Points Style Property
Posted: Fri Oct 01, 2010 7:54 am
by 10050769
Hello lilo,
I am glad that you have found a solution
Thanks,
Re: Points Style Property
Posted: Fri Oct 01, 2010 9:41 am
by 15057312
Hi,
After checking, this does not seem to do what i need. How can I change the ppoints style in code, without the editor?
Re: Points Style Property
Posted: Fri Oct 01, 2010 9:56 am
by 15057312
This changes all the points. Is it possible to change the style of individual points?
Re: Points Style Property
Posted: Fri Oct 01, 2010 10:03 am
by 10050769
Hello lilo,
Could you please, check next lines of code works as you want:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Ternary series1 = new Steema.TeeChart.Styles.Ternary(tChart1.Chart);
series1.FillSampleValues();
series1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
}
I hope will helps.
Thanks,
Re: Points Style Property
Posted: Fri Oct 01, 2010 10:14 am
by 15057312
That seems to be a random point generator. It fills the chart with a random set of points, but they are all circles. I am trying to specify a different shape for each data point. The data points are not randomly generated. they are read from input file.
I use this code:
For i= 1 to TotalPoints
Ternary1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle
Ternary1.Add(X(i), Y(i), ZA(i), SymbWeight(i), Color(i))
Next TotalPoints
But all the points on the plot change to circles.
Re: Points Style Property
Posted: Fri Oct 01, 2010 10:16 am
by 15057312
I use this code:
For i= 1 to TotalPoints
If symbol(i)=1 Then Ternary1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle
If symbol(i)=2 Then Ternary1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Cross
Ternary1.Add(X(i), Y(i), ZA(i), SymbWeight(i), Color(i))
Next TotalPoints
Re: Points Style Property
Posted: Fri Oct 01, 2010 10:27 am
by 15057312
OK, I have the solution. Use a series of ternary plots, assigning each series a different symbol.
Re: Points Style Property
Posted: Fri Oct 01, 2010 10:53 am
by 10050769
Hello lilo,
I am glad that you have found a solution
. On the other hand, I have made for you a simple code using
GetStylePoint event for change style of each pointer:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Ternary series1 = new Steema.TeeChart.Styles.Ternary(tChart1.Chart);
series1.FillSampleValues();
series1.GetPointerStyle += new Steema.TeeChart.Styles.Ternary.GetPointerStyleEventHandler(series1_GetPointerStyle);
}
void series1_GetPointerStyle(Steema.TeeChart.Styles.Ternary series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
{
if (series[e.ValueIndex].X > 80)
{
e.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
}
else
{
e.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle;
}
}
Also you can find more examples as you have done for use this events in this threads:
http://www.teechart.net/support/viewtop ... yle#p45498
http://www.teechart.net/support/viewtop ... yle#p46978
I hope will helps.
Thanks,
Re: Points Style Property
Posted: Thu Oct 14, 2010 7:36 am
by 15057312
This may be a silly question...how is the GetPointerStyle(ByVal series As Steema.TeeChart.Styles.Ternary, ByVal e As Steema.TeeChart.Styles.GetPointerStyleEventArgs) triggered?
is it called directly?
Re: Points Style Property
Posted: Thu Oct 14, 2010 8:56 am
by narcis
Hi lilo,
No, this is an event that is automatically fired by TeeChart when series pointers are painted. Have you seen its runtime assignment at Sandra's example?
Re: Points Style Property
Posted: Thu Oct 14, 2010 12:48 pm
by 15057312
Thanks, its now working
Re: Points Style Property
Posted: Fri Oct 15, 2010 9:18 am
by 15057312
I can only get it working for symbols with solid color fill. Does not work with other symbols