ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  How to display x-axis time in seconds format?
Posted by cho on Feb-13-2024 09:50
Hello Peter,

In MFC "Realtimemultithread example", how do I display x-axis labels only as values from 0 to seconds instead of displaying them in {value|mm/dd/yy<*br*>hh:nn:ss} format?

For example, I want to display it like this: 0, 1, 2, 3, ...., 10800, 10801, 10802, ....


I tried it like this :

const int sampleSize = 10800;
c->xAxis()->setLinearScale(0, sampleSize, 50);
c->xAxis()->setTickDensity(75);
c->xAxis()->setLabelFormat("{value|ss}");
c->xAxis()->setMinTickInc(1);
viewer->syncLinearAxisWithViewPort("x", c->xAxis());


Thank you in advance.

Best regards
Cho

  Re: How to display x-axis time in seconds format?
Posted by Peter Kwan on Feb-13-2024 14:18
Hi Cho,

In the original sample code, there are the following lines:

(1)  c->xAxis()->setDateScale(viewPortStartDate, viewPortEndDate);

(2)  c->xAxis()->setLabelFormat("{value|hh:nn:ss}");

Please change (1) to:

(1)  c->xAxis()->setLinearScale(viewPortStartDate, viewPortEndDate);

and please remove the (2). Line (2) is not necessary for numeric scale.

Best Regards
Peter Kwan