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

Define bar width if bar chart contains only data for a single date #8354

Merged
merged 2 commits into from
Jun 23, 2020

Conversation

linuspahl
Copy link
Contributor

As described in #7167 a bar chart with a time range and only one search result, results in one very small bar. This PR is fixing the problem by defining a width for the bar. The width can't be defined in px, it has to be the unit of the x axis (in this case ms).

Fixes #7167

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

@@ -31,7 +31,7 @@ export type VisualizationComponentProps = {
config: AggregationWidgetConfig,
data: { [string]: Rows, events?: Events },
editing?: boolean,
effectiveTimerange: TimeRange,
effectiveTimerange: AbsoluteTimeRange,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know the effective time range is always an AbsoluteTimeRange. Or is there a case were it can be another type?

@@ -2,6 +2,9 @@

type ConfigType = { [string]: mixed };

export const DateType = 'time';
export const ValuesType = 'values';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will create a follow up PR to replace all related hard coded values.

@linuspahl linuspahl marked this pull request as draft June 16, 2020 13:43
@linuspahl linuspahl marked this pull request as ready for review June 16, 2020 14:01
Copy link
Member

@dennisoelkers dennisoelkers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, fixes the issue for now. As mentioned before, we should remove the workaround by returning the bucket size in the backend, but this requires further work and this fix does it for the meantime.

@dennisoelkers dennisoelkers merged commit 52f6547 into master Jun 23, 2020
@dennisoelkers dennisoelkers deleted the xy-chart-single-value branch June 23, 2020 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time based bar charts with a single value do not render correctly
2 participants