Тёмный

How to Add More Information in the Tooltips in Chart JS 

Chart JS
Подписаться 20 тыс.
Просмотров 25 тыс.
50% 1

Опубликовано:

 

22 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 59   
@ChartJS-tutorials
@ChartJS-tutorials 3 года назад
Enjoyed this video but need to do custom date formatting in your tooltip? Watch this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-GnRAbf9MMQI.html
@forwork5516
@forwork5516 Год назад
I started with Chartjs using a simple chart, but as the project progressed, customer requests increased. Every time I was worried about how to do it, but you made a video and shared what I was looking for. Keep it up!
@casadacrianca11
@casadacrianca11 3 года назад
Thanks! You were the only one who really explained how the tooltip works in the chart js 3 version!!! Saved my project!
@ChartJS-tutorials
@ChartJS-tutorials 3 года назад
Thank you for your kind words. I'm glad it was helpful and got you ahead. Tooltips is a quite powerful and there is a lot behind the scene that can be done once you know how. Good luck with your project!
@turklerburada
@turklerburada Год назад
I looked for this for like 1-2 days. I wish I knew it was called tooltip but it is okay lol. Thank you so much for the video.
@victorhugovaldezsoto
@victorhugovaldezsoto 2 года назад
Let these videos keep coming. Really useful and self-explanatory. By showing what's going on the dev console, one can look up and explore more functionality and other properties. Thanks a lot for these videos.
@chrispope1946
@chrispope1946 Год назад
Excellent video - really saved me a load of time. Many thanks.
@GiZm0865
@GiZm0865 Год назад
Thank you so much!! Amazing explanation!!
@apuroopbusetty2432
@apuroopbusetty2432 2 года назад
Thanks sir I was struggling with this today for 3 hours. I love your video
@nithinsamuel9995
@nithinsamuel9995 2 года назад
Thanks for the upload very useful channel
@olivier3566
@olivier3566 3 года назад
thanks to be there for us, keep it up love your work !
@ChartJS-tutorials
@ChartJS-tutorials 3 года назад
Thank you for your kind words! Just helping out as Documentation Chart.js can be very tricky. I'm happy to hear the videos are helping you out.
@rubenlopez7348
@rubenlopez7348 6 месяцев назад
Great video!! Very helpfull!!
@jonathanoeijoeng
@jonathanoeijoeng 2 года назад
This is very nice and you explain it very detail and clear so I can modify it to be used in stacked bar
@ricardomotta5010
@ricardomotta5010 Год назад
That's exactly what I was looking for!😥👍
@muhammedozalp
@muhammedozalp 2 года назад
Thank you very much
@izachikun
@izachikun Год назад
Hi, thank u so much for this, it helps me do my project. U mentioned converting PHP to Javascript to be used for the charts' tooltips in the video, 9:48. May I know how can it be done? For example, maybe after fetching data from DB in Laravel's controller. That variables are in PHP to be used as chartJS' Javascript. You can also explain without the Laravel development. Thank you.
@ChartJS-tutorials
@ChartJS-tutorials Год назад
Hi Izachikun, thank you for your question. Have you seen this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-XCybE3hc52Y.html
@izachikun
@izachikun Год назад
@@ChartJS-tutorials Oh got it. Thanks!
@leonardotrote
@leonardotrote Год назад
Can it be used with scatter plots? I'm facing issues when trying to incorporate tooltips alongside other plugins. The current setup looks like this: plugins: [chartAreaBackground, quarterIndicator], How can I include tooltips in this configuration, given that they should be structured like this: plugins: { tooltip: { callbacks:{ ... } } }
@PreciousJewelsUKPrestwich
@PreciousJewelsUKPrestwich 2 года назад
Hi great videos and very clearly and informative, i have learnt a lot from them. Thank you. I have a chart with two datasets stacked bars and want to show in the tooltips both datasets with the correct color bars too, can you show me how to do that please?
@djmattc1978
@djmattc1978 Год назад
Great video. Sorry if I missed it but I would like to be able to change the label within the body. I hope that is the correct terminology - basically the text after the coloured square. If I return 'text' with "label: function (context)" I can fix the value, in this case it returns 'text'. But if I refer to context[0].dataIndex I get "Cannot read properties of undefined (reading 'dataIndex')". I don't understand what I am doing wrong here? Maybe it's not possible to do what I want?
@djmattc1978
@djmattc1978 Год назад
Just answered my own question, although I don't fully understand why. If I use context.dataIndex, it works.
@naglaakharroub3755
@naglaakharroub3755 2 года назад
very useful , thank you
@danarardiwinanto
@danarardiwinanto 2 года назад
THANKS A LOT
@rafiamunir5748
@rafiamunir5748 2 года назад
Hi! great tutorial. Can you help how to make it responsive on zooming in at 200%?
@RaulFrenetico1
@RaulFrenetico1 11 месяцев назад
hi! How do I make only the label value bold?
@kanchanapallyvenkatesh6801
@kanchanapallyvenkatesh6801 2 года назад
Hi, How can we change the Square Box to a circle in the tooltip?
@praveenaraman431
@praveenaraman431 Год назад
HI i need ur help ,tooltip --> label: data[i], i need the symbol in near data[i], for eg: car: $900, is it posible
@geost77
@geost77 2 года назад
How about styling text? Not just but add , and etc. Possible ? I need to add custom styled text, possible even small icon images and etc and I see no way to do that, just can add plain text and new lines if array ...
@ChartJS-tutorials
@ChartJS-tutorials 2 года назад
Hi George, thank you for your question. Chart.js Documentation has some basic styling options. These videos below would help you out with that: If you want to add icons watch this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-GRuj90oHOPU.html If you want to add image in tooltip watch this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qG5wdD3fTvI.html If you want to fully customize everything in tooltip watch this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-4oC31cjXQ_k.html
@ChartJS-tutorials
@ChartJS-tutorials 2 года назад
Hi George, thank you for your question. Chart.js Documentation has some basic styling options. These videos below would help you out with that: If you want to add icons watch this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-GRuj90oHOPU.html If you want to add image in tooltip watch this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qG5wdD3fTvI.html If you want to fully customize everything in tooltip watch this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-4oC31cjXQ_k.html Just remember we cannot add html code into tooltip as it is canvas code not HTML/CSS. If you want a HTML tooltip that is possible watch this: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-3W3NFKxGw5w.html
@romeoprofijt54
@romeoprofijt54 Год назад
Thx! Just what i needed! ...you sound dutch. Klopt dat? :)
@ChartJS-tutorials
@ChartJS-tutorials Год назад
Haha, heel scherp!
@victorelizondo7397
@victorelizondo7397 2 года назад
This one will be probably a silly question but, Is it posible to interprete a http link image inside the tooltip?
@ChartJS-tutorials
@ChartJS-tutorials 2 года назад
Hi Victor thank you for your question. Are you referring to something like this: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qG5wdD3fTvI.html Where the color box is converted into an image.
@nicolaskeroack7860
@nicolaskeroack7860 2 года назад
This was absolutely excellent thank you so much. My project is alive because of chart.js. But I need to do exactly this, but since I update the data in my chart I don't know if I can achieve it that way? Is there a way to update the chart, and get a new callback for this, and for example put new data from array[dataIndex] into labels[dataIndex]?
@nicolaskeroack7860
@nicolaskeroack7860 2 года назад
Found out this: options.plugins.tooltip on the doc. I think this will work out. Thanks again!
@NoNameNoOne14
@NoNameNoOne14 Год назад
is it possible to have different bar with different tooltip value like [bar red population 20, male 8, female 12], [bar blue population 24, male 14, female 10]? been stock with this problem for a couple of weeks now need help please thanks in advance!
@NoNameNoOne14
@NoNameNoOne14 Год назад
plus the value will be coming from the database
@ОлегЗагоруй-ъ8в
@ОлегЗагоруй-ъ8в 2 года назад
Большое спасибо! Очень помогли
@kyt8128
@kyt8128 2 года назад
Thanks 🙏
@nileshvyas1796
@nileshvyas1796 Год назад
How to use colorbox on title instead of label?
@ericmcknight912
@ericmcknight912 2 года назад
Hello! Back for more with your awesome tutorials. Could you explain how this might work with a scatter plot in chart.js? I tried adding an additional data point to each of the vertices (ie. {x: 1, y: 3, data: 100}) but was unable to get the context.raw.data pull to work in the tooltip. Any tips on this?
@ChartJS-tutorials
@ChartJS-tutorials 2 года назад
Hi Eric, thank you for your question. Based on your code you have it correct. I make a video as well where I do the same and it does show. Watch this video here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-80w6gWWDJM0.html I suspect perhaps you use callback instead of callbacks. Or any of your name spaces is missing something. Try to cross check with the video if anything would be different.
@shubhangiingle9872
@shubhangiingle9872 3 года назад
Hi, I have tooltip title as date ex. ' Oct 8, 2021, 11:00:00 am. ' and have x axis type mention as timeseries I want date on tooltip as ' Oct 8, 2021, 11 am' How to do that ? I have tried it using substring but get the problem after 10 am instead of 10 it is showing 1 and cuts out 0 and also have problem for putting am or pm at the end, Can you please help ?
@ChartJS-tutorials
@ChartJS-tutorials 3 года назад
Thank you for your question. I have created an answer video covering your specific question. You can find the video here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-GnRAbf9MMQI.html Using substring is not an option in your case as it would effect more items with the same character. However the solution is with Javascript Date and Time options. The video will make a complete breakdown which is shows you how to customize basically everything of your date.
@luisgoyone2882
@luisgoyone2882 2 года назад
What if I want to customize the color, alignment, font weight of the first value and the second value which are all in one line?
@ChartJS-tutorials
@ChartJS-tutorials 2 года назад
Hi Luis, thank you for your question. If you want to play with font colors that contain 2 colors in a single line you must use gradient in combination with math calculations. Watch this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Jy9j36rcQps.html Study the gradient section. For bold you might be able to do this as well but that might be differently. However, if you really want a custom style tooltip easier would be the build in HTML. Canvas styling just works different from CSS.
@luisgoyone2882
@luisgoyone2882 2 года назад
@@ChartJS-tutorials How about if I just want to justify between the elements in the tooltip body?
@ChartJS-tutorials
@ChartJS-tutorials 2 года назад
​ @Luis Goyone for justify it might be possible but it needs to be calculated in pixels how much space there is left. You need to consider canvas like a printer which calculates the x.y coordinates of each letter on a page. Meaning it does not read the CSS as a HTML page, once the text is there it does not recognize that the text is there. The video below would be better to understand the logic and behavior of canvas. *Custom Tooltip In Canvas* Perhaps it is better to watch this video. Here I build a tooltip from scratch for Chart.js in canvas. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-2kpeWH0lu0s.html If you understand that you can completely customize anything wihtin the canvas. *Custom Tooltip with HTML* If you truly need to use CSS go and build an HTML version which is here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-3W3NFKxGw5w.html
@patrickklinger4215
@patrickklinger4215 Год назад
hi, is the source code available for this example?
@ChartJS-tutorials
@ChartJS-tutorials Год назад
Hi Patrick, sorry this is an older video so I have no code available of this.
@maurodanielmezazamora1515
@maurodanielmezazamora1515 2 года назад
How to make my tooltips look different on each colored bar on the bar chart on Chart.js?
@ChartJS-tutorials
@ChartJS-tutorials 2 года назад
Hi Mauro thank you for your question. I have created an answer video here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Ic1bx82vWD0.html It will show you exactly how to do this.
@maurodanielmezazamora1515
@maurodanielmezazamora1515 2 года назад
Thank You, By the way, if I want to duplicate more than 3 text lines on the bottom of the footer of the Tooltips, how will I do that and is it possible to put the Tooltips code under the options: gradientBarConfiguration sentence?
@ChartJS-tutorials
@ChartJS-tutorials 2 года назад
@@maurodanielmezazamora1515 thank you for your question. I have created another video covering your specific question here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-TlR1Unq1h4c.html The video will show you how to create multiple lines in the tooltip footer. Next. I do not understand your reference regarding to the gradientbar settings. I guess you make your bars gradients. And you want make the tooltip look gradient as well?
@maurodanielmezazamora1515
@maurodanielmezazamora1515 2 года назад
No I just wanted the tooltips with multiple lines to be shown on the gradient bars, because when I added the tooltips footers sentence on the code of the gradient bars, they won't show it to me.
@goettidev6924
@goettidev6924 2 года назад
Could you please release the whole source code?
Далее
Наши дети захватили кухню!
00:59
Просмотров 307 тыс.
How to Filter Dates in a Chart in Chart js
41:35
Просмотров 14 тыс.
How to Customize the Tooltip Data in Chart JS
17:47
Просмотров 19 тыс.