User (Old forums)MemberMarch 14, 2007 at 3:05 pmPost count: 23064
I am using a corporate licenced version of XCeed char for .net.
The scenario which I want to deploy is –
I get some manipulated data and timestamp through a service. I am deploying the data using LineSeries (their are multiple lines with Xvalue as timestamp). I use timescale for X Axis.
I am following the method in given examples under Axes/Scaling/DataTimeScale.
steps that I am doing –
preLine.UseXValues = true;
and supose I add major ticks on X-axis using these lines of code
DateTime beginTime = DateTime.Now;
for (int i = 0; i <= counter; i++)
beginTime = beginTime.AddMinutes(1);
now my aim is to have these fix ticks on x axis but I get random ticks (I suppose these are taken by defualt from XValues).
2nd issue is – my timestamps (recieved values) are separated by few seconds. But Xceed libraries use default time forma (which is HH:MM)
m_Chart.Axis(StandardAxis.PrimaryX).ValueFormatting.Format = ValueFormat.Time;
So values printed on X axis are – 8:12 8:12 8:12 8:13 8:13 8:14 PM. How can I show more precise values in tt:mm:ss (in fact These is the reason I want fixed values as major ticks.)
Any quick help would be appriciated.
Thanks in advance.
Imported from legacy forums. Posted by Pankaj (had 3295 views)User (Old forums)MemberMarch 15, 2007 at 4:25 pmPost count: 23064
First, you need to set the mode of MajorTicks to be manual, so it will take the ticks you provide form your loop.
Second, you need to set the format of the axis label to custom, and then set the format string.
Here is basically what you need to add to your code :
chart.Axis( StandardAxis.PrimaryX ).ScaleMode = AxisScaleMode.DateTime;
chart.Axis( StandardAxis.PrimaryX ).ValueFormatting.Format = ValueFormat.CustomDateTime;
chart.Axis( StandardAxis.PrimaryX ).ValueFormatting.CustomFormat = “H:mm:ss”;
chart.Axis( StandardAxis.PrimaryX ).StaggerTexts = true;
chart.Axis( StandardAxis.PrimaryX ).DateTimeScale.MajorTickMode = MajorTickModeDateTime.Manual;
Imported from legacy forums. Posted by André (had 217 views)User (Old forums)MemberMarch 16, 2007 at 10:59 amPost count: 23064
It is working perfectly. But I could not get the seconds in the HH:MM:SS time format.
I think it is taking default window format and I have no clue how to change it.
Thanks once again.
Imported from legacy forums. Posted by Pankaj (had 224 views)User (Old forums)MemberMarch 16, 2007 at 3:44 pmPost count: 23064
Character case matters. That is, HH:MM:SS is not the same thing as HH:mm:ss. In fact, MM is used only for the date part (months), and mm is for the time part (minutes). If I’m not mistaken, SS is not valid, so you need to set it to ss.
As for HH or hh (or H / h), this is the different hour format :
HH = 09:23:00 / 16:23:00
H = 9:23:00 / 16:23:00
hh = 09:23:00 / 04:23:00
h = 9:23:00 / 4:23:00
Imported from legacy forums. Posted by André (had 4352 views)
- You must be logged in to reply to this topic.