score:1
Accepted answer
did you try the below? refer to chartjs documentation
const chartdata = [10, 10, 10, 10, 10, 10, 18, 30, 45, 40, 33, 22, 10, 10, 10, 10, 10, 20, 33, 45, 42, 55, 30];
const dataline = {
labels: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'],
datasets: [
{
label: 'kwh',
fill: false,
linetension: 0.1,
backgroundcolor: 'rgba(75,192,192,0.4)',
bordercolor: 'rgba(75,192,192,1)',
bordercapstyle: 'butt',
borderdash: [],
borderdashoffset: 0.0,
borderjoinstyle: 'miter',
pointbordercolor: 'rgba(75,192,192,1)',
pointbackgroundcolor: '#fff',
pointborderwidth: 1,
pointhoverradius: 5,
pointhoverbackgroundcolor: 'rgba(75,192,192,1)',
pointhoverbordercolor: 'rgba(220,220,220,1)',
pointhoverborderwidth: 2,
pointradius: 1,
pointhitradius: 10,
data: chartdata
}
]
};
Source: stackoverflow.com
Related Query
- Calling data from outside of Chartjs code
- Chartjs random colors for each part of pie chart with data dynamically from database
- React ChartJS prevent new data from being added into state after it's redrawn?
- Filter ChartJS using data from PHP
- 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?
- Calling data from search bar to chart.js graph in Angular
- I can't add data to chartjs from codeigniter
- Chartjs not working with d3 from csv source
- Calling external Chartjs chart from a javascript file into HTML in Flask
- chartjs xaxis ticks with round values from shifted input data
- Passing JSON data from PHP array into ChartJS
- How to get Data from API to display chart using chartjs in Vuejs
- Passing Data from Controller to ChartJS
- ChartJs - displaying data dynamically from back-end
- Passing data from a controller to ChartJS - Laravel
- ChartJS get data from Controller
- ChartJS have xAxes labels match data source
- Why is my data on chartjs not starting from the data that it should
- Displaying data from simple html form to display in chartjs
- 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
- To display data from mock server into chartjs using ember
- ionic display chartjs data from json http request
- Svelte , pass data to chartjs from API
- How to start the chart from specific time and offest hour and then show the data on chart from target datetime in chartjs
- JavaScript ignore commas inside ChartJS data field pulled from csv that data has commas and is enclosed by double quotes
- graph data from a angular form to ChartJs
- ChartJS - format datetime X axis when displaying data from MySql table
More Query from same tag
- Chart js sum of grouped bars
- How to use radial CanvasGradients with Chart.js's doughnut chart?
- Chart.js - Plot line graph with X , Y coordinates
- Can't pass data to chart.js graph
- Click events on Pie Charts in Chart.js
- Is there any way to show a tooltip for points which are not visible on the chart in Chart.js?
- Which jquery plugin can create a stacked column chart?
- Chart.js. Values in a big range. The smallest values are not available
- Getting a Chart is not defined ReferenceError with in React + React-chartjs
- How to set lower limit for the highest value being displayed on Y Axis?
- Chart.js time series
- How we embed google analytics chart from google analytic with angular 4?
- Unable to Construct Stacked Vue-ChartJS Line Plot
- chart.js hide gridline inside chartarea but keep y-axis border
- Cannot find module /chartjs.helpers while using chartjs-plugins-datalabels (ReactJS)
- Line ChartJS empty / null values doesn't break the line
- Chart.JS value on top disappear when tooltip show up
- how to reset the graph/chart after zoomin, pan using chartjs
- angular-charts 1.0.0 not working like inner directive when element
- Horizontal scroll in vue-chartjs
- how to resize specific gridline(s) in chart.js
- Properly scaling xAxis with time in chart.js
- ng2-charts & chart.js - Change background color
- chartjs-plugin-annotation won't draw anything
- Show date on xAxes without labels
- chartjs stack bar graph color not working
- chart.js 2.7.1 | Updating charts with variables
- Can i use destroy charts in React.js using Chart.js?
- Angular js pie chart styling
- Chartjs time plot xAxis shows year 1970