Skip to content

Commit

Permalink
feat:add legend wrrap and height to lineGraph
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvl01 committed Nov 2, 2021
1 parent 7035858 commit 517a19f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Incidents/lineGraph/lineGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,9 @@ export default class LineGraph extends MotorCortex.HTMLClip {
height: 0.58,
};
this.legendHeightFactor = this.dataSetsNum === 1 ? 1 : this.dataSetsNum / 2;
this.legendHeight =
4 * (this.legendHeightFactor + (this.legendHeightFactor % 1 ? 1 : 0));
this.legendHeight = this.attrs.legendHeight
? this.attrs.legendHeight
: 4 * (this.legendHeightFactor + (this.legendHeightFactor % 1 ? 1 : 0));
this.linesWidth =
helpers.extractUnitsNums(this.props.containerParams.width).number *
this.graphScale.width;
Expand All @@ -442,7 +443,6 @@ export default class LineGraph extends MotorCortex.HTMLClip {
(this.linesWidth - this.steleWidth * this.data.length) /
(this.data.length * 2);
this.r = this.attrs.dataPointR ? this.attrs.dataPointR : 0.65;

// Global access data process functions
this.findPointX = (datapoint) => {
return (
Expand Down
5 changes: 2 additions & 3 deletions src/Incidents/lineGraph/lineGraphStylesheet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import jss, { createGenerateId } from "jss";
import jss from "jss";
import config from "../../incident_config";

export default function buildCSS(lineGraph) {
Expand Down Expand Up @@ -63,7 +63,7 @@ export default function buildCSS(lineGraph) {
background: lineGraph.quinaryC,
"font-size": lineGraph.fontSizeInner,
display: "flex",
"flex-wrap": "wrap",
"flex-wrap": lineGraph.attrs.legendWrrap ? "flex" : "nowrap",
"align-items": "center",
"z-index": "1",
},
Expand Down Expand Up @@ -248,7 +248,6 @@ export default function buildCSS(lineGraph) {
},
};

const colorCounter = 2;
for (let l = 0; l < lineGraph.dataSetsNum; l++) {
let dynamicColor;
if (lineGraph.dataSetsNum > 1) {
Expand Down

0 comments on commit 517a19f

Please sign in to comment.