DataPoint LabelFormat

时间:2014-08-14 14:46:22

标签: c++ charts datapoint

我简化了这段代码,在我的图表中显示了很好的数据,但问题是我想在所有点旁边显示一个标签,所以它看起来像this。现在它就像this一样,看起来很难看。

MSDN和其他方面的LabelFormat文档实际上没有用处。

[...]
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);
[...]

1 个答案:

答案 0 :(得分:0)

尝试禁用系列上的智能标签。

series1->SmartLabelStyle->Enabled = false;