score:0
the data array is expecting an array with values so if you remove your join it should work.
you would get this:
var diadata = []
function getdata() {
diadata[0] = document.getelementbyid('carat').value;
diadata[1] = document.getelementbyid("cut").value;
diadata[2] = document.getelementbyid("color").value;
diadata[3] = document.getelementbyid("clarity").value;
diadata[4] = document.getelementbyid("depth").value;
diadata[5] = document.getelementbyid("table").value;
diadata[6] = document.getelementbyid("x").value;
diadata[7] = document.getelementbyid("y").value;
diadata[8] = document.getelementbyid("z").value;
}
getdata();
var ctxl = document.getelementbyid("barcharthorizontal").getcontext('2d');
var mylinechart = new chart(ctxl, {
type: 'horizontalbar',
data: {
labels: ["carat", "cut", "color", "clarity", "depth", "table", "x", "y", "z"],
datasets: [
{
label: "price",
data: diadata, //i want to add my input data here
backgroundcolor: 'orange',
borderwidth: 0,
}
]
},
Source: stackoverflow.com
Related Query
- how do i use the numbers i key in from a form as the input data for chartjs
- how can i send a list of numbers from views.py to a chartjs file im using for the front?
- How to use 'time' (data from database, data type: timestamp ) for plotting graph in Chart JS
- How do I customize y-axis labels and randomly pick the value from the data range for x-axis in Chart js
- chartjs how to update dynamically data from database(Chartjs cant get the data)
- Using number/text input field to set the data values in ChartJs stops the chart from being displayed
- ChartJs 2 How to remove numbers from the doughnut chart on loading
- How to sum the array value in javascript like chartjs data array and input value sum
- How to start the chart from specific time and offest hour and then show the data on chart from target datetime in chartjs
- I need a PHP query to grab data from the database and use in my bar charts for results
- How do I use the return values from csv ajax request for x and y values?
- How to use computed property with data from JSON in data object for time axis in Vue using Chart.js
- Chartjs - How to update the data from values in my database?
- React - how to get array from store before first render and use it as dataset for ChartJS
- How to use data from database for chart.js (bubble chart) with Ajax/JSON method?
- How to use a string returned from php by ajax as data for a chart.js chart?
- Chartjs random colors for each part of pie chart with data dynamically from database
- How to properly use the chartjs datalabels plugin
- how to change Y axis value dynamically based on user input in Chartjs for Line chart?
- Grouping the object by key for Chartjs bar chart
- How to change the Y-axis values from numbers to strings in Chart.js?
- Chart.js – how to remove data entries from the tooltip?
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- How to create chartjs chart with data from database C#
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- How to add labels for only some of the data point?
- How can I load multiple Chartjs charts with different data on the same page?
- How to use async data for use with chart.js in ionic
- How to use set the color for each bar in a bar chart using chartjs?
- How can I prevent the hover data from displaying in Chart.JS?
More Query from same tag
- chart.js mixed chart types
- Chart js - Customize chart
- set color from datasource like you would set argumentField or valueField?
- Django admin/ Chart js error - super() takes at least 1 argument (0 given)
- How to write a query to get the number of times a choice is selected by users
- When I added a funnel chart to chartjs all the charts are load compressed until resize page
- Issues getting JSON string for chart.js data
- Chartjs is disappearing in Ionic tabs when keyboard dismiss
- Tiny error in the ChartJs book
- The bar that contains a low value is almost invisible on the chartjs
- Chart JS Zoom Pan
- Dataset._meta[0].dataset is null in ChartJS
- JavaScript Error - Uncaught SyntaxError: Unexpected token {
- Chart.js : straight lines instead of curves
- Chart.js 3.3.0 - Draw text on top of chart
- Hide Chart.js bubble points based on filtering
- Display values in Pareto chart using Chart.js 2.0.2
- How to assign an array to data of charts.js's counts
- ChartJS: Draw line between two data points on hover
- How can I draw lines inside the bars in charts.js?
- Chart.js not initiating
- Growing chart value - chart.js
- Make pie chart smaller Chart JS
- Different color for each column in angular-chartjs bar chart
- chart.js 2.0 current mouse coordinates tooltip
- Destroying Chart js within useEffect - React
- Ajax won't retrieve the data from my script
- Chart.JS TypeError: this.scale is undefined
- Show and plot zero values on ChartJS line graph when no data
- I am getting TS2339: Property 'chart' does not exist on type 'Window'?