Skip to content
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

Disallow log scale for discrete bar charts #4364

Open
sophiamersmann opened this issue Jan 2, 2025 · 0 comments
Open

Disallow log scale for discrete bar charts #4364

sophiamersmann opened this issue Jan 2, 2025 · 0 comments

Comments

@sophiamersmann
Copy link
Member

Description

Plotting discrete bar charts and stacked discrete bar charts on a log scale is confusing since it's not immediately clear that what you see is plotted on a log scale. The bar lengths might be misinterpreted by a user as a result.

Expected behaviour

We should disallow log scale for discrete bar charts and stacked discrete bar charts.

We could also make it more obvious that the data is plotted on a log scale, but I can't think of a compelling use case for allowing bar charts on a log scale.

For discrete and stacked discrete bar charts, simply don't show the log/linear toggle. We currently don't have any bar charts that are on a log scale by default.

For line charts (that turn into a discrete bar chart):

  • Hide the log/linear toggle when a discrete bar chart is viewed
  • Changing to a discrete bar chart after selecting a log scale is ok for now, I think
    • Since the timeline is the only way to get to a discrete bar chart, it would be confusing if we sometimes allowed, sometimes disallowed single-year mode (depending on the current chart settings)
    • If we add a Bar chart tab for line charts, then we could hide the bar chart tab when the line chart is plotted on a log scale

Additional context

Queries

select c.id, cc.chartType, cc.slug
from charts c
join chart_configs cc on c.configId = cc.id
where
    (cc.chartType = 'DiscreteBar' or cc.chartType = 'StackedDiscreteBar')
    and cc.full ->> '$.yAxis.scaleType' = 'log';
select c.id, cc.chartType, cc.slug
from charts c
join chart_configs cc on c.configId = cc.id
where
    cc.chartType = 'LineChart'
    and cc.full ->> '$.yAxis.scaleType' = 'log' and cc.full ->> '$.minTime' = cc.full ->> '$.maxTime';
select c.id, cc.chartType, cc.slug
from charts c
join chart_configs cc on c.configId = cc.id
where
    (cc.chartType = 'DiscreteBar' or cc.chartType = 'StackedDiscreteBar') and
    cc.full ->> '$.yAxis.canChangeScaleType' = 'true';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant