title | description | type | page_title | slug | res_type |
---|---|---|---|---|---|
Create Custom-Shaped Marker for Graph's Legend Items |
Use custom-shaped marker for Graph's legend items. |
how-to |
Implement custom-shaped marker for Graph's legend items |
create-custom-shaped-marker-for-graph-s-legend-items |
kb |
Product | Progress® Telerik® Reporting |
Report Item | Graph |
The Graph uses the same markers for its series and their respective legend items. Occasionally, it makes sense to substitute the legend markers with custom ones for a better presentation effect.
This can be achieved using a background image that supports transparency (i.e. PNG) and set it as LegendItem.MarkStyle.BackgroundImage.
The transparent area on the image will allow the default series color to be displayed on the legend marker.
Using this approach, the pie chart legend can be presented using circular marks, as shown below:
The default series marker is created using drawing path primitives, therefore it is scalable without quality loss. Using a background image, however, might lead to distorted images on higher zoom levels, because of the resized raster images.