Hi,
I want to change the text of an axes label at runtime, but it doesn't work.
If I design the chart with the Chart Editor and set the text of the Label it wortks.
But if I set the text at runtime with
WebChart1.Chart.Axes.Left.Labels.Text = "Test";
it doesn't work. The text which I set in designer is shown.
What did I wrong?
Else
Change Axes Label text at runtime
Hi Else,
you can enter the labels using :
WebChart1.Chart.Series[0].Labels[0] = "Label0";
you can enter the labels using :
WebChart1.Chart.Series[0].Labels[0] = "Label0";
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi Pep,
it doesn't work.
I want the labels in the chart like the labels in chart "Gantt Series" in the TeeChart Gallery.
The names of machines which data are shown in the chart should shown on the left axis.
Thanks,
Else
it doesn't work.
I want the labels in the chart like the labels in chart "Gantt Series" in the TeeChart Gallery.
The names of machines which data are shown in the chart should shown on the left axis.
Thanks,
Else
Pep wrote:Hi Else,
you can enter the labels using :
WebChart1.Chart.Series[0].Labels[0] = "Label0";
Hi.
If you're using Gantt series then left axis will be (is) populated with point labels, as long as axis label style is set to text:
If you're using different series type, then the best solution is to manually define vertical axis labels. The following code should do the trick:
If you're using Gantt series then left axis will be (is) populated with point labels, as long as axis label style is set to text:
Code: Select all
tChart1.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.Text;
Code: Select all
points1.Add(1.5, 10, "1st point");
points1.Add(2.5, 3, "2nd point");
points1.Add(3.0, 7, "3rd point");
points1.Add(3.2, 6, "4th point");
// show x values on horizontal axis
points1.GetHorizAxis.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
// define custom labels for vertical axis
Steema.TeeChart.AxisLabelsItems labels = points1.GetVertAxis.Labels.Items;
labels.Clear();
for (int i=0; i<points1.Count ;i++)
labels.Add(points1.YValues[i],points1.Labels[i]);
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Hi,
thanks, but it's already not running.
I work with lines in my chart. the yValue in the whole line the same, only the xValue changes. The xAxis is in DateTimeFormat. And if there are more lines, I want to name them by a label.
I try it as you told me. Now the yAxis is okay (the names are shown) but the XAxis shows the value I set in Line.Add(1,20,"Text"); Every label in the xAXis shows "Text". BUt I want to show the dateTime.
Thanks,
Else
thanks, but it's already not running.
I work with lines in my chart. the yValue in the whole line the same, only the xValue changes. The xAxis is in DateTimeFormat. And if there are more lines, I want to name them by a label.
I try it as you told me. Now the yAxis is okay (the names are shown) but the XAxis shows the value I set in Line.Add(1,20,"Text"); Every label in the xAXis shows "Text". BUt I want to show the dateTime.
Thanks,
Else
Marjan wrote:Hi.
If you're using Gantt series then left axis will be (is) populated with point labels, as long as axis label style is set to text:If you're using different series type, then the best solution is to manually define vertical axis labels. The following code should do the trick:Code: Select all
tChart1.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.Text;
Code: Select all
points1.Add(1.5, 10, "1st point"); points1.Add(2.5, 3, "2nd point"); points1.Add(3.0, 7, "3rd point"); points1.Add(3.2, 6, "4th point"); // show x values on horizontal axis points1.GetHorizAxis.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value; // define custom labels for vertical axis Steema.TeeChart.AxisLabelsItems labels = points1.GetVertAxis.Labels.Items; labels.Clear(); for (int i=0; i<points1.Count ;i++) labels.Add(points1.YValues[i],points1.Labels[i]);
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Else,
If you want to show your datatime labels, do not add any text to the 'String text' parameter of the Series.Add() method, e.g.
If you want to show text rather than the datetime labels then add the text to the 'String text' parameter of the Series.Add() method, e.g.
Set:I work with lines in my chart. the yValue in the whole line the same, only the xValue changes. The xAxis is in DateTimeFormat. And if there are more lines, I want to name them by a label.
I try it as you told me. Now the yAxis is okay (the names are shown) but the XAxis shows the value I set in Line.Add(1,20,"Text"); Every label in the xAXis shows "Text". BUt I want to show the dateTime.
Code: Select all
tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Auto;
Code: Select all
Line.Add(1,20,"");
Code: Select all
Line.Add(1,20,"Text");
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/