TLineSeries Stairs type - Mark Point control
TLineSeries Stairs type - Mark Point control
Hi!
I am using TChart Pro 8.02 and in the current product TLineseries, Stairs type...
The Mark Text seems to be always placed at the end of the line drawn, pretty much where the x/y coordinates are for the point.
Is there a way to tell TChart that you want the marks to identify the beginning of the line and point to the initial point drawn?
Thanks,
Tim
I am using TChart Pro 8.02 and in the current product TLineseries, Stairs type...
The Mark Text seems to be always placed at the end of the line drawn, pretty much where the x/y coordinates are for the point.
Is there a way to tell TChart that you want the marks to identify the beginning of the line and point to the initial point drawn?
Thanks,
Tim
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tim,
Sorry but I don't understand what do you exactly mean here. Would you be so kind to give us some more details of what you are trying to achieve? An image would be helpful.
You may post your files at news://www.steema.net/stema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Yes, that's right.I am using TChart Pro 8.02 and in the current product TLineseries, Stairs type...
The Mark Text seems to be always placed at the end of the line drawn, pretty much where the x/y coordinates are for the point.
Is there a way to tell TChart that you want the marks to identify the beginning of the line and point to the initial point drawn?
Sorry but I don't understand what do you exactly mean here. Would you be so kind to give us some more details of what you are trying to achieve? An image would be helpful.
You may post your files at news://www.steema.net/stema.public.attachments newsgroup or at our upload page.
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 |
Yes, I can. e.g. If I have a time line (X) and a temperature (Y) and lets say the first step in some array of stpes says that something should run for e.g. 5 minutes, currently the Mark text is marked at e.g. 70C and 05:00...
Instead of marking 00:00 as the 1st Step... meaning it is pointing to the end of the line...
Is this better?
/Tim
Instead of marking 00:00 as the 1st Step... meaning it is pointing to the end of the line...
Is this better?
/Tim
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tim,
Thanks for the info.
I'm using this code:
With v8.03 I get this chart:
So, if I understood correctly, instead of getting the "6" mark at X=2 you get it at X=10?
Thanks in advance.
Thanks for the info.
I'm using this code:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.Clear;
Series1.Stairs:=true;
Series1.Marks.Visible:=true;
Series1.AddXY(0,5);
Series1.AddXY(1,7);
Series1.AddXY(2,6);
Series1.AddXY(10,8);
Series1.AddXY(11,4);
end;
So, if I understood correctly, instead of getting the "6" mark at X=2 you get it at X=10?
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tim,
Sorry but I'm still unable to reproduce the issue here. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
Thanks in advance.
Sorry but I'm still unable to reproduce the issue here. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tim,
Thanks. I'd prefer if you posted the files at the upload area I pointed you earlier in the thread. That way my colleagues can make their contributions to the discussion.
Thanks in advance!
Thanks. I'd prefer if you posted the files at the upload area I pointed you earlier in the thread. That way my colleagues can make their contributions to the discussion.
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 |
Hi!
The sample project TimGraph is now at your upload site...
You will see that Step 0 draws at 05:00 minutes... what we need is that the Mark/Draw shows that the Step starts at 00:00 and last 05:00 minutes...
Meaning it should show the start of the items, then the line showing duration, then a new step...
Tim
The sample project TimGraph is now at your upload site...
You will see that Step 0 draws at 05:00 minutes... what we need is that the Mark/Draw shows that the Step starts at 00:00 and last 05:00 minutes...
Meaning it should show the start of the items, then the line showing duration, then a new step...
Tim
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tim,
Thanks for the example project.
In that case you should add a value at 00:00, for example, modifying this part of your code:
and adding OnGetMarkText event like this:
Thanks for the example project.
In that case you should add a value at 00:00, for example, modifying this part of your code:
Code: Select all
if(i==0)
{
Chart1->Series[0]->AddXY(tAxisTime1.Val,60.7,"",clRed);
tAxisTime1 = tAxisTime+EncodeTime(0,5,0,0);
}
else
{
tAxisTime1 = tAxisTime1+EncodeTime(iHour,iMin,iSec+45,0);
}
Code: Select all
void __fastcall TForm1::Series1GetMarkText(TChartSeries *Sender, int ValueIndex,
AnsiString &MarkText)
{
if (ValueIndex == 0) {
MarkText="";
}
}
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 |
Hi!
Adding a step to point to 00:00 and hiding the mark solves the starting time.
But that still leaves me with the problem that the Step Marks always point to the end of the step...not at the beginning of the step line.
If I have a task with a duration of 5 minutes than it should point to 00:00->05:00... or a task from 05:00->10:00... should point at start not end... Would I need to add invisible points to all stairs, if yes, than it might be either to make a line chart and connect the points and control the marks that way... meaning each line would have 2 points marking start and end... and only start showing the mark...
Do you have some better solution?
Thanks,
Tim
Adding a step to point to 00:00 and hiding the mark solves the starting time.
But that still leaves me with the problem that the Step Marks always point to the end of the step...not at the beginning of the step line.
If I have a task with a duration of 5 minutes than it should point to 00:00->05:00... or a task from 05:00->10:00... should point at start not end... Would I need to add invisible points to all stairs, if yes, than it might be either to make a line chart and connect the points and control the marks that way... meaning each line would have 2 points marking start and end... and only start showing the mark...
Do you have some better solution?
Thanks,
Tim
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tim,
In that case you can change your code like this:
In that case you can change your code like this:
Code: Select all
void __fastcall TForm1::DrawProtoGraph(void)
{
int iHour=0;
int iMin=0;
int iSec=0;
AnsiString sStep;
TDateTime tAxisTime = Now();
ReplaceTime(tAxisTime,EncodeTime(0,0,0,0)); //we want time to start at 00:00
TDateTime tAxisTime1 = tAxisTime;
Chart1->MaxPointsPerPage = 5;
ChartTool2->Active = true;
for(int i=0;i<10;i++)
{
sStep="Step "+IntToStr(i+1);
if(i==0)
{
sStep = "Step "+IntToStr(i);
Chart1->Series[0]->AddXY(tAxisTime1.Val,60.7,sStep,clRed);
tAxisTime1 = tAxisTime+EncodeTime(0,5,0,0);
}
else
{
tAxisTime1 = tAxisTime1+EncodeTime(iHour,iMin,iSec+45,0);
}
if(i==3)
{
sStep = "Step "+IntToStr(i);
Chart1->Series[0]->AddXY(tAxisTime1.Val,25.7,sStep,clRed);
}
else
if(i==4)
{
sStep = sStep+" Loop";
tAxisTime1 = tAxisTime1+EncodeTime(iHour,iMin+5,iSec,0);//just an offset to show step
Chart1->Series[0]->AddXY(tAxisTime1.Val,70.0,sStep,clGreen);
}
else
{
if (i!=0)
{
sStep = "Step "+IntToStr(i);
Chart1->Series[0]->AddXY(tAxisTime1.Val,60.7,sStep,clRed);
}
}
}
}
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 |