DannE Posted October 29, 2007 Report Share Posted October 29, 2007 Is is possible to split point labels over two lines? Lets say I have a column name "Intra sector" in the dataset and I want to display it, in the bar charts, as: Intra Sector on one of the bar..is it doable? Quote Link to comment Share on other sites More sharing options...
maximop Posted October 30, 2007 Report Share Posted October 30, 2007 It is possible to split a string and show it as a point label. Below is a code snippet showing this: string myLabel = "Intra\nSector"; Chart1.Point[0, 0].Tag = myLabel; Chart1.PointLabelMask = "%L"; Chart1.PointLabels = true; You can search the ChartFX Samples and Resource Center (Documentation installed with the product) for more information on the PointLabelMask property. Basically, you will need to retrieve the label from your dataset, to split it you can use the newline character (\n), and then assign it to the tag property. The %L is used to show the value of the tag property, respectively. Quote Link to comment Share on other sites More sharing options...
DannE Posted October 31, 2007 Author Report Share Posted October 31, 2007 Thanks.. on similar lines is it possible to set the legends of each series? I have been trying Chart1.Series[0].Legend = "Series 1" but it doesn't work... Quote Link to comment Share on other sites More sharing options...
maximop Posted October 31, 2007 Report Share Posted October 31, 2007 That line should work as expected. I just tried it myself and it changed the legend for that series. Are you displaying the DataEditor or the SerLegBox? If not, please do so and you will see the changed text displayed. This is what I did: Chart1.Series[0].Legend = "Series 1"; Chart1.SerLegBox = true; 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.