Questions tagged [react-chartjs]

interactive react charting components using the chart.js framework

interactive react charting components using the chart.js framework

585 questions
-1
votes
1 answer

Returning an object from a function and passing the reference to a prop gives my TypeScript error. Doesn't happen if object is put straight in prop

I am doing this: const getDataForChart = () => { const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July']; const test = { labels, datasets: [ { label: 'Dataset 1', …
Onyx
  • 5,186
  • 8
  • 39
  • 86
-1
votes
1 answer

Range grouping data and label in Chartjs

So, I would like to range my data and labels in Chartjs so that I can represent them properly. Please take a look at this reference which exactly shows what I am trying to do. You can see that the data is grouped and ranged according to the order…
Adictonator
  • 138
  • 11
-1
votes
1 answer

ChartJS react-chart-js2 Options not working

I am using "chart.js": "^3.3.2", and "react-chartjs-2": "^3.0.3". I am trying to modify the axes mainly but it seems to not work at all like nothing works in the options components. I have seen the old version had that issue but this one is over V2.…
-1
votes
1 answer

showing values or percentages with chartjs in react

I'm creating a pie chart in a react project with chartjs. But I'm not able to show any values on the different segments. I've tried different plugins but all of them aren't supported anymore. I'm open to any ideas. That's how I'm rendering the chart…
Piepo
  • 1
  • 5
-1
votes
1 answer

How can i do this chart in react?

I need to do this chart in reactjs. You can see its have a background, and lines are gradient. Can i do this in react-chartjs and how?
-1
votes
1 answer

How to access custom property in dataset object in Bar Chart in React ChartJS 2?

I would like to know the "userId" custom property when I click on the element. If I add a custom property to the dataset object, the custom property added doesn't show in the element retrieved in getElementAtEvent.
Arthur Menezes
  • 241
  • 5
  • 16
-1
votes
1 answer

How to create a charjs bar graph with many bars?

I want to get the effect of something like this: And here is my best attempt as a combo graph: The problem is I need to vastly ramp up the number of bars in this chart. However, when I try to do this the bars disappear. Here is my code as a…
kmm3
  • 391
  • 3
  • 14
-1
votes
1 answer

Tried to register two views with the same name

I am not sure why it's returning this error. It might have to do something with one of the dependencies being incompatible with another. I also have installed a react-native-webview dependency along with canvas. I wonder if that's causing the…
anushka
  • 123
  • 9
-1
votes
1 answer

How to make a child component of a sibling component refresh when a button is pressed in ReactJS?

So I have searched for solutions but I cant seem to find one that fits with what I am doing. Here is the structure of my website: https://ibb.co/Xz27rgK So as you can see I have my "NavBar" component outside of the Router because I always want it…
DevinGP
  • 199
  • 2
  • 2
  • 10
-1
votes
1 answer

Invariant Violation in Reactjs

I'm working on graphs in react and I have encountered with the following error. Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely…
-1
votes
1 answer

Unable to produce desired UI output for Chartjs tooltips

I have the following scenario: x-axes: String date y-axes: Integers 2 data sets When i hover over a particular data point, i want to display the following: Data collected as of 2020-06-02 33,600 33,000 Diff: 600 Here is what i get instead: Data…
AKJ
  • 749
  • 6
  • 29
-3
votes
1 answer

Error rendering graphics in react with data coming from api rest

I am trying to render a graph with data from an api rest, but it is not showing the values. I've tried to check the chartjs documentation and I can't find the error. can anybody help me? I'm using react, chart and axios. import React, { useState }…
1 2 3
38
39