Redash: Date/Time Values Format has no effect on Chart X Axis

Created on 26 Dec 2018  路  12Comments  路  Source: getredash/redash

222
111

Frontend Visualizations Chart

Most helpful comment

Hi @timc13! It's a technical issue that we currently don't have solution for. We use Plotly.js to render charts, and it's formatting syntax is really weird (probably ok for developer, but definitely not for a regular users). Once we'll find a good way to convert "human-friendly" format (that we use) to ugly one used by Plotly.js - we'll fix this issue.

All 12 comments

Hi @kalsolio

Date/Time setting is for 'data labels' only, and has no effect on 'x-axis labels'.

Maybe we should add a comment mentioning this in the UI?

Perhaps a separate issue, but why can't we format the for x-axis ? (Category or DateTime)

Hi @timc13! It's a technical issue that we currently don't have solution for. We use Plotly.js to render charts, and it's formatting syntax is really weird (probably ok for developer, but definitely not for a regular users). Once we'll find a good way to convert "human-friendly" format (that we use) to ugly one used by Plotly.js - we'll fix this issue.

I second this request!

please 馃憤

Hi @kravets-levko @arikfr , i found an idea to fix this bug. plotly codepen about axis tickformat In layout set tickformat: %Y %m %d, it will change x or y axis format. Like this:
image

Currently I cannot integrate this modification into redash, but it seems to be effective.

Hi @yankeeguyu! Yep, we know about this, but please read this comment https://github.com/getredash/redash/issues/3215#issuecomment-460945725 . D3-like syntax (%Y %m %d) is not very user-friendly, also, we don't want to introduce second formatting engine (currently we use Moment.js which syntax is more human-oriented: YYYY MM DD). Current idea is to somehow convert Moment syntax to D3, but we're still investigating this.

Hi @kravets-levko , thank you reply! Perhaps this problem can be modified as an option, such as scale, we can use Moment.js as an option, but the actual value is a d3 type value, maybe this is a feasible solution. Like this:
image

Now i want to use this solution, but i encountered some problems during development.

Value format inputs are not dropdown, it's a text inputs so user may type any valid format string. If we even imagine that we could somehow start using D3 format by default but allowing user to type Moment format string - then we still have to convert between Moment and D3 formats, but in addition we'll have to migrate already created visualizations.

Value format inputs are not dropdown, it's a text inputs so user may type any valid format string. If we even imagine that we could somehow start using D3 format by default but allowing user to type Moment format string - then we still have to convert between Moment and D3 formats, but in addition we'll have to migrate already created visualizations.

Ok, i see it! Look forward to fixing this bug! Thank you @kravets-levko !

Was this page helpful?
0 / 5 - 0 ratings