I have been searching for hours and can not figure out how to customize the text in a legend on a Webchart. All of the code that I see written here, is not available to me. Can someone please tell me how to customize the text in a legend on a webchart. I have just updated to TeeChartNET2UpdateBuild.exe
<tchart:WebChart ID="WebChart9" runat="server" AutoPostback="False" Config="AAEAAAD//...
GetChartFile="GetChart.aspx" Height="450px" TempChart="Session" Width="750px" />
Public Pie9 As Steema.TeeChart.Styles.Pie = New Steema.TeeChart.Styles.Pie
Pie9.Add(MyStkCount, color:=Drawing.Color.Blue)
Pie9.Add(MyInStkCount, color:=Drawing.Color.Green)
Pie9.Marks.Style = Steema.TeeChart.Styles.MarksStyles.PercentTotal
Pie9.Marks.Visible = True
WebChart9.Chart.Series.Add(Pie9)
Customising Legend Text on a WebChart
Re: Customising Legend Text on a WebChart
Hello phil1995,
If you would customize text in your legend, you need use GetLegendText Event that allow you change text of legend as do in next example:
Could you please, check if previous code works as you want?
I hope will helps.
Thanks,
If you would customize text in your legend, you need use GetLegendText Event that allow you change text of legend as do in next example:
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
InitializeChart();
}
Steema.TeeChart.Styles.Pie pie1;
private void InitializeChart()
{
pie1 = new Steema.TeeChart.Styles.Pie(WebChart1.Chart);
pie1.FillSampleValues();
pie1.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Percent;
WebChart1.GetLegendText += new Steema.TeeChart.GetLegendTextEventHandler(WebChart1_GetLegendText);
}
I hope will helps.
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 |
Re: Customising Legend Text on a WebChart
As mentioned earlier, the GetLegendText is not available from the WebChart9. When I type Webchart9. , there is no GetLegendText in the intellisense.
Re: Customising Legend Text on a WebChart
Hello priya1995,
Previous code I have attached in this thread works fine for me in last version 2 of TeeChart.Net. If you don't find GetLegendText() to runtime, Please, go to design time and try to find it next the proprieties of objects. If you still can't find GetLegendText(), could you please, say us exactly what is the number of version 2 are you using?
For example:
Previous code I have attached in this thread works fine for me in last version 2 of TeeChart.Net. If you don't find GetLegendText() to runtime, Please, go to design time and try to find it next the proprieties of objects. If you still can't find GetLegendText(), could you please, say us exactly what is the number of version 2 are you using?
For example:
Thanks,Release Notes 4th February 2009
TeeChart.NET version 2
Build 2.0.3309.32488
Compiled in .NET Framework 1.1
Build 2.0.3309.32489
Compiled in .NET Framework 2.0
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 |
Re: Customising Legend Text on a WebChart
Release Notes 22nd January 2009
TeeChart.NET version 2
Build 2.0.3309.32488
Compiled in .NET Framework 1.1
Build 2.0.3309.32489
Compiled in .NET Framework 2.0
TeeChart.NET version 2
Build 2.0.3309.32488
Compiled in .NET Framework 1.1
Build 2.0.3309.32489
Compiled in .NET Framework 2.0
Re: Customising Legend Text on a WebChart
When I go to the design and look under the events, I see the GetLegendText. I double clicked it and it made the WebChart9_GetLegendText event.
When I go to use any of the code you suggested, it doesnt recognize WebChart9.GetLegendText
When I go into the event and try to access the legend properties with WebChart9.Legend, it doesnt recognize this either.
When I go to use any of the code you suggested, it doesnt recognize WebChart9.GetLegendText
When I go into the event and try to access the legend properties with WebChart9.Legend, it doesnt recognize this either.
Re: Customising Legend Text on a WebChart
Hello phil1995,
Could you please, send us a simple project, because we can reproduce your problem here?
Thanks,
Could you please, send us a simple project, because we can reproduce your problem here?
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 |