Thanks for all your videos on Chart.js! I tried, but this seems not to work when you have complex data structure such as those used to generate multiple lines in a line chart. place plugins: [ChartDataLabels] does NOT show the actual data value. It only shows the first item in the data array, plus the name of the second item in the data array, followed by "[object.Object]". Am I doing something wrong?
@ciarangriffin61332 жыл бұрын
Excellent video!
@aliFarooq-dg5fx2 ай бұрын
i want to add negative values below the 0 but it start cutting the edges with in the bar
@Ali-in3br2 жыл бұрын
Should this method work with react-chartjs-2 as well? Currently I’m getting an error saying “Cannot read properties of undefined (reading ‘data’)”
@sarahfowler9741 Жыл бұрын
For anyone else pulling their hair out about this, you HAVE TO access `chart.getDatasetMeta`, not deconstruct it. It's possible that it just loses the context for `this` when you deconstruct (I never use `this`, so I don't know all the pitfalls)
@hasbullahali96085 ай бұрын
Hi want to ask, how to set the colour of sum value text with condition, example if sum below 10, the text will be in red color, if sum over 10 will blue colour
@billionsuper Жыл бұрын
Great example, thank you very much.
@MeghaShree-Jayaram Жыл бұрын
How do we do place total at the right end for indexaxis as y.Meaning when we have horizontal stacked bar chart.
@ChartJS-tutorials Жыл бұрын
This video would help: kzbin.info/www/bejne/opXTmHd7jsiDra8
@gregdominguez5528 Жыл бұрын
Great video, but as usual, because I'm using a datastructure created from a CSV file, this code does not work for me. I receive an error: "Cannot read properties of undefined(reading 'y')". Any idea on how to fix this?
@Blazeplay20 Жыл бұрын
is it possible to hide red sales / black sales number, leaving the total sum only?
@mcLovinHere Жыл бұрын
Hello! Will the code be different if live the red and black bars side by side on the X axis? And is it possible to do without chartDataLabels? upd: Thanks the answer! There is one more) Is it to change the color of numbers when is a difference, that is, if a negative number makes it red, if it is positive, then green. Is there such functionality Chart js?
@ChartJS-tutorials Жыл бұрын
Yes the code will be different as we need to add the sum to the center of the column in that case. We can create custom plugin for this. I will cover a video about this soon.
@massyang4586 Жыл бұрын
Hello and thank you for the video! Is it possible to make click event and get x-axis label value?
@indrajeetyadav84262 жыл бұрын
Hi Thanks for video and showing us how to do. I have a question here as you did the grace part in the video which extends the y-axes to 25 what if the stacked bar chart is showing percentage and we can use it up to 100 so adding more to the y-axes doesn't seems good. can we do the internal padding like thing using layout or something such that it adds space between the chart total at top & legend ?
@ChartJS-tutorials2 жыл бұрын
Hi Indrajeet, thank you for your question. I am correct you are looking this space between legend and the chart area? If so this video should answer your question: kzbin.info/www/bejne/bmjVn4CwerOaabc
@indrajeetyadav84262 жыл бұрын
@@ChartJS-tutorials Yes. Thanks you.
@L-Lesiv Жыл бұрын
and how to put total on right of avery bar for horizontal chart?
@Nekromant991 Жыл бұрын
Hello and thank you for the video! Is it possible to rotate the total sum labels?
@Hjellos Жыл бұрын
Hi! How do we do the same using chart.js version 4.4?
@ChartJS-tutorials Жыл бұрын
In Chart.js 4 it will work as well po. It is the same. This is the canvas API code which Chart.js uses to build their charts.
@Hjellos Жыл бұрын
I only got this to work after downgrading to same chart.js version as you used... Will retry again in case I did something wrong in my code.@@ChartJS-tutorials
@Hjellos Жыл бұрын
Confirm all working well as you said!
@imawc2 жыл бұрын
Thanks for the great video, is it possible to change the total value by switching Legend?
@BrunoRomeo12 жыл бұрын
Excellent video tutorial, I would like to know if it is possible to put the percentage in the lebels. For example, total 100 on top of the bar and in the middle the percentage, Dataset 1 25%, Dataset 2 25%, Dataset 3 25%, Dataset 4 25%.
@amintalukder71892 жыл бұрын
Can I use it with vuejs please
@WHAATYEAAHOKAAY Жыл бұрын
This does not work if one of the bars only has 1 series value. The top label appears at the bottom.
@ChartJS-tutorials Жыл бұрын
Try this one: kzbin.info/www/bejne/p3asXqpmmdhpoJY&ab_channel=ChartJS That was an updated version if I am not mistaken covered your case.