c++chartsdatapoint

DataPoint LabelFormat


I got this code simplified that display very well my data in my chart but the problem is that i want to display a label RIGHT next to all the points so it looks like something this. For now it's like this and it looks ugly.

The documentation of LabelFormat on MSDN and others are not really helpful.

[...]
System::Windows::Forms::DataVisualization::Charting::DataPoint^ a_point;
System::Windows::Forms::DataVisualization::Charting::Series^ series1 =
    (gcnew System::Windows::Forms::DataVisualization::Charting::Series());

for (i = 0; i < X.size(); i++)
{
    a_point = (gcnew System::Windows::Forms::DataVisualization::Charting::DataPoint());
    a_point->SetValueXY(X[i], Y[i]);
    a_point->Label = i.ToString();
    a_point->LabelForeColor = System::Drawing::Color::Gray;
    a_point->LabelFormat = ""; // here

    series1->Points->Add(a_point);
}

Series->Add(series1);
[...]

Solution

  • Try disabling the smart labels on the serie.

    series1->SmartLabelStyle->Enabled = false;