Jump to content
Software FX Community

Setting individual Point Label Values


wmdyer

Recommended Posts

I was wondering if there was a way I could set individual pointlabels by hand or something to that effect.  I know about the PointLabelMask property, but am not 100% satisfied with the control over the formatting.

Here is an example:

I set "Percent: %p%% Value: %v" for pointlabelmask and the # of decimal places for the axis is 2

What I WANT is "Percent: 85.64% Value: 250" (decimal for % and integer for valule )

What I GET is "Percent: 85.64% Value: 250.00"

Is there a way to further control formatting for pointlabelmask or is there a way I can explicitly set the string myself?  I don't see how to set a value for pointlabels in the documentation or in the source files.

 Any ideas?

Thanks,

-Mac

Link to comment
Share on other sites

To set the point labels for individual points, you need to access the PointLabels property of the PointAttributes. You can do as follows:

m_chartPtr->GetPoint()->GetItem(0, 0)->PointLabels = true;

m_chartPtr->GetPoint()->GetItem(0, 2)->PointLabels = true;

In regards to not showing the decimals when accessing the data values, you can set the Decimals property of the DataFormat to 0, and the Decimals property of the LabelsFormat to 2. This will show the desired point labels with no decimals but will keep the decimals on the axis labels. You can do the following:

m_chartPtr->AxisY->DataFormat->Decimals = 0;

m_chartPtr->AxisY->LabelsFormat->Decimals = 2;

m_chartPtr->PointLabelMask = "%p%% Value: %v";

Please note that the above code is for C++.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...