ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  side label layout positioning questions
Posted by andrew on Jan-26-2023 04:53
Attachments:
Can I position the labels to remain only on the right side of the pie chart?
And position the 'unreviewed questions' connecting line so that it is not in the center of the sector?
And can I use a dotted line?
And can I position the {percent} label somewhere other than the center of the sector, like '19' is in the image?
pieChartQuestion.jpg

  Re: side label layout positioning questions
Posted by Peter Kwan on Jan-27-2023 04:53
Hi Andrew,

I think it may be possible to hide the labels of a particular slice (just use Sector.setLabelStyle to set the label color to cd.Transparent), and then add the label with your own code at the position you want. You can use BaseChart.addLine and BaseChart.addText to add lines and texts.

I notice if you can put all labels on one side like in your chart, the last sector must be over 180 degrees (assume your slices are sorted in ascending order). Your code can detect if this is the case, then disable the label of the last sector, and then add a label and the join line to the position you want.

All lines in ChartDirector can be dotted line by using a "Dash Line Color" as the line color. A  "Dash Line Color" can be created using BaseChart.dashLineColor.

https://www.advsofteng.com/doc/cdcom.htm#DrawArea.dashLineColor.htm
https://www.advsofteng.com/doc/cdcom.htm#PieChart.setLineColor.htm

For the label "19" in your image, as each slice already has a label outside the slice, for the second label inside the slice, you probably need to use BaseChart.addText to add that label. With that API, you can add it anywhere you like.

Best Regards
Peter kwan