I have a line graph in my telerik report. I Need to display markers only if they satisfy a condition.
Otherwise the points should just make the line, but markers shouldn't be visible unless it satisfies the condition
Can this feature be achieved ?
4 Answers, 1 is accepted
By default, markers cannot be hidden based on the condition, only the whole series can be hidden.
To achieve the required behavior, you can hide the markers of the existing LineSeries and add a second LineSeries with markers only (bound to the same data source). The idea of the additional LineSeries is to display the data points conditionally using the required expression in DataPointConditionalFormatting property.
Legend item of the additional series can be hidden with LegendItem.Style.Visible property set to false.
The attached report demonstrates the above approach. It can be opened in Standalone Designer R2 2017 and it uses some sample data from AdventureWorks SQL database.
Hope this will help.
Regards,
Katia
Progress Telerik
Hi Katia,
Thank you for the response. It does the trick.
Had kind of the same problem. On a graph with a number of series I needed an identification (not the color) of the actual series.
I added two columns to my datasource: 'marker' and 'showMarker'. I used the 'marker' as DataPointLabel and used the 'showMarker' in a DataPointyLabelConditionalFormat to control the display of the marker. If 'showMarker' is true the marke is displyed, if 'showMarkes' is false the marker is removed in the StyleBuilder by removing the checmark in 'Layout'->visible.
This works very fine for me and since the control is in the datasource a lot of flexibility is achieved. I've used the same sytem to control other marking.
BTW: It appears that the DataPointLabelStyle also controls the style used in the legend. That's pretty confusing! Do we have an error here?
br. Carl
That is correct, the color of the legend marker and its line properties are affected by the DataPointStyle definition. The diagram in Style Resolving Fallback Algorithm help article displays how the series styles are propagated.
To apply different styles to the legend, you need to use Series.LegendItem style properties.
Regards,
Katia
Progress Telerik