Displaying custom labels from an array
See original GitHub issueI’ve got an array of data points, and another one of data label strings. I’m graphing the points and would like to use the strings as labels. How do I use this plugin to do so? Here’s what I’ve got right now:
datasets: [{
label: 'Phenological States',
data: phenoArray(historicalData).values,
datalabels: phenoArray(historicalData).labels,
// ...
}]
Edit(SB): code formatting
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Custom label from using separate array in Chart JS
In the above code data.price is storing the price array. I need to pass the store details with it and show it in...
Read more >Use Custom Label in Lightning Component array of String ...
Save this question. Show activity on this post. I want to build a component that looks like the Radio Group Alternate one of...
Read more >Label and Value in an array - help needed :( - ACF Support
Here's what I'm trying to achieve and works when only one option is selected. It prints the label as the anchor and the...
Read more >Analyzing an image with a trained model - Rekognition
Custom labels are returned in an array of Custom Label objects. Each custom label represents a single object, scene, or concept found in...
Read more >register_post_type() | Function
An array of labels for this post type. ... In general, you should always prefix your post types, or specify a custom `query_var`,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added some docs and a sample how to display custom labels (bea5b4be8dd99a4).
It’s possible, but
dataset.datalabels
is reserved for the plugin options so can’t be used to store custom labels. You can either use the Chart.js built-indata.labels
(category scale) or you can store them under whatever other unreserved name in the dataset (e.g.dataset.labels
). Then you need to define a custom formatter and use context to reach your values.If you use
data.labels
(fiddle):If you use
dataset.labels
(fiddle):