| | | | Browse by category |
Question
How to mark specific points dynamically through css?
Answer
This sample demonstrates how to mark specific points dynamically through CSS.
In the style-sheet, write a rule that compares the x-value of a point with the value of the target property:
point['@}@x-@myProperty'==0] { marker: DIAMOND; }
At runtime, to highlight a certain point, set the property on the dataset. The property's value being the x-value of the highlighted point. For example, to highlight the point with x=2 of the first dataset:
dataSource.getDataSet(0).putProperty("myProperty", new Double(2),true);
Make sure the chart's dynamicStyling
property is set to true (this is the default value). This will ensure that the display will be updated each time the property is changed.
Refer to the codefragments/chart/rendering-hint
sample for way to display specific data points with marker without using CSS.