Skip to content

Commit

Permalink
Fix for linear chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Ślusarski Krzysztof committed Feb 5, 2021
1 parent 3c2c2ff commit 025428d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
16 changes: 5 additions & 11 deletions gui-commons/src/main/java/pl/ks/profiling/gui/commons/Chart.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,16 @@ private String emptyForNull(String value) {
return value;
}

public Object[] getHighChartYAxisLabels() {
int numberOfSeries = data.length - 1;
Object[] ret = new Object[numberOfSeries];
for (int i = 1; i < data.length; i++) {
ret[i - 1] = data[i][0];
}
return ret;
}

public List<HighChartSeries> getHighChartSeriesData() {
int numberOfSeries = data[0].length;
List<HighChartSeries> ret = new ArrayList<>(numberOfSeries - 1);
for (int i = 1; i < numberOfSeries; i++) {
Object[] series = new Object[data.length - 1];
Object[][] series = new Object[data.length - 1][];
for (int j = 1; j < data.length; j++) {
series[j - 1] = data[j][i];
Object[] seriesData = new Object[2];
seriesData[0] = data[j][0];
seriesData[1] = data[j][i];
series[j - 1] = seriesData;
}
ret.add(new HighChartSeries(data[0][i].toString(), series));
}
Expand Down
2 changes: 0 additions & 2 deletions web-commons/src/main/resources/templates/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ <h3 th:if="${content.title != null}">[[${content.title}]]</h3>

xAxis: {
...common.xAxis,
categories: /*[[${content.getHighChartYAxisLabels()}]]*/,
},
series: /*[[${content.getHighChartSeriesData()}]]*/,
});
Expand All @@ -212,7 +211,6 @@ <h3 th:if="${content.title != null}">[[${content.title}]]</h3>

xAxis: {
...common.xAxis,
categories: /*[[${content.getHighChartYAxisLabels()}]]*/,
},
series: /*[[${content.getHighChartSeriesData()}]]*/,
});
Expand Down

0 comments on commit 025428d

Please sign in to comment.