This is a migrated thread and some comments may be shown as answers.

Conditional Visiblity of Markers on a line graph

4 Answers 272 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ramya
Top achievements
Rank 1
Ramya asked on 07 Jun 2017, 08:25 PM

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

Sort by
0
Katia
Telerik team
answered on 08 Jun 2017, 11:42 AM
Hi Ramya,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ramya
Top achievements
Rank 1
answered on 08 Jun 2017, 03:50 PM

Hi Katia,

Thank you for the response. It does the trick. 

0
Carl
Top achievements
Rank 2
answered on 06 Oct 2017, 12:00 PM

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

0
Katia
Telerik team
answered on 09 Oct 2017, 01:34 PM
Hi 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Ramya
Top achievements
Rank 1
Answers by
Katia
Telerik team
Ramya
Top achievements
Rank 1
Carl
Top achievements
Rank 2
Share this question
or