Hello:
I use the area to draw severl bar with different color each and I would like to make the color of symbol on the legend to be same with that related bar. However I only find the border of the symbol border is same with each bar, would you please let me know how I can fill the symbo with related bar area?
Thanks.
Attachment is the picture for your reference.
Ying-Hui
How to make legend symbol use the area's color
How to make legend symbol use the area's color
- Attachments
-
- Channel Level.jpg (39.59 KiB) Viewed 5424 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to make legend symbol use the area's color
Hello Ying-Hui,
Unfortunately this is a defect which I have added to our database with id=934. Fortunately there's an easy runtime workaround, which is to derive a new class from Area and override the method which is causing the problem, e.g.YingHui wrote: I use the area to draw severl bar with different color each and I would like to make the color of symbol on the legend to be same with that related bar. However I only find the border of the symbol border is same with each bar, would you please let me know how I can fill the symbo with related bar area?
Code: Select all
public class MyArea : Area
{
public MyArea(Chart c) : base(c) { }
protected override void PrepareLegendCanvas(Graphics3D g, int valueIndex, ref Color backColor, ref ChartBrush aBrush)
{
//leave empty
}
}
......
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
MyArea area = new MyArea(tChart1.Chart);
area.Add(1, 5, Color.Red);
area.Add(2, 1, Color.Blue);
area.Add(3, 4, Color.Yellow);
area.Add(4, 2, Color.Green);
area.Stairs = true;
}
Best Regards,
Christopher Ireland / 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 |
Re: How to make legend symbol use the area's color
Hello Chris:
Thanks for your reply. I will try the solution you provide.
Ying-HUi
Thanks for your reply. I will try the solution you provide.
Ying-HUi