View legend symbols at custom location

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
SK_1567
Newbie
Newbie
Posts: 4
Joined: Wed Jul 20, 2016 12:00 am
Contact:

View legend symbols at custom location

Post by SK_1567 » Fri Dec 15, 2023 5:46 am

Hello Team,

I am using Steema tee chart version for WPF 4.1.2017.2143.
As per my requirement, I need to show a legend symbols in a different table with project specific information. Is there any possibility to view legend symbols or repaint legend symbols at custom location.

Marc
Site Admin
Site Admin
Posts: 1265
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: View legend symbols at custom location

Post by Marc » Fri Dec 15, 2023 8:40 am

Greetings,

Please see the following tutorial:

https://steema.com/docs/teechart/net/tu ... Design.htm

See this example for modification of the Legend symbols themselves at runtime:

https://github.com/Steema/TeeChart-NET- ... olFlags.cs

(whole project loadable here: https://github.com/Steema/TeeChart-NET- ... tDemoNET60)

Regards,
Marc Meumann
Steema Support

SK_1567
Newbie
Newbie
Posts: 4
Joined: Wed Jul 20, 2016 12:00 am
Contact:

Re: View legend symbols at custom location

Post by SK_1567 » Mon Dec 18, 2023 12:18 pm

Hello Marc,

this solution shall modify the changes at legend section, but we want to use that symbol at customized project specific editor like PDF table and there need to repaint/redraw the symbol of the specific series as shown in this attachment
LegendInPDFTable.png
LegendInPDFTable.png (30.54 KiB) Viewed 16497 times
This image is generated in PDF file. So any way to get this as a shape?

Thanks for your support.

SK_1567
Newbie
Newbie
Posts: 4
Joined: Wed Jul 20, 2016 12:00 am
Contact:

Re: View legend symbols at custom location

Post by SK_1567 » Thu Dec 21, 2023 8:22 am

Hello Marc,

Is there any update on this ?

Marc
Site Admin
Site Admin
Posts: 1265
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: View legend symbols at custom location

Post by Marc » Thu Dec 21, 2023 8:36 am

Hello,

We were cross.checking options as it's not entirely clear to us from your description how you are creating the combined pdf output, and example of how you are doing that would be useful. On the other hand, we're still of the view that defining your own image symbol outside the Chart for your legend table (I assume that is outside of the chart) and then re-using that symbol in the Legend is the way to go.

The code for that is included in the example I linked:

for NET framework 4:

Code: Select all

private void Symbol_OnSymbolDraw(object sender, SymbolDrawEventArgs e) 
{
	if(this.checkBox1.Checked) 
	{
		Rectangle tmpR = e.Rect;
		tmpR.Inflate(-1,-1);

		System.Drawing.Bitmap bmp = new Bitmap(imageList1.Images[e.ValueIndex]);
		tChart1.Chart.Graphics3D.Draw(tmpR, bmp, Steema.TeeChart.Drawing.ImageMode.Stretch, false);
	}
}
In this case taking the image from a list, but you could assign your bitmap symbol here.

Regards,
Marc
Steema Support

SK_1567
Newbie
Newbie
Posts: 4
Joined: Wed Jul 20, 2016 12:00 am
Contact:

Re: View legend symbols at custom location

Post by SK_1567 » Wed Dec 27, 2023 11:38 am

Hello Marc,

Thank you for your solution.

We want to do vice versa. We want to use legend symbol of a chart in a our PDF table so is there any way by which i can get series and its legend symbols.

Your help is very much appreciated.

Marc
Site Admin
Site Admin
Posts: 1265
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: View legend symbols at custom location

Post by Marc » Thu Dec 28, 2023 1:21 pm

Hello,

You can't get the symbol itself but you can get most of the information you need to plot it. The event from the previous examples offers up the rectangular size of the symbol to be plotted and the colours can be extracted from the Series value index, then knowing if you're going to have a square, triangular or line symbol according to default Chart settings, just use the PaintEventArgs e.Graphics in Form_paint or similar, to plot the symbol where you want it.

Regards,
Marc
Steema Support

Post Reply