chartjs/Chart.js

[FEATURE] Datasets as a map/object instead of (just) arrays

Open

#5011 aperta il 30 nov 2017

Vedi su GitHub
 (5 commenti) (1 reazione) (0 assegnatari)JavaScript (11.951 fork)batch import
help wantedtype: enhancement

Metriche repository

Star
 (67.416 star)
Metriche merge PR
 (Merge medio 190g 2h) (1 PR mergiata in 30 g)

Descrizione

I have data I'm adding dynamically to a chart where some data sources have more things to plot than others

So ideally I would do

  mchart.data.datasets[key].data[i]

where key is not a number - that way I don't have to worry about preprocessing the data an ensuring I have a mapping from key -> chart.js index myself

I realize the tradeoff is then there is no set order (maybe alphabetical order?) in the display of the legend

If there is a reason I don't see why this would not work, my apologies and we can close this.

Guida contributor