Is it possible to compare the value of one data point in a series with another data point at the same x point?
Problem:
Hello, I am working on a scatter plot, I have 2 series within one chart. As you can see in the pic, the green circles, that's one series and the gray colored is another. I want the green series data point to be red if they are lesser than gray series data point and green if its greater than gray series gray data point. How can I do that?
Solution:
We currently don't have an out of the box feature to compare the value of one data point in a series with another data point at the same x point but this can be easily pulled off by using custom data tokens in combination with markers and rules. The custom token is defined in the plot or series object as an attribute or array using the "data" prefix, e.g., data-fullname or data-extracredit. It is then recalled in the tooltips, value boxes, markers, or crosshair plot labels, e.g., %data-fullname or %data-extracredit. What we did in this demo was to compare the first plot series(entries) with the second plot and return 'greater' or 'less' appropriately. This result is what we use on the custom data token on the first plot and use it to style the marker accordingly using rules