-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue 6751: epoch date formats '%H:%M:%S' as 'undefined' #6752
Conversation
This patch fixes issue plotly#6751, where the epoch timestamp '1970-01-01 00:00:00', with 'hoverformat' '%H:%M:%S' is formatted as 'undefined'. Signed-off-by: adamjhawley <adamhawley99@gmail.com>
Signed-off-by: adamjhawley <adamhawley99@gmail.com>
Let's add two tests for each fix to this file below this test: plotly.js/test/jasmine/tests/hover_label_test.js Lines 4368 to 4382 in 6408944
You could then |
@archmoj I am currently trying to add the tests but I am having difficulty with I see that the test you included has 'xpx: 65'. I am wondering how I can correctly populate the same parameter for my tests. |
If you add console log in var dates = [0,1].map(x => `1970-01-01 00:00:0${x}`);
var data = [
{
type: 'scatter',
x: dates,
y: [5,2,3,1,4],
hovertemplate: "%{x}, %{y}"
}]
var layout = {
xaxis: {
tickformat: '%H:%M:%S',
hoverformat: '%H:%M:%S'
},
}
Plotly.newPlot(gd, data, layout); Then you could hover over the desired position to read the print in the console. |
Alternatively you could add a unit test instead here: |
@adamjhawley |
💃 |
@archmoj ok, thanks a lot, will do! Thanks for all of your help! |
Hi all! This is my first time contributing to plotly so open for feedback & comments :)
This patch fixes issue #6751, where the epoch timestamp '1970-01-01 00:00:00', with 'hoverformat' '%H:%M:%S' is formatted as 'undefined'.