Failed to add Marks manually
Failed to add Marks manually
I want to add Marks at some index of series, but failed..
please help me!
Find the attachment for the example project!
please help me!
Find the attachment for the example project!
- Attachments
-
- AddMarks.zip
- (95.97 KiB) Downloaded 861 times
Re: Failed to add Marks manually
Hello,
Looking at your project, you have two series, named SeriesMark and SeriesData. Only SeriesData has points:
Then, the button does this:
So you are adding a single point to the SeriesMark series, and then accessing to the point with index=3 to set its label.
Note that, if you are going to add the point and set the label at the same time, you can just pass the label in the same AddXY call:
If you need to set the label in a separate instruction, you can use "Labels->Labels[0]" (0 for the first point in the series).
Looking at your project, you have two series, named SeriesMark and SeriesData. Only SeriesData has points:
Code: Select all
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
// Data series
SeriesData->FillSampleValues(10);
}
Code: Select all
void __fastcall TForm2::Button1Click(TObject *Sender)
{
double max = Chart1->LeftAxis->Maximum;
// Mark sereis which is used to show some mark.
SeriesMark->Marks->Visible = true;
SeriesMark->Marks->Transparent = true;
// Tried to add a mark at index of 3 .
SeriesMark->AddXY(3, max);
SeriesMark->Marks->Item[3]->Text->Text = "N";
}
Note that, if you are going to add the point and set the label at the same time, you can just pass the label in the same AddXY call:
Code: Select all
void __fastcall TForm2::Button1Click(TObject *Sender)
{
double max = Chart1->LeftAxis->Maximum;
// Mark sereis which is used to show some mark.
SeriesMark->Marks->Visible = true;
SeriesMark->Marks->Transparent = true;
// Tried to add a mark at index of 3 .
SeriesMark->AddXY(3, max, "N");
//SeriesMark->Marks->Item[3]->Text->Text = "N";
}
Code: Select all
void __fastcall TForm2::Button1Click(TObject *Sender)
{
double max = Chart1->LeftAxis->Maximum;
// Mark sereis which is used to show some mark.
SeriesMark->Marks->Visible = true;
SeriesMark->Marks->Transparent = true;
// Tried to add a mark at index of 3 .
SeriesMark->AddXY(3, max);
SeriesMark->Labels->Labels[0]="N";
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Failed to add Marks manually
Thanks for your reply.
I know that the mark could be added directly by the code below,
but the grid also disapeared...
So I have tried to use the following code to modify mark manually.
But it didn't work well...
I know that the mark could be added directly by the code below,
but the grid also disapeared...
Code: Select all
SeriesMark->AddXY(3, max, "N");
Code: Select all
SeriesMark->Marks->Item[3]->Text->Text = "N";
Re: Failed to add Marks manually
Hello,
Could you please add it to bugzilla ? Doing so you'll be identified as the creator of the issue and therefore notified about its evolution.
Thanks in advance.
In the case you want to continue displaying all the axis grid lines and bottom axis labels you have to set the bottom axis style to Value :I know that the mark could be added directly by the code below,
but the grid also disapeared...
Code: Select all
Chart1.Axes.Bottom.LabelStyle := talValue;
Here you're correct, this is a bug, you should be able to set a specific mark text but using the code above, I testing it here the mark appear without text on it.elmec wrote:So I have tried to use the following code to modify mark manually.But it didn't work well...Code: Select all
SeriesMark->Marks->Item[3]->Text->Text = "N";
Could you please add it to bugzilla ? Doing so you'll be identified as the creator of the issue and therefore notified about its evolution.
Thanks in advance.
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Failed to add Marks manually
So is there any way to fix the problem...
We are going to release our software...
We are going to release our software...
Re: Failed to add Marks manually
Hello,
yes, a workaround would be to set the axis label style to "talValue", like :
yes, a workaround would be to set the axis label style to "talValue", like :
Code: Select all
procedure TForm1.BitBtn1Click(Sender: TObject);
var max : double;
begin
max := Chart1.LeftAxis.Maximum;
// Tried to add a mark at index of 3 .
Series1.AddXY(3, max);
Series1.Labels.Labels[0]:='N';
Chart1.Axes.Bottom.LabelStyle := talValue;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Failed to add Marks manually
Hello,
Thanks for your advice.
But would you please tell us how to fix the Marks problem.
We cannt wait for the next release.
Thanks for your advice.
But would you please tell us how to fix the Marks problem.
We cannt wait for the next release.
Pep wrote:Here you're correct, this is a bug, you should be able to set a specific mark text but using the code above, I testing it here the mark appear without text on it.elmec wrote:So I have tried to use the following code to modify mark manually.But it didn't work well...Code: Select all
SeriesMark->Marks->Item[3]->Text->Text = "N";
Could you please add it to bugzilla ? Doing so you'll be identified as the creator of the issue and therefore notified about its evolution.
Thanks in advance.
Re: Failed to add Marks manually
Hello,
Isn't the workaround Pep suggested valid for you? Why?elmec wrote:But would you please tell us how to fix the Marks problem.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Failed to add Marks manually
Hello elmec,
as you can see at the bug resolution, it was my mistake when I say you were correct about the issue. It's not a bug. As you only have added one point to the Series, to be able to set a specific mark text for that point you have to use the 0 index for the item, like :
as you can see at the bug resolution, it was my mistake when I say you were correct about the issue. It's not a bug. As you only have added one point to the Series, to be able to set a specific mark text for that point you have to use the 0 index for the item, like :
Code: Select all
// Tried to add a mark at index of 3 .
SeriesMark->AddXY(3, max);
SeriesMark->Marks->Item[0]->Text->Text = "N";
SeriesMark->Marks->Item[0]->Font->Size=18;
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Failed to add Marks manually
OK , I'd like to repeat the problem again.
---------Code-----------
---------Code-----------
But the result is as the attachment! There is no text on mark!
---------Code-----------
Code: Select all
Series1->Marks->Visible = true;
// Add 5 points to Series
int xpoints[5] = {10, 20, 30, 40, 50};
int y = 100;
for (int i = 0; i < 5; i++)
{
Series1->AddXY(xpoints[i], y, IntToStr(i + 1));
}
Series1->Marks->Item[0]->Text->Text = "test";
But the result is as the attachment! There is no text on mark!
- Attachments
-
- marks.png (48.89 KiB) Viewed 24361 times
Re: Failed to add Marks manually
Hello elmec,
It's strange, it's working fine here with the latest TeeChart Pro v2013.09.131217 version usign the code you posted.
Could you please check which TeeChart version appears into your About box ?
It's strange, it's working fine here with the latest TeeChart Pro v2013.09.131217 version usign the code you posted.
Could you please check which TeeChart version appears into your About box ?
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Failed to add Marks manually
Hello Pep,
Find the attachment for the Teechart version and example project.
Find the attachment for the Teechart version and example project.
- Attachments
-
- Marks.zip
- (163.29 KiB) Downloaded 809 times
-
- teechart version.png (115.41 KiB) Viewed 24324 times
Re: Failed to add Marks manually
Hello Pep,
Find the attachment for the Teechart version and example project.
Find the attachment for the Teechart version and example project.
- Attachments
-
- Marks.zip
- (163.29 KiB) Downloaded 824 times
Re: Failed to add Marks manually
Hello,
Since you are a source code customer, I'll send you a link to private beta version just built to the mail account you have registered in this forum.
Since you are a source code customer, I'll send you a link to private beta version just built to the mail account you have registered in this forum.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Failed to add Marks manually
Thanks,
I'll try it and tell you the result.
I'll try it and tell you the result.