Hello,
is it possible to have a scatter chart with a vertical & horizontal median lines? If so, can someone point us in the right direction?
The scatter is to determine how a person is performing against their peers.
Thanks!
How to: Add vertical & horizontal Median lines on scatte
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ASM,
Yes, this can be done as shown in the What's New?\Welcome !\New Functions\Median Function example. This example can be found at the features demo available at TeeChart's program group.
Yes, this can be done as shown in the What's New?\Welcome !\New Functions\Median Function example. This example can be found at the features demo available 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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ASM,
Vertical median function doesn't exist. However, you can easily implement that using an horizontal line series like this:
Vertical median function doesn't exist. However, you can easily implement that using an horizontal line series like this:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
tChart1.Aspect.View3D = false;
line1.FillSampleValues();
Steema.TeeChart.Styles.HorizLine vertMedian1 = new Steema.TeeChart.Styles.HorizLine(tChart1.Chart);
double xMedian;
if (line1.Count % 2 != 0)
xMedian = line1.XValues[(line1.Count / 2) + 1];
else
xMedian = (line1.XValues[(line1.Count / 2)] + line1.XValues[(line1.Count / 2) + 1]) / 2;
vertMedian1.Add(xMedian, line1.YValues.Minimum);
vertMedian1.Add(xMedian, line1.YValues.Maximum);
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ASM,
Sorry but I noticed my initial algorithm was wrong, should be like this:
Sorry but I noticed my initial algorithm was wrong, should be like this:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
tChart1.Aspect.View3D = false;
line1.FillSampleValues();
Steema.TeeChart.Styles.HorizLine vertMedian1 = new Steema.TeeChart.Styles.HorizLine(tChart1.Chart);
double xMedian;
if (line1.Count % 2 == 0)
xMedian = line1.XValues[(line1.Count / 2)];
else
xMedian = (line1.XValues[(line1.Count / 2)] + line1.XValues[(line1.Count / 2) + 1]) / 2;
vertMedian1.Add(xMedian, line1.YValues.Minimum);
vertMedian1.Add(xMedian, line1.YValues.Maximum);
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
scatter chart line1 object
What sort of object is line1? Would you send the fully qualified objects to draw a line?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ASM,
I have converted C# code to VB.NET code using Kamal Patel's conversor. You may also be interested in knowing of Carlos Aguilar's conversor.
If the VB.NET code I posted doesn't work for you please let me know.
I have converted C# code to VB.NET code using Kamal Patel's conversor. You may also be interested in knowing of Carlos Aguilar's conversor.
Code: Select all
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
tChart1.Aspect.View3D = False
line1.FillSampleValues()
Dim vertMedian1 As Steema.TeeChart.Styles.HorizLine = New Steema.TeeChart.Styles.HorizLine(tChart1.Chart)
Dim xMedian As Double
If line1.Count % 2 = 0 Then
xMedian = line1.XValues((line1.Count / 2))
Else
xMedian = (line1.XValues((line1.Count / 2)) + line1.XValues((line1.Count / 2) + 1)) / 2
End If
vertMedian1.Add(xMedian, line1.YValues.Minimum)
vertMedian1.Add(xMedian, line1.YValues.Maximum)
End Sub
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |