All Questions
350
questions
1
vote
0
answers
46
views
Line chart displays incomplete data when adding multiple datasets
I have an issue with my chart. When I only update the temperature, the graph will be okay. But when I add the humidity, the chart is only filling up halfway:
// Declare chart variables
let ...
2
votes
1
answer
90
views
Chartjs multiple bar using dynamic and variable JSON
I'm trying to create a bar graph based on json data that vary dynamically according to the filter.
I want the graph to show the TYPE related to the PERIOD, when it exists. If it doesn't don't show ...
0
votes
0
answers
60
views
Get PHP variable without include() - Chart.js
I am building a client portal and I am using Chart.js to make a basic Gantt Chart. I have everything working except for the SQL code to get the data before parsing it with JSON. If I hard-code:
"....
0
votes
0
answers
44
views
Bar chart not showing data using Chart.js with CSV to JSON conversion
Hello Stack Overflow community,
I'm facing an issue with generating a bar chart using Chart.js after converting CSV data to JSON. Despite successfully loading and converting the CSV data, the bar ...
0
votes
0
answers
57
views
ChartJS Linegraph not drawing lines
I am attempting to create a linegraph using chartjs, but the lines do not show. I am not sure why they do not show. I have tried googling this issue with no results, and would appreciate any help. ...
0
votes
0
answers
649
views
Having a time-based line-chart sorted by time (x-axis) in ChartJS
Context:
I want to display a scoreboard for a game on a web page with ChartJS as a line-chart which would show the score progression (Y axis) along the time (X axis). Each line representing a team, ...
0
votes
0
answers
43
views
Using Mongodb Aggregation or My Own Function for the Showing of Data in Chart.js?
I'm new in this development world, I'm working with next.js.
The question I have is that I have the following information in mongodb, and I need to change it(group, add, sort) to be able to show it in ...
0
votes
0
answers
263
views
How can I use Chart.JS for minute-by-minute data?
I am trying to use Chart.JS to visualize temperature and humidity patterns throughout the day for an automated garden. For each day I have a JSON file which has a temperature and humidity reading ...
2
votes
0
answers
105
views
Combining bubble chart data with line chart data from 2 API urls in ChartJS
I'm trying to combine both datasets together in a line & bubble chart. The issue is that the dates from the bubble chart are badly misplaced to random dates rather than the ones required, although ...
0
votes
1
answer
364
views
How to calculate the sum of all values per month of a JSON file in React and display it as a single month using ChartJs?
First of all I would like to apologize in case I didn't elaborate my question in the best way, as a junior developer there are times when I find it hard to ask the right question, I guess we all have ...
0
votes
1
answer
193
views
How to analyze/count an array of objects in Javascript
Stack Overflow! This is my very first.
So, say for example I have the following array:
[
{
"question1": "Apple",
"question2": 5,
"...
1
vote
1
answer
90
views
Parse JSON object to ChartJS using object.keys/object.values
I'm trying to show data from a JSON file to ChartJS, however, my JSON structure is different to what I have seen in previous relatable questions. Check JSON below:
{
"AAPL": [
{
...
1
vote
1
answer
72
views
chart.js PHP to JS string conversion question [duplicate]
I am querying wordpress ACF fieldsdata which needs to plot into a chart.js radar type chart.
<?php
// Query posts
$args = array(
'post_type' => 'resultaten',
'tax_query' => array(
...
0
votes
1
answer
67
views
Display JSON file on ChartJS
I am trying to display JSON data on a doughnut chart using chartJS. My issue is that it will only display one piece of data from the JSON. How do I get all pieces of data to display? Code is below:
...
0
votes
0
answers
29
views
image on bar chart not always show
I want to make image float above bar chart but when I acheived it it's not always show,It display only when mouseover on the bar and error 404 keeps appear on log
<script src="https://cdn....
0
votes
1
answer
69
views
Javascript not pushing data to the dataArray
Im not a javascript guy but I had some help getting my chart working with chart js here, but since then I had to change the data structure from just 2 tables to 3 (with oneToMany - manyToOne). I feel ...
0
votes
2
answers
113
views
How to format and validate JSON in anonymous type using C# properly?
I working on a chart using Chart.js and Blazor wasm. Therefor I need a JSON configuration object as an anonymous type. Like this:
var config = new
{
Type = "line",
...
0
votes
0
answers
44
views
adding datasets data as one sum json
I am new to charts.js, and am creating a doughnut chart that shows the percentages of members according to their seniority. All works well, except I want to total the number of members in the center ...
1
vote
1
answer
513
views
JSON QuickChart.io Change the Chart Size
I am creating a QuickChart.io using Chart.JS within a PowerApps canvas and am having some issues with formatting. Everything works on the visualization (filtering, rendering, etc.) but I am trying to ...
0
votes
0
answers
102
views
Uploading JSON data to line Chart.JS using local host server
Below is my JS code for uploading the data:
var xmlhttp = new XMLHttpRequest();
var url = "http://localhost:3000/AUDcotdata";
xmlhttp.open("GET", url, true);
xmlhttp.send();
...
-1
votes
1
answer
88
views
Upload JSON data to chartJS from JSON server
I'm trying to import data from a localhost JSON server to chartJS but nothing shows up. Below is my JS code:
jQuery.getJSON("http://localhost:3000/AUDcotdata", function(data) {
var ...
0
votes
1
answer
581
views
Json file data to Chart.JS
I'm trying to add multiple datasets from a json file to a linechart in chart.JS. Here's my JS code:
const toCharts = () => {
const jsonfiledata = {
jsonfileshort: {
"0&...
-2
votes
1
answer
107
views
Chart.js Convert JSON to PHP array
I am creating a Time Cartesian Chart from Chart.js, I need to get the data as json format, however I need to first generate a php array and use json_encode() in order to get the following json. Does ...
1
vote
1
answer
156
views
Chart.js does not scale with two yAxis
I struggle to let my second y-Axis scale to my second data array.
The green data should be scaled according to the right y-Axis (not working).
The red data is correctly scaled to the left y-Axis.
<...
1
vote
1
answer
99
views
Extract arrays from JSON
I'm trying to extract some data from JSON response (from REST API to angular) into arrays to use in Chartjs.
The JSON is in this format
[
{
"A": a,
"B": b,
...
0
votes
2
answers
1k
views
How to get json response form http get request
I'm getting a data from API and converting it to json string as follows -
[HttpGet]
public async Task<JProperty[]> GetSomeDataAsync()
{
try
{
HttpClient ...
1
vote
1
answer
93
views
charts.js displays only first x and y value from a json api response
I am trying to render a chart with charts.js with a json api but the rendered chart displays only the first x and y values from the json
the json is fetched using xmlhttp
var url = "https://...
0
votes
1
answer
132
views
Why can I not push data into labels?
I am using Vue2 and ChartJs.
I have a set of array which look like this:
I have no issues pushing lossEmptyUnits to my dataset, but I also need to push the date to my labels so that I can try to sort ...
0
votes
1
answer
108
views
how to input values at chartjs labels?
i want to make it horizental at my value- lab(ex : 1, 2, 3, 4, 5, 6, 7...) and
why print array vertical in chartjs?
why don't print my value my value - op3? (360.4,360.4,360.4,360.4,360.4,360.4)
my ...
1
vote
1
answer
1k
views
2 layer doughnut chart using Chart.js
I am trying to create a pie chart that displays an array of countries at the first level and the cities for each country at the second level.
I have a JSON file (below) with data that I modified in ...
0
votes
1
answer
246
views
How to separate a single json array into x and y values?
I am utilizing Json.SerializeObject(variable) to obtain an array that I am graphing using Chart.js.
In order to get the array, I am creating a list and adding the key and its corresponding value to ...
2
votes
1
answer
280
views
How to put function in ChartJS data structures?
I'm making a website with one graph that use ChartJS library. This chart display, on the website, all of the data available as default.
My goal is to let the visitors to choose a different number of ...
0
votes
2
answers
77
views
Adding an additional datasets to chartJS
I got this chart to create
I've successfully created the 2019 part with 5 points of colorful data inside. What I have so far:
I'm trying to add 2020 and 2021 data. Here's my code:
const DATA_COUNT = ...
1
vote
1
answer
148
views
How to set a time scale to a ChartJS chart from JSON?
I'm trying to code a Gantt chart using chartJS and I can't find how to do it by getting dates from json in Ajax function. Here is the code I use :
$.ajax({
url: "query.php",
method: "...
1
vote
1
answer
5k
views
How can I format the x-axis using a timestamp via chart.js?
I am wanting to display the temperature readings from a database on a graph.
However, at the moment the x-axis is displaying incorrect values that do not correspond with my test dataset.
The x-axis is ...
3
votes
1
answer
5k
views
Chart js data decimation not working, parsing issue
I am trying to plot a graph using chart JS that has around 300,000 data points. It runs pretty slowly so I'm trying to improve its performance by using the data decimation plugin. However, the data ...
2
votes
2
answers
3k
views
How to use JSON response from FastAPI backend to create a chart using Chart.js in the frontend?
I have an HTML page being rendered with FastAPI:
@app.get("/index", response_class=HTMLResponse)
def write_home(request: Request):
return templates.TemplateResponse("index.html",...
1
vote
1
answer
491
views
ChartJS shows chart but no data in ASP net core
Im trying to display some data comming from API request into a Chart JS bar chart.
Model:
public class MachineApiModel
{
public string id { get; set; }
public Production[] productions { get; ...
1
vote
1
answer
681
views
How to plot chart from external JSON and format X-AXIS to show time using Chart.JS?
I am using Chart.JS to plot some data from external JSON. But I am unable to format the X-AXIS in a proper way.
My html & javascripts codes are here:
$(document).ready(function(){
$.ajax({
...
0
votes
0
answers
64
views
ChartJS difficulty with X Axis and pulling appropriate data
I'm having some difficulties with iterating over some json data and displaying the proper X axis (Date/Time) I've tried several times to loop through the json data to extract the time for each worker ...
0
votes
0
answers
3k
views
Uncaught TypeError: Cannot read properties of undefined (reading 'datasets')and(reading 'initialize')
Update: I was able to solve the error after using method provided by Mr Ivar in the comment(In config object, change ThisMonthData to data: ThisMonthData).Thank you Ivar.
I am putting JSON data into ...
0
votes
2
answers
182
views
How can i loop some specific key in each index json data and put it in dataset: data ? (chart.js)
I just want to build line chart stock price, and manage json data and put it for build chart.
If i have some json data.
[
{
"close": 116.59,
"high": 117.49,
"...
0
votes
2
answers
2k
views
How to fetch data from Json file on charts(bar-chart/pie chart etc) in angular?
Now what I'm doing is getting data straight from the ts file as shown below using ng-2 chart and chart.js:
`
import { Component } from '@angular/core';
import { ChartOptions, ChartType, ChartDataSets }...
1
vote
2
answers
396
views
Dynamically pass the JSON data in chartjs
I have also created this in codesandbox: https://codesandbox.io/s/bar-graph-9nr8u?file=/src/App.js:2394-3036
I have these JSON data And I have this Pie graph with labels such as car, bikes, motor, ...
1
vote
1
answer
236
views
Updating chart.js with JSON from Razor page
I have a chart.js in my Razor page displaying some data, but when I try to add an aditional dataset to the chart with an AJAX call i get an error message:
Uncaught TypeError: Cannot create property '...
-1
votes
1
answer
132
views
No chart display for Chart.js and JSON data
I'm trying to create chart using Chart.Js with JSON data. Since I'm new to this I have problem displaying the chart and I'm not sure what when wrong. Please help me out. Thank you!
department.php
<...
1
vote
1
answer
515
views
How to get data of json file for chart.js diagram
I want to read a .json file and use its data for the data attribute of a chart.js diagram.
My code is as follows:
const test = []
fetch("./load.json")
.then(response => {
return ...
-1
votes
2
answers
85
views
Convert a JSON file to an array in javascript to visualize the data in ChartsJS [closed]
I have a JSON file with a lot of temperatur data meassured every quarter hour and saved into a object in the file.
{"Temp_12:0": "26",
"Temp_12:15": "20",
"...
0
votes
1
answer
121
views
Create Chart using $getJSON and ChartJS
I need to create a chart using ChartJS and a JSON file. The format is give below and I wish to push the data into an array, where the x-Axis has the Station labeled, and the y-Axis shows the Arrivals. ...
0
votes
1
answer
900
views
How do I make a pie chart showing number of people in an age group with JSON and ChartJS?
I've been trying to tweak the code from my previous question where I pulled data from the database in the controller using JSON handler.
Now, I'm trying to create a pie chart showing the different age ...