wmdyer Posted February 27, 2008 Report Share Posted February 27, 2008 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 Quote Link to comment Share on other sites More sharing options...
maximop Posted February 29, 2008 Report Share Posted February 29, 2008 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++. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.