score:1
Accepted answer
here is the code:
var fv201_ctx = document.getelementbyid('fv201_chart').getcontext('2d');
var fv201_cfg = {
type: 'line',
data: {
labels: fv201_timestamps,
datasets: [
{
label: 'temps',
data: fv201_temps,
type: 'line',
fill: false
}
]
},
options: {
title: {text: 'my chart', display: false},
scales: {
xaxes: [{
type: 'time',
time: {
unit: 'second',
displayformats: { second: 'hh:mm:ss' },
parser: function(foo) { return moment(foo,'x'); }
}
}],
yaxes: [{
ticks: {
suggestedmin: 28.5,
suggestedmax: 29,
stepsize: 0.1
}
}]
},
}
};
var fv201_chart = new chart(fv201_ctx, fv201_cfg);
fv201_chart.update();
options
should not be insidedata
object.- x and y axes should be array types.
Source: stackoverflow.com
Related Query
- chart.js - problems with axes options - what am I doing wrong?
- what is wrong with my code ? java script chart position
- ChartJS:align zeros on chart with multi axes
- chart.js v 2.0.1 line, scatter chart pointRadius bug or I'm doing it wrong
- Using chart js options with react-chartjs-2 and typescript
- react-chartjs-2 line chart with time on X-axes with multiple data sets plotted wrong
- Having problems getting a line chart in Chartsjs to go *up* to 1, with bkg fill *under* the chart line
- ChartJS pie chart with simple parsing options doesn't render, only works when set as bar/line chart
- React with chart js, labelling problems in multiple datasets for doughnut chart
- Chart js with problems when using too many series
- Chart options not used with chart js
- How to make dynamic chart with the next view? What libraries allows to customise exactly this like in my design?
- jQuery - destroy and rebuild chart with original options
- How can I create a horizontal scrolling Chart.js line chart with a locked y axis?
- Chartjs random colors for each part of pie chart with data dynamically from database
- ChartJS New Lines '\n' in X axis Labels or Displaying More Information Around Chart or Tooltip with ChartJS V2
- Draw a Chart.js with ajax data and responsive. A few problems and questions
- How to prevent first/last bars from being cut off in a chart with time scale
- ChartJS - Draw chart with label by month, data by day
- Horizontal stacked bar chart with chart.js
- line chart with {x, y} point data displays only 2 values
- Vertical stacked bar chart with chart.js
- Display line chart with connected dots using chartJS
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Dynamically update the options of a chart in chartjs using Javascript
- Chart.js - line chart with two yAxis: "TypeError: yScale is undefined"
- How to fix chart Legends width-height with overflow scroll in ChartJS
- How to display Line Chart dataset point labels with Chart.js?
- chart js how to fill legend box with colour
- Chart.js Mixed Bar and Line chart with different scales
More Query from same tag
- Inserting data from arrays into a pie chart (chart.js)
- Importing data from Model into a View gives me an error I cannot solve
- Display PHP Array in Chart.js tooltip
- Issue with chartjs linear gradient for the mixed bar chart in ReactJS is not calculated for each individual Bars
- [MIXED CHART.JS]animation option screws up chart.js
- Dynamically create Angular-Chart with data binding
- Is it possible to add a custom font to chart js?
- How to get access to Chart instance related to current tooltip callback in Chart.js
- chart.js Second hidden value for Bar Chart
- How to set minimal value for bar chart in Chart.js? (ver. 2.0.2)
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- JavaScript doughnut chart with centered hover label
- trouble passing API result to chart
- Implement a cash flow timeline
- Using data from API with Chart JS
- Chart.js displaying each letter of label and data as a single value on chart. The data and labels provided are arrays
- Chart.js point format data for a scatter plot
- Using Chart.js on Angular 4
- Chart.js - How to place text outside of radar chart
- Draw a Chart.js with data retrieved through ajax call
- ChartJS Generate Date Format
- How to compare one value to another in chartJS
- How to make Chart.js Bubble chart with ng2-chart?
- Chart JS showing empty chart without any data
- why the main and axis title does not show in chart.js
- ChartJS - Override Attributes (AngularJS)
- change stroke line color in chart according to datasets in react native
- Chart.js - How to display all bars as different datasets(same behaviour as doughnut)
- Is there a way to have the tooltips always shown on a pie/doughnut in Chart.js v3?
- How to sum the array value in javascript like chartjs data array and input value sum