Relative Content

Tag Archive for javascriptchart.js

How do i insert a value into a chart?

So i have this code that makes a bar chart that would shows a teaching points an university has. But, when i try to choose a university, the value of teaching1, 2 and 3 would just sit empty. Heres the HTML:

Chart JS update transition – zoomed in blurry chart

I’m doing what I think is a pretty standard destroy() and recreation of a chart using Chart.js. The chart updates as expected but I see a strange zoomed-in, blurry chart during the transition. I can’t seem to get rid of it. Any ideas?

Chart js beforeTitle in tooltip

I am trying to display custom text before title in tooltip. This should work according to documentation: https://www.chartjs.org/docs/latest/configuration/tooltip.html#label-callback
But it only show number.

Using point styling with dense line charts

My chart has lines which are quite close together, but still need to be differentiated in the legend. There are a few hundred datapoints for this line charts, so when I use pointstyle to differentiate them I get the following result:

Dashboard:57 Uncaught SyntaxError: Unexpected end of input with Charts.Js

I’m trying to create a chart that has both a bar dataset and a line dataset. When I load the page, the model populates correctly as far as I can see, but the chart doesn’t show up and the only errors or clues I have are Dashboard:57 Uncaught SyntaxError: Unexpected end of input and in the debug output: Exception thrown: ‘System.FormatException’ in System.Private.CoreLib.dll . I’m not sure the second error is related but thought it might help. My code for the chart is as follows:

Chart doesn’t resize when moved to a differently sized container in Chart.js 4.4.2

I have two charts next to each other, the left one is big and the right one is small, each in their own container. When the small chart is clicked I want the charts to switch places so that the small chart is moved to the big container on the left and the big chart is moved to the small container on the right and the charts should adjust to the sizes of their new containers. This worked in Chart.js v2.9.4 but after I upgraded to v4.4.2 the charts remain in their original sizes after moving containers.