Q1) I want to add a point to a Line Series chart. I have tried adding a annotation. But on reize when trying to move it with the line it fails.
m_seltool.Callout.XPosition = tChart.Series[0].CalcXPos(AIndex);
m_seltool.Callout.YPosition = tChart.Series[0].CalcYPos(AIndex);
I store AIndex which I assume to be index of value in series. have tried after redraw and resize but annotation is not moved correctly.
Even if I click on the line after resize at a similar position so AIndex is the same there is no update on the CalcXpos value. I have to click on different position so AIndex changes. I assume this is a bug
Q2) Point Series
Which property to I use to change the shape of the points from the default square?
Thx
Fixed Point on a chart and Points Sereies
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Luke,
1. For annotation's being updated you need to do something like this:
2. You need to use Pointer.Style:
1. For annotation's being updated you need to do something like this:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Tools.Annotation annotation1;
private int ValueIndex = 5;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
annotation1.Text = "hello!";
annotation1.Callout.Visible = true;
tChart1.Dock = DockStyle.Fill;
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
tChart1.Scroll += new EventHandler(tChart1_Scroll);
tChart1.UndoneZoom += new EventHandler(tChart1_UndoneZoom);
tChart1.Resize += new EventHandler(tChart1_Resize);
ChartInternalRepaint();
}
private void ChartInternalRepaint()
{
Bitmap bmp = tChart1.Bitmap;
}
void tChart1_Resize(object sender, EventArgs e)
{
ChartInternalRepaint();
}
void tChart1_UndoneZoom(object sender, EventArgs e)
{
ChartInternalRepaint();
}
void tChart1_Scroll(object sender, EventArgs e)
{
ChartInternalRepaint();
}
void tChart1_Zoomed(object sender, EventArgs e)
{
ChartInternalRepaint();
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
annotation1.Callout.XPosition = tChart1[0].CalcXPos(ValueIndex);
annotation1.Callout.YPosition = tChart1[0].CalcYPos(ValueIndex);
}
Code: Select all
points1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
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 Luke,
It doesn't exist in TeeChart. It actually is:
Since I needed to use it at several places in my example I implemented this:
Calling Bitmap method forces the chart being repainted internally and therefore all chart objects are repositioned.
It doesn't exist in TeeChart. It actually is:
Code: Select all
Bitmap bmp = tChart1.Bitmap;
Code: Select all
private void ChartInternalRepaint()
{
Bitmap bmp = tChart1.Bitmap;
}
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 Luke,
Actually you can use Draw() method instead of Bitmap:
Calling Draw() method is necessary for resetting internal variables when the size of the chart is changed. The only way to do this is to draw the chart first to reset them correctly.
Actually you can use Draw() method instead of Bitmap:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Tools.Annotation annotation1;
private int ValueIndex = 5;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
annotation1.Text = "hello!";
annotation1.Callout.Visible = true;
tChart1.Dock = DockStyle.Fill;
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
tChart1.Scroll += new EventHandler(tChart1_Scroll);
tChart1.UndoneZoom += new EventHandler(tChart1_UndoneZoom);
tChart1.Resize += new EventHandler(tChart1_Resize);
tChart1.Draw();
}
void tChart1_Resize(object sender, EventArgs e)
{
tChart1.Draw();
}
void tChart1_UndoneZoom(object sender, EventArgs e)
{
tChart1.Draw();
}
void tChart1_Scroll(object sender, EventArgs e)
{
tChart1.Draw();
}
void tChart1_Zoomed(object sender, EventArgs e)
{
tChart1.Draw();
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
annotation1.Callout.XPosition = tChart1[0].CalcXPos(ValueIndex);
annotation1.Callout.YPosition = tChart1[0].CalcYPos(ValueIndex);
}
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 |