Hello,
i use a fastline (f1) with a custom axis and a second fastline (f2) with datasource = f1. The second one has also the function stddeviation set. In that case, the line f2 has also the same axis like f1 and is automaticly shown at the bottom of the chart. now i want to show f2 relative to the average of f1. For example now:
|
|---------------------- f1
|
|
|
|
|----------------------- f2 (stddev)
|________________
wanted:
|----------------------- f2 (stddev)
|---------------------- f1
|----------------------- f2 (stddev)
|
|
|
|
|________________
The value of f2 is correct, but must be shown relatively to the average of f1 so you can see the relationship of f1 and f2. How can i achieve this without to calculate the stdev for my own ?
Thanks in advance!
StdDeviation with Offset?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AIS,
I'm not sure about what you are trying to achieve but you can calculate Average and Std. Deviation for datasource series, for example:
If that's not what you need please provide more information. An image might be helpful. You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
I'm not sure about what you are trying to achieve but you can calculate Average and Std. Deviation for datasource series, for example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.FastLine fastLine1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
fastLine1.Title = "Data";
fastLine1.FillSampleValues();
Steema.TeeChart.Styles.FastLine avgLine = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
avgLine.Title = "Average";
Steema.TeeChart.Functions.Average average1 = new Steema.TeeChart.Functions.Average();
avgLine.Function = average1;
avgLine.DataSource = fastLine1;
Steema.TeeChart.Styles.FastLine stdDevLine = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
stdDevLine.Title = "Std. Deviation";
Steema.TeeChart.Functions.StdDeviation stdDev1 = new Steema.TeeChart.Functions.StdDeviation();
stdDevLine.Function = stdDev1;
stdDevLine.DataSource = fastLine1;
}
Thanks in advance.
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 |
Hi Narcís,
for better understanding what i want to do:
You can see, that the std. deviation in the second picture is not at the bottom of the chart like in the first one. The two lines are avg-std.dev and avg+std.dev. Is it possible to combine the functions or set an offset for std.dev. to achieve this?
Thanks!
for better understanding what i want to do:
You can see, that the std. deviation in the second picture is not at the bottom of the chart like in the first one. The two lines are avg-std.dev and avg+std.dev. Is it possible to combine the functions or set an offset for std.dev. to achieve this?
Thanks!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AIS,
In that case you can do this:
In that case you can do this:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.FastLine fastLine1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
fastLine1.Title = "Data";
fastLine1.FillSampleValues();
Steema.TeeChart.Styles.FastLine avgLine = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
avgLine.Title = "Average";
Steema.TeeChart.Functions.Average average1 = new Steema.TeeChart.Functions.Average();
avgLine.Function = average1;
avgLine.DataSource = fastLine1;
Steema.TeeChart.Styles.FastLine stdDevLine = new Steema.TeeChart.Styles.FastLine();
stdDevLine.Title = "Std. Deviation";
Steema.TeeChart.Functions.StdDeviation stdDev1 = new Steema.TeeChart.Functions.StdDeviation();
stdDevLine.Function = stdDev1;
stdDevLine.DataSource = fastLine1;
Steema.TeeChart.Styles.FastLine avgPlusStdDev = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
Steema.TeeChart.Styles.FastLine avgLessStdDev = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
for (int i = 0; i < avgLine.Count; i++)
{
avgPlusStdDev.Add(avgLine.XValues[i], avgLine.YValues[i] + stdDevLine.YValues[i]);
avgLessStdDev.Add(avgLine.XValues[i], avgLine.YValues[i] - stdDevLine.YValues[i]);
}
}
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 |
Hi Narcís,
yes, this is a solution but with a bad performance. In our case we often have 5-10 series each with over 80000 points (x,y) and an own average and st.dev. This solution costs a lot of performance when the avg period is small (e.g. 1), because we must loop all average points. Nevertheless i will use it
Thanks anyway for your quick response!
Bye!
yes, this is a solution but with a bad performance. In our case we often have 5-10 series each with over 80000 points (x,y) and an own average and st.dev. This solution costs a lot of performance when the avg period is small (e.g. 1), because we must loop all average points. Nevertheless i will use it
Thanks anyway for your quick response!
Bye!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AIS,
You could try applying hints in the Real-time Charting article here:
http://www.teechart.net/reference/articles/index.php
You could try applying hints in the Real-time Charting article here:
http://www.teechart.net/reference/articles/index.php
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 |