sgratzl / chartjs-chart-boxplot

Chart.js Box Plots and Violin Plot Charts
https://www.sgratzl.com/chartjs-chart-boxplot/
MIT License
101 stars 23 forks source link

Highlight the specific point on box-plot #16

Closed deviirmr closed 2 years ago

deviirmr commented 2 years ago

I like your library very much and it's exactly what I am looking for... Using you lib I have created a chart with 100 data points that represent the score from the different users. Now I wish to highlight the score of the specific user so that he can recognize his status on the box plot. is it possible to highlight the specific point of one user in the box-plot, such as with different colours or Size?

I tried something inside datasets, but it's not working

        itemRadius: function(context) {

              context.raw.forEach((val) => {
                   if(val == 5) {
                   console.log(val);
                   return 5;

                   }
                   else {
                    console.log(val);
                   return 20;
                   }
                   });

                }

I am using version 3.6.0

Do you have any suggestions?

Thanks!

sgratzl commented 2 years ago

This is currently not possible since individual items points are just addons to the boxplots but not visual points by themselves.

676339784 commented 2 years ago

@sgratzl Have a similar question, let me know if I should create a separate issue

I want to have a tooltip when hovering over the individual items points, is that possible? I can do it with outliers but not the non-outlier ones. For example, I would like to display tooltip when hovering over these individual points (this is from samples/index.html)

sgratzl commented 2 years ago

that is also not possible mainly because of scalability reasons. box plots are usually used when you have a lot of data points, thus computing the overlap would be expensive