score:4
Accepted answer
this code actually works fine. the only problem was that i was looking at the _i value of the moment object to check it's value (this is the value used as the initial input when creating the object, not necessarily the current value).
changing the console.log line to the following yields the expected / correct result:
console.log(event.offsetx, valuex.format('yyyy-mm-dd hh:mm:ss'), null, event.offsety, valuey);
Source: stackoverflow.com
Related Query
- ChartJS v2: Scale value at click coordinates (time scale)
- Category scale on Y-axis and time on x-axis in bubble chart in Chartjs
- chartjs Line chart: scale respect value on x-axis
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- ChartJS Y-Axis scale value wrong
- How to set the chartjs bar graph scale to the highest value in the result data
- How to set a time scale to a ChartJS chart from JSON?
- chartjs plot datetime value with time offset on the grid
- ChartJS with React: Only one value showing on time chart
- ChartJS Bar chart with time scale - Bars overlap with each other
- How to format x-axis time scale values in Chart.js v2
- Truncating canvas labels in ChartJS while keeping the full label value in the tooltips
- How to prevent first/last bars from being cut off in a chart with time scale
- how to plot multiple time series in chartjs where each time series has different times
- How to make integer scale in Chartjs
- chartjs : how to set custom scale in bar chart
- TimeSeries scale in ChartJS 3.0.2. brings error "This method is not implemented: either no adapter can be found or an incomplete integration was ..."
- Show bar with zero value in ChartJs v2
- Chartjs displays numbers not time
- ChartJS Line Graph - Multiple Lines, Show one Value on Tooltip
- Click event on stacked bar chart - ChartJs
- Change point color on click using ChartJS
- ChartJS show gaps in time data
- Chartjs time plot xAxis shows year 1970
- Get X, Y onClick chart coordinates in ChartJS
- How do I fix over limit y axis value in ChartJS
- How to set time scale zoom in ChartJS?
- chartjs - Drawing vertical line on integer x axis value
- Map event position to y axis value in chartjs line chart
- Datalabels plugin chartjs showing '[object]' instead of value
More Query from same tag
- Uncaught Error: [$injector:modulerr] Error: [$injector:nomod] Module 'chart.js' is not available
- chartjs align origin of the axis to the corner of graph
- concatenate on tooltip from data array in chart js
- ChartJs not showing top label
- Chart.js Radar background color of background
- Undefined values in chart.js from json
- Remove/Hide (display:none) the graphical chart in small-mobile view - JS chart
- Fit outlabels to canvas and use different colors chartjs
- chartjs - how to set the order in which the different charts are displayed
- Changing style of individual point Chart.js
- ChartJS set yAxes "ticks"
- Tooltips in Chart js are always black instead of the color of the corresponding dataset
- Change labels colors for radar chart js
- What is the correct way to send 2 parameters in socket.io using lambdas? (I get undefined when printing in client and server)
- ChartJS: Is this horizontal stacked bar and line graph multiaxis chart even possible?
- dynamic number of chart.js charts on the same page
- Add rectangle fill to line chart
- Datas put one on each other on chart.js
- How to put labels at 4 points of the day?
- Same bar different color / One bar with many colors
- Chart.js: how to listen to hover/click events outside of plot area?
- Chartjs time serie in wrong format
- Alternating bars in bar chart in chart.js are not labelled
- Multi label tool-tip in Chart.js
- chart js: when all the values passed to data are zeros, nothing is showing
- How to Integrating Chart.js with Angular 7 with Data from database
- Can I use a custom data format when using Vue + Chartjs
- Chartjs: Is it possible to hide the data labels on the axis but show up on the graph on hover?
- How to show gradient vertically on chart js grouped bar chart?
- Custom tooltip on Chart.js is coming undefined