Q1: I'd like to see in the legend only the currently active series, how could I accomplish that ?
Q2: when hovring the mouse over a fastline series (or line series) The MarksTip tool shows the value of the last point in the series before the location of the mouse instead of the actual calculated value at the position on the line series (eg. between 2 points). how can i show the actual value between the points ?
Regards,
Yair
View only active series in legend
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Yair,
1. You can do something like this:
2. You can achieve that as in the All Features\Welcome !\Chart styles\Standard\Line(Strip)\Interpolating line series example at the features demo, available at TeeChart's program group.
1. You can do something like this:
Code: Select all
foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
{
s.ShowInLegend = s.Active;
}
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 |
Excellent.
problem 1 - solved.
Regarding problem 2:
Using the MarksTip tool, is there a way I can get the x value between 2 of the series' points currently pointed to by the mouse, in order to use it in the interpolation of y ?
Also, how can i tell which is the series currently pointed to by the mouse ?
Thanks and best regards,
Yair
problem 1 - solved.
Regarding problem 2:
Using the MarksTip tool, is there a way I can get the x value between 2 of the series' points currently pointed to by the mouse, in order to use it in the interpolation of y ?
Also, how can i tell which is the series currently pointed to by the mouse ?
Thanks and best regards,
Yair
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Yair,
In that case you can use something like code below.
In that case you can use something like code below.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
Steema.TeeChart.Tools.MarksTip marksTip1 = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart);
marksTip1.GetText += new Steema.TeeChart.Tools.MarksTipGetTextEventHandler(marksTip1_GetText);
}
void marksTip1_GetText(Steema.TeeChart.Tools.MarksTip sender, Steema.TeeChart.Tools.MarksTipGetTextEventArgs e)
{
if (index != -1)
{
e.Text = "Series" + i.ToString() + ": " + xVal.ToString() + " / " + yVal.ToString();
}
}
private double xVal, yVal;
private int index = -1;
private int i;
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
index = -1;
for (i = 0; i < tChart1.Series.Count; i++)
{
index = tChart1[i].Clicked(e.X, e.Y);
if (index != -1)
{
xVal = tChart1.Axes.Left.CalcPosPoint(e.X);
yVal = tChart1.Axes.Left.CalcPosPoint(e.Y);
break;
}
}
}
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 |