I am using Telerik Reporting with WPF Windows Application to show a Pie Chart like the one in the image I have attached. I am not able to get the DataPointLabelConnector, I mean the line that connects the label with its part of the pie chart.
These are the properties I set for the Serie:
- DataPointLabelAlignment: OutsideColumn.
- DataPointLabelOffset: 30px.
- DataPointLabelConnectorStyle has its Visible property set to true.
Do you know what is happening?
9 Answers, 1 is accepted
Please check the value of DataPointLabelConnectorStyle.LineColor property if is set to White or Transparent. It determines the color that will be used to draw the connector line. You can reset the property, which will use the default Black color. You can also check the DataPointLabelConnectorConditionalFormatting property if it has some rules defined that might affect the line color.
In case you still have troubles, please send us the report definition so we can test it on our side.
DataPointLabelConnectorStyle.LineColor property is set to Black.
The DataPointLabelConnectorConditionalFormatting property has not any rule defined.
I have copied the code below from my Designer.cs file (is that what you mean with the report definition?):
I examined the code you pasted (yes, that's a part of the report definition) and it actually shouldn't produce any label connectors, because it has a category group defined.
Having set a category grouping would produce more than one "layer" on your pie chart, making the outside-column labels unreadable. That's why the OutsideColumn property is only respected when the chart's CategoryGroup.Groupings is empty (No grouping). When I made that change to your code, the pie chart was displayed with visible black label connectors, as you can see in the attached example.
If you're still experiencing problems after applying the changes suggested above, please send us the whole report definition along with some sample data so we can test it on our side.
I have tried what you suggest but I can not get it working. You can download an example of datasource for the sqlDataSourceRvGroupbySector from this link. In the report definition I have more than one pie chart but the one we are working on is the "graph2". You can see below my report definition:
Sorry for sending multiple charts in the report definition. You might see it clearer now with just the chart we are treating:
I examined the report definition and noticed a few strange issues. Two GraphGroup instances: graphGroup1 and graphGroup4 are added to the graph's groups collection, but are not used in its series, which uses graphGroup2 and graphGroup3. This might happen if the designer.cs file has been modified manually. I deleted the first group instances and now the graph uses only graphGroup2 and graphGroup3.
More, your pie chart setup seems incorrect, since it has a category grouping defined, and, as mentioned earlier, you don't need that for such simple scenarios, so I deleted the category group's grouping and changed the series group to Sector.
Finally, the graph's CoordinateSystem has its angular axis set to CategoryScale, which was causing the incorrect display of the "pie slices" - all the slices were the same size, regardless the Total value they represent. In your scenario I guess the angular axis represents the value, so it should use a Numerical Scale and the radial axis should use a Category Scale. The axes switch can be done by right-clicking on the graph and choosing "Swap Axes" from the context menu.
And finally, your graph item had its Visible property set to false, which would naturally prevent its rendering.
We strongly recommend using the Graph Wizard to create complex graphs in order to avoid such mistakes. Using the wizard, you only have to select the data source, drag the Sector field into Series box and Total field to Values box and your pie chart will be done, saving the effort of setting it up manually.
I have attached the fixed report definition, which uses a CSV data source for the graph data. Please examine it and apply the changes, described above, to your report.
Thanks again for your help.
Is the result that you got the same as the image that I attached to the first post? I want to group the pie by sector and the legend at the bottom by categoria. I am not sure if we are trying to achieve the same or if I got you wrong.
The pie chart I attached earlier differs than the one in your original post, because I thought your chart was incorrect - all of its slices have the same size, which is unexpected for a pie chart, where the data's most significant value is represented by the size of the sector and the user can judge about the value ratios by visually comparing the pie slices.
However, the legend represents the series groups, so there is no straightforward way of having different number of series in the graph and in the legend. You can control a legend item visibility by its ConditionalFormatting property and this way you can make some legend entries invisible.
You can also apply coloring to the pie series using Graph's ColorPalette or ConditionalFormatting so your pie slices will be colored according to their Category and not Sector they belong to.
Thanks for your help!