You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the Horizontal stacked barchart, i want the first bar to have label of A1452, and series of 59.62, 16.68, with data labels to include the WO and amount.
I know i will have to peel apart the results from the API to split the data amount into the series, and i figure in the same loop i could set the data labels. Something like below
let serie = '';
let myArray = [];
result.forEach(function(row){
labels.push(Object.values(Object.values(row))[0]);
Object.forEach(function(cell)){
serie = Object.values(Object.values(row))[cell].replace("<WO>","").replace("</WO>",""); // Remove tags
myArray = (Object.values(Object.values(row))[cell].split("|"); // split data value
series.push(myArray[1]);,
serieslabel.push(myArray[0]+myArray[1]); // This is what i don't know how to do
});
});
const chartdata = { labels: labels, series: series };
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How do i add labels to the stacked barcode series?
For instance, sometimes you want the value being graphed, and in my case i need to also include some other text.
Below shows how a non stacked can use animationComplete callback
https://stackoverflow.com/questions/31529272/how-to-custom-index-label-on-each-bar-chart-using-chartjs
Results from database
Machine StdHoursForWOs
For the Horizontal stacked barchart, i want the first bar to have label of A1452, and series of 59.62, 16.68, with data labels to include the WO and amount.
I know i will have to peel apart the results from the API to split the data amount into the series, and i figure in the same loop i could set the data labels. Something like below
Beta Was this translation helpful? Give feedback.
All reactions