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

TypeError: xScale.rangeBand is not a function #5323

Closed
stormpython opened this issue Nov 5, 2015 · 2 comments
Closed

TypeError: xScale.rangeBand is not a function #5323

stormpython opened this issue Nov 5, 2015 · 2 comments
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Vislib Vislib chart implementation PR sent

Comments

@stormpython
Copy link
Contributor

This was an issue opened in the Discuss Forum (https://discuss.elastic.co/t/typeerror-xscale-rangeband-is-not-a-function/33313), which is copied verbatim below.

I am trying to make a date histogram in the next scenario

Kibana 4.1.1
Create a date histogram where the time field(myDate) is not the same that the index time field (@timestamp).
Split Chart, Filter Aggregation by a timestamp range like @timestamp:[2015-07-20T05:00:00 TO 2015-07-20T19:00:00].
Nothing is shown in the visualization and in the console:
TypeError: xScale.rangeBand is not a function
at SVGRectElement. (:4601/index.js?_b=7489:136242)
at SVGRectElement.attrFunction (:4601/index.js?_b=7489:122485)
at :4601/index.js?_b=7489:122769
at d3_selection_each (:4601/index.js?_b=7489:122775)
at Array.d3_selectionPrototype.each (:4601/index.js?_b=7489:122768)
at Array.d3_selectionPrototype.attr (:4601/index.js?_b=7489:122468)
at ColumnChartFactory.ColumnChart.addStackedBars (:4601/index.js?_b=7489:136241)
at ColumnChartFactory.ColumnChart.updateBars (:4601/index.js?_b=7489:136209)
at ColumnChartFactory.ColumnChart.addBars (:4601/index.js?_b=7489:136185)
at HTMLDivElement. (:4601/index.js?_b=7489:136408)

After do this, I noticed this still happens no matter which sub-aggregation I choose in split chart section.(Filter, Terms, Date Range)

Does anybody could advise me about this?

image

Many thanks in advance.

@stormpython stormpython added bug Fixes for quality problems that affect the customer experience Feature:Vislib Vislib chart implementation labels Nov 5, 2015
@stormpython stormpython self-assigned this Nov 5, 2015
@stormpython
Copy link
Contributor Author

These are more notes from the user who discovered the bug:

I see what you mean, in kibana 4.1.1, if I print my data.ordered it does not have min, max fields
image

success scenario: Object {date: true, interval: Duration, min: Moment, max: Moment}

error scenario: Object {date: true, interval: Duration, endzones: false}

After debugging a little bit more I noticed there is a _normalizeOrdered method that is in charge to ensure min/max values to ordered object when they don't come directly from the timepicker.... (in my case when I use a different time field and X axis field).
image

This works perfect when data object is just one:
image

However when I split the chart this data object is an object with rows:
image

and since data.ordered is actually stored in data.rows[0].ordered; data.rows[1].ordered.... min/max values are not set by _normalizeOrdered method, causing this error.

I think I am missing something since you don't see this error, but not sure what, hope this info can help to reproduce this.

stormpython added a commit that referenced this issue Nov 5, 2015
…issue involved the _normalizeOrdered function not being able to access the ordered object when data objects were nested in rows or columns.
@MirkoTV
Copy link

MirkoTV commented Nov 5, 2015

Many Thanks @stormpython !, I'll be also testing this

stormpython added a commit to stormpython/kibana that referenced this issue Nov 12, 2015
…d. The issue involved the _normalizeOrdered function not being able to access the ordered object when data objects were nested in rows or columns.
stormpython added a commit to stormpython/kibana that referenced this issue Nov 12, 2015
…d. The issue involved the _normalizeOrdered function not being able to access the ordered object when data objects were nested in rows or columns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Vislib Vislib chart implementation PR sent
Projects
None yet
Development

No branches or pull requests

2 participants