score:3
Accepted answer
OK great questions.
First, PF knows they did not implement time yet but there is an open ticket: https://github.com/primefaces/primefaces/issues/4564
Second, have no fear you can use the Extender feature to make it work. Here is an example we used.
- In your Java model for your chart set the Extender feature on.
chartModel.setExtender("chartExtender");
- In your XHTML add this JavaScript code function to match when you set in #1 Java bean.
function chartExtender() {
//copy the config options into a variable
var options = $.extend(true, {}, this.cfg.config);
options = {
//remove the legend
legend: {
display: false
},
scales: {
xAxes: [{
display: true,
type: "time",
time: {
parser: 'h:mm:ss a',
tooltipFormat: 'h:mm:ss a',
unit: 'hour',
displayFormats: {
'hour': 'h:mm:ss a'
}
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Your Y Axis',
fontSize: 13,
}
}]
}
};
//merge all options into the main chart options
$.extend(true, this.cfg.config, options);
};
You can see the different time formats available from ChartsJS using MomentJS.
score:0
Just a complement to do the extender works, use this.cfg.config.options = {...
for exemple:
function extName() {
this.cfg.config.options = {
legend: {
display: false
}
};
};
Source: stackoverflow.com
Related Query
- How to display timestamped data with PrimeFaces and ChartJs?
- How to implement doughnut ChartJS with CodeIgniter 3 and display data from database
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- Angular 2: How to pass my API data to graph and Display the Graph with data
- How to display chart using Chartjs with JSON data in Laravel
- How to reuse a Chartjs Chart component in with different Data and get past the **Canvas is already in use** error?
- How to properly feed data to ChartJS with different number of x(labels) and y(data) points
- How to set min max for x axis depend on data with Chartjs and Spring Boot?
- ChartJs How to display horizontal and vertical lines through the datasets points with their values on axes?
- How do I fetch data from 2 tables and display into 1 chartjs
- How to display data labels outside in pie chart with lines in ionic
- How to feed hour and minute data into chartJS
- ChartJs line chart - display permanent icon above some data points with text on hover
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- ChartJS - how to display line chart with single element as a line? (not as a dot)
- How to achieve the best possible performance with mutable data and real-time charts in React?
- How to create chartjs chart with data from database C#
- Graph streaming real-time data with react and chartjs
- How to get chart from data points (arrays) with inconsistent time intervals and chart.js?
- how to display chart data as html table chartjs
- How can I load multiple Chartjs charts with different data on the same page?
- how to display multiple sum with chart js and laravel?
- How to create a custom tooltip for chartJS graph with data in JSON array in JavaScript?
- How To Match Left and Right Tick Intervals with Chartjs
- How to plot Firebase data with Chartjs in angular
- How to add new data point and remove leftmost data point dynamically in Chartjs
- How to include adapters and plugins with ChartJS
- How to get Data from API to display chart using chartjs in Vuejs
- How to set ChartJS Axis label with PrimeFaces
- How to take a set of Date objects and display the frequency based on time of day using ChartJS
More Query from same tag
- Django Chartjs outputs "No data" when data has value 0
- Html canvas element resets width and height to zero after drag/drop
- Chart.js Uncaught TypeError: Cannot read properties of undefined (reading 'options')
- How to create two pie charts using Chart.js API?
- Legend only show on force refresh of page-chartjs
- Polar Area Chart
- Chartjs: Overlapping values when using Datalabels plugin
- Show wrong information in chart js 2
- remove strikethrough behavior in chart.js bar chart
- How to add space to the bottom of the chart in chartjs [angular]
- ERROR TypeError: Cannot read properties of undefined (reading 'skip') Typescript/Api
- Tooltips on multiple charts in chart.js showing the wrong values
- 'filter' function for chart.js legend labels never being called
- How to use plugin in chartjs-node?
- 'barradius' for Barchart in ChartJS is not working
- how to change default font family in react-chartjs-2
- Prevent y-axis labels from being cut off
- Add bar chart in a column
- Chart.js Legend Customization
- Can't parse data from json
- Chart.js click event to open a custom tooltip does not work sometimes
- can't dispal 2 garphs on chart.js
- Chart.js - Line charts with different colors for each border lines
- Vue 2: How to unit test component that uses Chart.js (vue-chart-3)
- Chart.js group data by month\year
- Modifying values in a radar chart.js based on user input
- ChartJS - adding scroll to horizontal legend in Line chart
- Chart.js 2.x: labels displaying over eachother
- How to align legend in angular-chart.js
- chart js download to png with canvas.toDataURL() not working in IE and firefox