I need to implement a scatter chart similar to the image below. I have a single series, but want each point to be a circle having a different color. I would also like to show each point in the legend rather than just showing a single item because I have a single series. I assume I will need to define a markerTemplate, but I'm unclear on how to do that. Not sure how to implement the legend either.
I have managed to prepare a sample for you, which shows how you could replace and change the color per series.
But there is no exposed functionality that allows you to change the legend color and representation. It is fully depended on the series declarations. So you have two choices:
1. Declare more than one series. Then you won't need the logic into the markerTemplate, because you would be able to apply a different color per each series.
2. Build your own custom legend which is fully independent of the chart component by applying the same logic you are using for changing the series colors.
If you have further questions, please contact us again.
Adding the suggestion for the markerTemplate works quite well. Thank you.
However, I also have property 'showTooltip: true' for the series. Once I add the markerTemplate I no longer get a tooltip. All I did was to add this property to your example. If I remove markerTemplate, then the tooltip appears.
That's my fault, sorry. I've forgotten to add the measureInfo (width and height) in the markerTemplate.
I've updated the sample and now everything works perfectly.