Charts Legend question : Checkbox placement
Charts Legend question : Checkbox placement
Hi ,
I have a question of the usage of chart's legend.
How to place checkbox afetr the text in the legend ?
Thanks ,
Best regards.
I have a question of the usage of chart's legend.
How to place checkbox afetr the text in the legend ?
Thanks ,
Best regards.
Hi Neo,
If you want put checkbox in the legend you could do the following code:
I hope that my help you serve.
If you want put checkbox in the legend you could do the following code:
Code: Select all
tChart1.Legend.CheckBoxes = true;
I hope that my help you serve.
Best Regards,
Sandra Pazos / 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, Neo
Thanks,
At the moment this isn't possible I added on list of Feauter Reports We will consider if you add a new verison of TeeChart .NETCould I put the checkbox in different position ?
Thanks,
Best Regards,
Sandra Pazos / 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 Sandra :
I have make an url , you can link to see my sample.
Thanks.
Best Regards.
http://photo.xuite.net/longsha1223/3088952/1.jpg
I have make an url , you can link to see my sample.
Thanks.
Best Regards.
http://photo.xuite.net/longsha1223/3088952/1.jpg
Hi Neo,
You could do a similar code as next exemple:
Event AfterDraw
Event GetLegendPos
Event GetLegendRect
As you can see, the code modifies the legend rectangle. So you can set legend as you like. Also you can modify legend checkboxes using this code or similar, it just depends on the position you'd like to plot them.
You could do a similar code as next exemple:
Event AfterDraw
Code: Select all
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
System.Drawing.Rectangle legRect = this.tChart1.Legend.ShapeBounds;
Steema.TeeChart.Drawing.Graphics3D gr = tChart1.Graphics3D;
gr.HorizontalLine(legRect.Left,legRect.Right,legRect.Bottom -50);
gr.TextAlign = System.Drawing.StringAlignment.Near;
gr.Font.Size = 8;
gr.Font.Color = Color.Navy;
gr.TextOut(legRect.Left+8,legRect.Bottom -38,"Bar1 = 50");
gr.TextOut(legRect.Left+8,legRect.Bottom -26,"Bar2 = 55");
gr.TextOut(legRect.Left+ 8, legRect.Bottom -16, "Bar3 = 59");
}
Code: Select all
private void tChart1_GetLegendPos(object sender, Steema.TeeChart.GetLegendPosEventArgs e)
{
e.X -= 80;
e.XColor -= 80;
}
Event GetLegendRect
Code: Select all
private void tChart1_GetLegendRect(object sender, Steema.TeeChart.GetLegendRectEventArgs e)
{
e.Rectangle = new Rectangle(e.Rectangle.Left - 80, e.Rectangle.Top,e.Rectangle.Width + 30,e.Rectangle.Height + 60);
}
As you can see, the code modifies the legend rectangle. So you can set legend as you like. Also you can modify legend checkboxes using this code or similar, it just depends on the position you'd like to plot them.
Best Regards,
Sandra Pazos / 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 Neo,
I recommend you delete this, because the code will be more easy to understand and because the event already has the g parameter which can be used for that.
On this you can draw different things for exemple: line, rectangles, etc. And place the elements where you want.
I also advise that you have a look at the tutorial and demo examples included with TeeChart .Net installer. Specially you can see a simple example for drawing more text in the legend in All Features\Welcome !\Miscellaneous\Legend\Drawing more text. Demo and tutorials can be found at TeeChart's program group.
Thanks,
Well, I relaized that is not necessary the following part of code:why to use the Graphics3D ?
Code: Select all
Steema.TeeChart.Drawing.Graphics3D gr = tChart1.Graphics3D;
Ok, In your code you have a chart, and this has a canvas. Well simply you draw in chart's canvas.Could you let me know how the chart work
On this you can draw different things for exemple: line, rectangles, etc. And place the elements where you want.
I also advise that you have a look at the tutorial and demo examples included with TeeChart .Net installer. Specially you can see a simple example for drawing more text in the legend in All Features\Welcome !\Miscellaneous\Legend\Drawing more text. Demo and tutorials can be found at TeeChart's program group.
Thanks,
Best Regards,
Sandra Pazos / 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 Sandra :
Is it mean the TeeChart v3 has the property to set ?
Where can I found the property ?
Thanks.
Best Regards.
Code: Select all
I recommend you delete this, because the code will be more easy to understand and because the event already has the g parameter which can be used for that
Where can I found the property ?
Thanks.
Best Regards.
Hi Neo,
See next code:
As you can see g parameter do same with gr for first code, for this reason gr is better than delete
Thanks,
Yes, in the event AfterDraw appears:private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g). This is Graphics3D g that you use in your code ,and is not necessary to add the other Graphics3D because so exist in this event.Is it mean the TeeChart v3 has the property to set ?
Where can I found the property ?
See next code:
Code: Select all
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
System.Drawing.Rectangle legRect = this.tChart1.Legend.ShapeBounds;
g.HorizontalLine(legRect.Left,legRect.Right,legRect.Bottom -60);
g.TextAlign = System.Drawing.StringAlignment.Near;
g.Font.Size = 8;
g.Font.Color = Color.Navy;
g.TextOut(legRect.Left+8,legRect.Bottom -58,"Bar1 = "+tChart1[0].MaxYValue().ToString());
g.TextOut(legRect.Left+8,legRect.Bottom -48,"Bar3 = "+tChart1[1].MaxYValue().ToString());
g.TextOut(legRect.Left+ 8, legRect.Bottom -38, "Bar4 = "+tChart1[2].MaxYValue().ToString());
g.TextOut(legRect.Left + 8, legRect.Bottom -28, "Bar5 = "+ tChart1[3].MaxYValue().ToString());
}
Thanks,
Best Regards,
Sandra Pazos / 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 |