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

VSD-51478 Heatmap graph legend and xAxis ticks issue #447

Merged
merged 1 commit into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Graphs/AbstractGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,12 +582,12 @@ export default class AbstractGraph extends React.Component {
// Place the legends in the bottom left corner
legendStyle = { ...legendStyle, alignSelf: 'flex-end', height: legendHeight }
} else {
// Place legends horizontally, 20 is margin between legends
// Place legends horizontally, 30 is margin between legends
const highestLabel = this.getLongestLabel(legendData, label);
legendStyle = {
...legendStyle,
display: 'grid',
gridTemplateColumns: `repeat(auto-fit, ${highestLabel+20}px)`,
gridTemplateColumns: `repeat(auto-fit, ${highestLabel+30}px)`,
}
}

Expand Down Expand Up @@ -694,8 +694,8 @@ export default class AbstractGraph extends React.Component {

if (legend) {
const { legendCount, lineHeight, legendWidth } = legend;
//Caluting legendContainer height, 20 is margin between margin label.
let legendRow = Math.ceil( legendCount * (highestLabel + 20) );
//Caluting legendContainer height, 30 is margin between margin label.
let legendRow = Math.ceil( legendCount * (highestLabel + 30) );
legendRow = Math.ceil(legendRow / legendWidth)

return legendRow * lineHeight;
Expand Down
2 changes: 1 addition & 1 deletion Graphs/defaultProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default {
yLabelLimit: 20,
xLabelLimit: 10,
xLabelRotate: true,
xLabelRotateHeight: 25,
xLabelRotateHeight: 45,
appendCharLength: 3,
brushArea: 20, // // in percentage
otherColors: [
Expand Down