I am using:
AnnotationChart4.Text = "Point: " & AIndex.ToString() + Value: " & Ternary1.ValueMarkText(AIndex)
How do I format the ValueMarkText?
I have tried TChart1.Series(0).ValueFormat = "##0"
Format ValueMarkText
Re: Format ValueMarkText
I have also tried:
TChart1.Series(0).ValueFormat = String.Format("##0")
and
AnnotationChart4.Text = String.Format("Point: {0} Value: {1:##0}", AIndex.ToString(), Ternary1.ValueMarkText(AIndex))
TChart1.Series(0).ValueFormat = String.Format("##0")
and
AnnotationChart4.Text = String.Format("Point: {0} Value: {1:##0}", AIndex.ToString(), Ternary1.ValueMarkText(AIndex))
Re: Format ValueMarkText
Hello lilo,
I have reproduce your problem and I have added it as Feature request with number [TF02015258] to be considered for inclusion in futures versions of TeeChart.Net.
I have reproduce your problem and I have added it as Feature request with number [TF02015258] to be considered for inclusion in futures versions of TeeChart.Net.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Format ValueMarkText
Hi lilo,
You can also split mark text string and format it as in this example:
If this doesn't help please let us know what do you want to get exactly.
Thanks in advance.
You can also split mark text string and format it as in this example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Tools.Annotation annotation1;
private Steema.TeeChart.Styles.Ternary ternary1;
private void InitializeChart()
{
ternary1 = new Steema.TeeChart.Styles.Ternary(tChart1.Chart);
ternary1.FillSampleValues();
annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
}
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
int index = ternary1.Clicked(e.X, e.Y);
if (index != -1)
{
string tmp = ternary1.ValueMarkText(index);
string[] tmpArray = tmp.Split(' ');
tmp = " ";
for (int i = 0; i < tmpArray.Length; i++)
{
tmp += String.Format("{0:##0}", tmpArray[i]) + " ";
}
annotation1.Text = String.Format("Point: {0} Value: {1}", index.ToString(), tmp);
}
double m = 5;
this.Text = String.Format("{0:##0}", m.ToString());
}
Thanks in advance.
Best Regards,
Narcís Calvet / 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: Format ValueMarkText
This is the solution to my problem.
Re: Format ValueMarkText
This code worked:
Dim tmp As String, tmp1 As String, tmp2 As String, tmp3 As String, tmparray() As String
tmp = Ternary1.ValueMarkText(AIndex)
tmparray = tmp.Split(" ")
tmp = " "
tmp1 = Format(Val(tmparray(0)), "##0")
tmp2 = Format(Val(tmparray(1)), "##0")
tmp3 = Format(Val(tmparray(2)), "##0")
AnnotationChart4.Text = String.Format("Point: {0} {4}Value: {1} {2} {3}", AIndex.ToString(), tmp1, tmp2, tmp3, vbCrLf)
Dim tmp As String, tmp1 As String, tmp2 As String, tmp3 As String, tmparray() As String
tmp = Ternary1.ValueMarkText(AIndex)
tmparray = tmp.Split(" ")
tmp = " "
tmp1 = Format(Val(tmparray(0)), "##0")
tmp2 = Format(Val(tmparray(1)), "##0")
tmp3 = Format(Val(tmparray(2)), "##0")
AnnotationChart4.Text = String.Format("Point: {0} {4}Value: {1} {2} {3}", AIndex.ToString(), tmp1, tmp2, tmp3, vbCrLf)