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

Provide summary data #20

Closed JeremyBradshaw7 closed 2 years ago

JeremyBradshaw7 commented 2 years ago

I'd like to have the plugin work with the summary data I give it (eg. whisker values, mean & quartiles), rather than working out the summary from a set of points. I think you refer to this in your readme but the link provided (https://github.com/sgratzl/chartjs-chart-boxplot/blog/dev/src/data.ts#L24-L49) is dead. Can you provide some detail how to do it, or fix the link?

Can this plugin be used for chartjs v2 or is it only for v3?

JeremyBradshaw7 commented 2 years ago

I think I found out from the code, so it's something like:

    data: [
      {min: 5, q1: 40, median: 50, mean: 55, q3: 60, max: 95},
    ]

mean can be omitted but median cannot it seems.

sgratzl commented 2 years ago

see also https://github.com/sgratzl/chartjs-chart-boxplot/blob/main/samples/datastructures.html

JeremyBradshaw7 commented 2 years ago

Thanks