Hello,
how is it possible to place a Shape on a Webchart?.
I'm using a triangle-Shape and I want to place it on a fixed Pixel-Position on my Webchart. And how can I increase or decraese the size of the shape-Series?
Best regards
Michael
Place a Shape on Webchart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Michael,
You can do something like this:
Calling DrawShape method with new dimensions should be enough for resizing it.
You can do something like this:
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
Steema.TeeChart.Chart ch1 = this.WebChart1.Chart;
ch1.Aspect.View3D = false;
ch1.Chart.Legend.Visible = false;
ch1.Axes.Left.SetMinMax(0, 100);
ch1.Axes.Bottom.SetMinMax(0, 100);
DrawShape(ch1, 100, 100, 200, 200);
}
private void DrawShape(Steema.TeeChart.Chart ch1, int x0, int y0, int x1, int y1)
{
System.Drawing.Bitmap bmp = ch1.Bitmap((int)WebChart1.Width.Value, (int)WebChart1.Height.Value);
Steema.TeeChart.Styles.Shape shape1;
if (ch1.Series.Count == 0)
{
shape1 = new Steema.TeeChart.Styles.Shape(ch1);
shape1.Style = Steema.TeeChart.Styles.ShapeStyles.Triangle;
}
else
{
shape1 = (Steema.TeeChart.Styles.Shape)ch1[0];
}
shape1.X0 = ch1.Axes.Bottom.CalcPosPoint(x0);
shape1.Y0 = ch1.Axes.Left.CalcPosPoint(y0);
shape1.X1 = ch1.Axes.Bottom.CalcPosPoint(x1);
shape1.Y1 = ch1.Axes.Left.CalcPosPoint(y1);
}
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 |