Skip to content

XDomain should fallback to ordinal type #678

@nickofthyme

Description

@nickofthyme

Describe the bug
Using a LineSeries when defining an XScaleType as linear or undefined, elastic charts will try to use linear and use ordinal as a fallback if needed. This should be the same logic with AreaSeries.

Version (please complete the following information):

  • OS: macOS
  • Browser: chrome
  • Elastic Charts: latest

Additional context
Related to code below...

if (!isNumberArray(values)) {
throw new Error(
`Each X value in a ${mainXScaleType.scaleType} x scale needs be be a number. String or objects are not allowed`,
);
}

Errors in browser console

Uncaught Error: Each X value in a linear x scale needs be be a number. String or objects are not allowed
    at Object.mergeXDomain (x_domain.js:51)
    at Object.computeSeriesDomains (utils.js:136)
    at compute_series_domains.js:14
    at resultFuncWithRecomputations (index.js:77)
    at index.js:70
    at index.js:30
    at index.js:84
    at index.js:30
    at selector (index.js:105)
    at index.js:80

Metadata

Metadata

Assignees

Labels

:axisAxis related issue:vislibRelating to vislib replacement:xyBar/Line/Area chart relatedbugSomething isn't workingreleasedIssue released publicly

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions