I'm trying to show data on Chart (Windows Forms, VS2010, C++, .NET) with axisX labels showing it's x-value with milliseconds.
Using X-data type: DateTime.
I set chart properties to
chartArea1->AxisX->LabelStyle->Format = L"HH:mm:ss.fffffff";
chartArea1->AxisX->LabelStyle->IntervalType = System::Windows::Forms::DataVisualization::Charting::DateTimeIntervalType::Milliseconds;
I'm adding milliseconds to DateTime structure like
dt = dt->AddMilliseconds(1345768.0);
so by
dt->ToString("HH:mm:ss.fffffff")
i'm seeing a correct
"00:22:25.7680000" value
and chart displays several points correctly separated according to milliseconds value.
But the axisX labels show x-value like this
"00:22:25.0000000" that are the values of segments.
What else should I do to make chart show labels correctly with milliseconds??? Maybe more segments of axisX?
UPDATE:
I found the solution of the interval problev (see sol.1 to this question) but there appear another one problem!
Now I have labels every 250ms as AxisX->Interval is set to 250
chartArea1->AxisX->Interval = 250;
but labels appear only on round values like
22:25.000 - 22:25.250 - 22:25.500 - 22:25.750
Though my axisX minimum and maximum are dynamically changed and start from not round value that leads to labels moving.
What I need is 5 or 6 labels on X axis in same places: one at the start, one at the end, and 3-4 in the middle.
How to???