-
Notifications
You must be signed in to change notification settings - Fork 49
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
Using timestamps as x-axis values results in misaligned labels #450
Comments
+1, I am having the same problem. |
Right now I am using the following workaround:
EDIT: tickFormat: (x: number) => {
// workaround for https://github.com/f5/unovis/issues/450
if (format.startsWith('date')) {
const index = model.data.findIndex(d => d.index === x)
return formatValue(model.data[index].timestamp, format)
}
return formatValue(x, format)
}, This gets us over a hump, until hopefully a fix arrives: |
Thank you, I did that after your original post suggestion. Much appreciated @davestewart ! |
Neat work around @davestewart - thanks |
@davestewart does indeed fix it. A small addition: NumericAccessor has an index parameter you could use so that you can leave the original data untouched.
Then you can format your date as needed. |
@dennisadriaans thanks! I'll confirm when I'm back on this bit of the project. |
Currently, this is the expected behavior of the axis component - it doesn't know anything about your data and assumes the data is continuous and behaves the same whether you have hundreds of data points or just a few. We may tweak this behavior later, but for now we plan to leave it as it is because it's pretty easy to reconfigure by explicitly providing an array of `tickValues'. |
Hello,
We're using timestamps as our Datum x-axis values, but it seems to result in misaligned x-axis labels:
Using indices, the labels line up perfectly:
Feels like a bug.
Is it?
The text was updated successfully, but these errors were encountered: