Skip to content

Commit

Permalink
fixup! allow x-axis label truncation (re getredash#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Short committed Dec 15, 2017
1 parent 4ac5d97 commit 2f08a71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/app/visualizations/chart/plotly.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,12 @@ const PlotlyChart = () => {

series.data.forEach((row) => {
plotlySeries.values.push(row.y);
plotlySeries.labels.push(hasX ? row.x.substr(0, xAxisLabelLength) : `Slice ${index}`);
if (scope.options.seriesOptions[hasX ? row.x.substr(0, xAxisLabelLength) : `Slice ${index}`] === undefined) {
plotlySeries.labels.push(hasX ? row.x.toString().substr(0, xAxisLabelLength) : `Slice ${index}`);
if (scope.options.seriesOptions[hasX ? row.x.toString().substr(0, xAxisLabelLength) : `Slice ${index}`] === undefined) {
plotlySeries.marker.colors.push(getColor(index));
index += 1;
} else {
plotlySeries.marker.colors.push(scope.options.seriesOptions[hasX ? row.x.substr(0, xAxisLabelLength) : `Slice ${index}`].color);
plotlySeries.marker.colors.push(scope.options.seriesOptions[hasX ? row.x.toString().substr(0, xAxisLabelLength) : `Slice ${index}`].color);
}
});

Expand Down

0 comments on commit 2f08a71

Please sign in to comment.