Page 1 of 1

Legend Symbols and Values

Posted: Tue Jul 05, 2005 8:59 pm
by 9527493
I have a chart displaying multiple pie graphs. With LegendStyle set to lsValues (2), the legend displays the color smybol, value (first series), and title. Obviously, the values should not be displayed as this is a multiple chart. If I set LegendStyle to anything else, the symbols are not displayed. The legend seems meaningless to me without the symbols. How can I display the symbols and titles but NO values?

Posted: Wed Jul 06, 2005 3:02 pm
by 9527493
I tried using OnGetLegendText as per another thread in this forum. The code is fired correctly, but the changes made to the LegendText var are not displayed. I use the ByRef in the function code, but it seems there is no passing by reference in html script. I'm really stuck!

Posted: Thu Jul 07, 2005 10:42 am
by narcis
Hi MG,

You should do as one of the live ASP examples available at the TeeChart program group. Go to the "Page showing 4 different export formats " example which containsan "OnGetAxisLabel" example. A similar technique will have to be applied here, manually "draw" changes using Canvas methods, as text cannot by passed in html script as you mentioned.

Posted: Thu Jul 07, 2005 1:38 pm
by 9527493
Hi,
Sorry, I'm not getting it. The page does not show any pie charts, and I cannot find code that alters the legends; in fact, no mention of OnGetAxisLabel. So I'm not sure what you mean, here. Unless you're suggesting to draw the entire legend programatically?

Posted: Thu Jul 07, 2005 1:56 pm
by narcis
Hi MG,

Sorry if I wasn't clear enough in my previous reply. It doesn't mind if series are not pie series as it will be the same. The code you need is at CompareOutput.asp and CompareOutput.inc which you will find at C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\IIS & Asp (default english installation path). The code I was referring to is OnBeforeDrawSeries event at CompareOutput.inc which draws "Very bad :-|", "Bad", "OK", "Good" and "Excellent" labels on the left axis. You should do something similar with the legend symbols, custom drawing on the canvas.

Posted: Thu Jul 07, 2005 3:09 pm
by 9527493
Hello, again

Ok, I got a workaround. If I set the legends' ColumnWidthAuto to false, and specify top, left, and width values (so I know where the legend is), I can then use Canvas.Textout to place my titles. I use a LegendStyle of 4, which for some reason draws only the colored symbol boxes.
This seems like a lot of trouble just to omit something from the legend which shouldn't be there in the first place. :?