Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
565 views

How to Make a Chart.js Chart Responsive with Fixed Aspect Ratio in React?

I'm working on a React project where I need to display a Chart.js chart inside a parent component which is in grid layout. The chart should resize according to its parent container while maintaining a ...
Codder's user avatar
  • 1
0 votes
1 answer
39 views

Unable to change pointBackgroundColor after initial configuration is done using Chart.js

I am using Chart.js version 4.3.x. I am having issues creating different color points on a line graph. All the entries I see on StackOverflow are older versions. It's still listed in the API I have ...
David Wolfe's user avatar
1 vote
1 answer
44 views

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 ...
Toniq's user avatar
  • 4,976
0 votes
0 answers
24 views

How can we set line chart without stacked in it out of 5 stacked lines in Line Chart using QuickChart

I need to show a Line Chart with multiple line data in it. One of the line in Line Chart should not be stacked and remaining lines should be stacked. I could able to achieve it if I set y1 axis(...
Ramesh Bathini's user avatar
0 votes
1 answer
122 views

React Chart Js 2 , x axes value not my value

i try formatting my x axis value in chart js myData const chartData = { labels: data.map(item => item.toString()), datasets: [ { label: '', ...
Talha Aksoy's user avatar
0 votes
0 answers
30 views

In some browser appears in other browser not

In some browser canvas are not visible. Appear for one seconds and then disappear. Im going mad. What´s wrong? If i disable the second one the first one is visible. There is a solution about it? I ...
Mirko Genovese's user avatar
0 votes
0 answers
73 views

Dynamically resize chart.js charts when adding new charts to fixed size container

function addChart(key, colors) { const chartData = getChartData(currentYear.value, key); const chart = { chart: null, data: chartData, colors: colors, key: key }; charts....
dreanor's user avatar
  • 75
0 votes
1 answer
39 views

Stack js some padding between outside border

I would like to add some padding to the border on the outside of my chart, see attached image of expected outcome. as you can see i have a border width of 1, but its sitting on the chart, i would ...
Beep's user avatar
  • 2,803
1 vote
1 answer
145 views

Chart.js - X-axis not displaying dates with timestamps in format "YYYY-MM-DDTHH:mm:ss.SSSSSS" (React chartjs-2)

I'm trying to create a line chart in React using chartjs-2 to visualize timestamps and their corresponding power measurements. My timestamps are in the format "YYYY-MM-DDTHH:mm:ss.SSSSSS" (...
Shivank Anchal's user avatar
0 votes
1 answer
29 views

Animation is stuttery on mobile phones [Solved]

I made a spinning wheel using chart.js pie chart and it works flawlessly on pc - basically am drawing a pie chart with datalabels for each option, and then spinning the chart accordingly. The problem ...
Aaditya Thakkar's user avatar
0 votes
0 answers
37 views

Can chartjs draw this kind of line chart with intervals?

Can chartjs draw this kind of line chart with intervals like this? This is my option: const options11 = { responsive: true, maintainAspectRatio: true, aspectRatio: 2, scales: { ...
Ranger Lone's user avatar
0 votes
1 answer
70 views

Cutout percentage in data chart

How would I add cutout percentage to my data chart in chart js, the aim id to make the chart thiner. const data = { labels: ['onek', 'teo', 'Three'], datasets: [{ data: [1, 3, 9], ...
Beep's user avatar
  • 2,803
1 vote
1 answer
127 views

How can i change the format of my candlestick chart in chart.js?

I am using vite and react to build a node.js program where I am collecting data from coinbase exchange API to rebuild a dashboard. This is my code, where the API returns: an array of arrays of the ...
Francis Yip's user avatar
0 votes
0 answers
27 views

Data lables not working proper in node + ts

I have used chart js to generate chart image in node + ts and generate bar chart for that bar chart i want data labels at the end of the chart but that is not working properly i have used below config ...
Keval Dholakiya's user avatar
0 votes
1 answer
43 views

Setting the Size of a Canvas width and height issue

I'm trying to set the size of a canvas for a chart made with Chart.js. It isn't resizing. let ctx= document.createElement("canvas") ctx.width = 200 ctx.height = 100 document.body.appendChild(ctx) ...
user24826080's user avatar
1 vote
0 answers
105 views

I need to change my label style onClick Vue-chartjs

I am using Chart.js to create a Doughnut chart with Vue.js, and I want to customize the legend items when they are clicked. Specifically, I want to change the color and add a line-through style to the ...
pedro maximo's user avatar
1 vote
1 answer
94 views

How can i make that all the chart in a radar chart.js show me in hover a list of the data?

I'm trying to make a chart where the data shows up when I put the mouse in all the area generated and not only in the nodes. The idea is that the hover shows the entire data together. This is what I ...
CMB's user avatar
  • 11
2 votes
0 answers
48 views

Is there a way I can determine start position of an animation in chart.js using a websocket datasource?

I have implemented an area chart in my angular application using chart.js (ng2-charts). Data is populated on the chart using a WebSocket. However, when animating the inserted data point, the curve ...
Edward's user avatar
  • 31
0 votes
0 answers
21 views

Chart js. How to customize font styling for elements in the "Labels" array?

I am making a Gantt style chart that contains two labels in the Y axis, however I am hoping to find a way to make the "title" label be in bold, while the "description" is not. I've ...
Sherbet Head's user avatar
0 votes
1 answer
30 views

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 ...
gallium314's user avatar
0 votes
3 answers
45 views

chartjs changing time display using select value

I try to adapt a simple chartjs code in order to modify time display according to values from a select field into my html page. The fact is I don't understand why the values selected is not linked to ...
wanwan's user avatar
  • 95
1 vote
1 answer
63 views

Strikethrough on label text not working when using generateLabel

The default functionality of label item text having a strikethrough applied when clicking on it from within the legend is not working. I would like to fix this issue so the strikethrough is applied (...
James Murphy's user avatar
0 votes
0 answers
110 views

Resizing all charts dynamically in fixed size container in chart.js

I'm using chart.js (or more specifically vue-chartjs) for a component I want to use on a dashboard page. The user is supposed to be able to add new charts to the component using the dashboard. Since ...
dreanor's user avatar
  • 75
1 vote
1 answer
184 views

Why isn't the 'labelColor' callback for the Chart.js Tooltip applying any changes?

I'm using vue-chartjs to display a line chart, and right now I'm customizing the appearance. I'm finding that certain attributes to style the Tooltip are not working. I'm currently trying the ...
Andrew's user avatar
  • 23
4 votes
1 answer
134 views

how use data from txt file to build graph with chart.js

I try to find a way to use data from txt file into chart.js graphic. I'm not very friendly with JS so I ask some help... So, what I succeed was to build a beautifull simple graph using this code : ...
wanwan's user avatar
  • 95
0 votes
0 answers
164 views

Chartjs afterDraw not showing the line

I am trying to make a chartjs bar chart using dates. Those are the options i am using to set my chart as i want but i want to add a line at the current date. Here's how i approached it: public ...
ilias pr0's user avatar
1 vote
1 answer
64 views

ChartJS : Fill within a curve dataset above a max, in between max/min, and below min limit with different color

Rails 5, ChartKick 5.0.5 => ChartJS 4.4.1 I have a curved line chart in ChartJS that plots about 0 on the Y axis with separate maximum threshold for positive values and minimum for negative values (...
Brian Becker's user avatar
2 votes
1 answer
405 views

Charts in Primefaces 14.0.0 cause error in jQuery

I updated from Primefaces 13 to Primefaces 14.0.0. The Chart feature has been upgraded to use chart.js and i updated my code accordingly. Since it did not work out of the box, i copied the example ...
holsteto's user avatar
  • 462
0 votes
1 answer
108 views

Uncaught TypeError: item is undefined chart.js

Im trying to make a page using vue and chart.js: <script setup> import { ref, onMounted } from 'vue'; import VueSlider from 'vue-slider-component'; import 'vue-slider-component/theme/default....
dreanor's user avatar
  • 75
0 votes
0 answers
112 views

Updating chart data realtime from separate component

I'm pretty new to vue-chartjs and chartjs in general but I have a nuxt app (with electron) which is supposed to render the graph data live. Right now I just have sample data with an event listener ...
Zach L's user avatar
  • 1
0 votes
1 answer
85 views

Use a 2d array of datasets with Chart.js

I've changed the subject of my data for clarity and privacy, but my actual problem is identical. I have data in the format of CSVs organized by region, all of the following format: canada.csv: year ...
gallium314's user avatar
0 votes
0 answers
86 views

Cannot get live plot to re-render React Native UPlot/ChartJS

I am coding an android app with React Native that basically is a live high frequency pressure sensor grapher with which I'm hoping to graph data every 10-20ms. I have already achieved close to what I ...
blahblah's user avatar
3 votes
2 answers
107 views

How to draw percentage on bar graph by javascript

I have this very useful chart, but my problem is that the client wants to display percentage label. I have attached image below of what I want: <html> <script src="https://cdnjs....
jhunlio's user avatar
  • 2,640
0 votes
1 answer
136 views

"cannot find name Chart" when trying to use chart.js

I have a really annoying problem with chart js which I am stuck for some days now, I've tried literally everything but couldn't figure out yet. The problem is, I'm using a simple TypeScript ...
Marcos Carvalho's user avatar
0 votes
0 answers
124 views

Treeshaking is not there for chart.js npm

I'm using chart.js in my react-app but when I installed this package, I saw it has a single javascript bundle in the node_modules folder. When I used it in my app and bundled it using webpack, again ...
shub810's user avatar
0 votes
1 answer
213 views

Chart.js to show status changes over time in stacked bar

I have a number of records in a database which have their status changes audited. I'm pulling this data out to display in a Chart.js horizontal bar chart to visualise the duration that each record is ...
bowfinger's user avatar
2 votes
1 answer
95 views

How do I make the line start at the middle instead of the beginning of the column?

I'm creating a line chart using chartjs (v3) (and react-chartjs to integrate) and I'm having some bad times to customize the line to start at the middle of the first column (and also finishes at the ...
PedroB's user avatar
  • 67
0 votes
1 answer
107 views

The 'cutout' in chart options not possible with 'plugins'

My chart object is defined like this: this.chart = new Chart("myChart", { type: 'doughnut', data: { datasets: [ { label: labeldata, ...
Anonymous's user avatar
0 votes
0 answers
183 views

ChartJS and Vue-ChartJS: Scales in chart options do not work

I just started using ChartJS and VueChartJS and begin with a simple bar chart. The problem is that the scales in chartOptions do not affect the UI.I used ChartJS 4.4.2 and VueChartJS 5.3.1. Here's my ...
Lucia's user avatar
  • 69
0 votes
1 answer
56 views

Customize x-axis label

Using Chartjs, I have the following databaset and options # dataset public lineChartData: ChartConfiguration["data"]["datasets"] = [ { label: "Attempts", ...
Anuj TBE's user avatar
  • 9,712
0 votes
0 answers
47 views

Display Data values on top of bar chart using angularJs

I am trying to dispay a barchart using chartjs and angularjs by getting data from database i am succesful in doing it but when i hover on the bar then the values are displayed i want the values to be ...
faraz's user avatar
  • 57
0 votes
0 answers
43 views

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 ...
Daniel .Comerford's user avatar
2 votes
0 answers
117 views

Is it possible to export a Chart.js graph with animation?

I was wondering if there's a way to export my Chart.js animation. I created a statistics website and added a "delay" animation to the bar graph. You can see an example here: https://...
Noah Depireux's user avatar
0 votes
0 answers
98 views

Pie Chart labels overlapping and getting clipped in react chart js 2

In the following code, the pie chart's labels are overlapping and clipping at the top. How can I prevent this? For the following code, the labels that are used not only overlap but clip as well. How ...
Rollie's user avatar
  • 1
0 votes
0 answers
261 views

How to use chartjs plugins in laravel filament V3 widgets?

I am trying to use the chartjs plugin chartjs-plugin-datalabels in my doughnut chart widget. I have done the steps mentioned in the this filament documentation I am using as in the below code for the ...
Angom's user avatar
  • 743
1 vote
1 answer
127 views

How to add margin top for legend in Chartjs (PrimeNG)

My legend is at the bottom of the chart but the space between the chart and the legend is too small, How can i add margin or padding for the legend, chart ? Here is my pie chart options, i have added ...
tuongduy's user avatar
0 votes
0 answers
29 views

Dynamically size chart to fit within window

I'm using Chart.js to display charts. It's working well. I've decided to add a full-screen feature, which opens up the chart in a full-screen modal popup. I have this working, but the chart takes the ...
Jonathan Wood's user avatar
1 vote
0 answers
49 views

How to Show Only Highlighted Stack Value in Tooltip for Stacked Column Chart in FusionCharts

I am using FusionCharts in JavaScript to create a stacked column chart. When I hover over any stack in the chart, the tooltip displays the highlighted value of the stack along with the non-highlighted ...
Prajwal Dhoble's user avatar
0 votes
1 answer
43 views

Chart.js: how to hide some text of label?

Chart.js v2.9.4 I've got some things in data -> datasets -> label but I want hide text of only one of labels at the upside. I need something like this: Hide labels from pie chart in chartjs - ...
djlj's user avatar
  • 57
0 votes
0 answers
86 views

Is there a way to use the chartjs-plugin-annotation in the chartjs R library

I am attempting to plot some charts in chart.js using this package in R for a shiny app. This is possible in chart JS using plugins: https://www.chartjs.org/chartjs-plugin-annotation/latest/samples/...
JoeK's user avatar
  • 41