Skip to content

Commit

Permalink
#3213 Scatter charts can have category Y axis (similar to Bubble) (#3243
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kravets-levko authored Jan 3, 2019
1 parent 670d86e commit ba0d069
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/app/visualizations/chart/plotly/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,9 @@ function prepareChartData(seriesList, options) {
// Sort by x - `Map` preserves order of items
const data = sortX ? sortBy(series.data, d => normalizeValue(d.x)) : series.data;

// For bubble charts `y` may be any (similar to `x`) - numeric is only bubble size;
// For bubble/scatter charts `y` may be any (similar to `x`) - numeric is only bubble size;
// for other types `y` is always number
const cleanYValue = seriesOptions.type === 'bubble' ? normalizeValue : cleanNumber;
const cleanYValue = includes(['bubble', 'scatter'], seriesOptions.type) ? normalizeValue : cleanNumber;

const sourceData = new Map();
const xValues = [];
Expand Down Expand Up @@ -639,7 +639,7 @@ function updateSeriesText(seriesList, options) {
};
const item = series.sourceData.get(x);
if (item) {
text['@@y'] = seriesOptions.type === 'bubble' ? item.y : series.formatNumber(item.y);
text['@@y'] = includes(['bubble', 'scatter'], seriesOptions.type) ? item.y : series.formatNumber(item.y);
if (item.yError !== undefined) {
text['@@yError'] = series.formatNumber(item.yError);
}
Expand Down

0 comments on commit ba0d069

Please sign in to comment.