Skip to content

Commit

Permalink
Charting: LineChart - callout not visible when graph more dense issue…
Browse files Browse the repository at this point in the history
… resovled. (microsoft#13933)

* linechart-callout not visible in dense graph issue resolved

* Change files

* change files

Co-authored-by: Jameela Kowsar Shaik (Zen3 Infosolutions America Inc) <v-jasha@microsoft.com>
  • Loading branch information
jameelakowsar and Jameela Kowsar Shaik (Zen3 Infosolutions America Inc) committed Jul 8, 2020
1 parent 1f2048c commit 957978a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 deletions.
@@ -0,0 +1,8 @@
{
"type": "patch",
"comment": "linechart-callout not visible in dense graph issue resolved",
"packageName": "@uifabric/charting",
"email": "v-jasha@microsoft.com",
"dependentChangeType": "patch",
"date": "2020-07-07T13:31:04.672Z"
}
33 changes: 8 additions & 25 deletions packages/charting/src/components/LineChart/LineChart.base.tsx
Expand Up @@ -112,8 +112,14 @@ export class LineChartBase extends React.Component<
/** note that height and width are not used to resize or set as dimesions of the chart,
* fitParentContainer is responisble for setting the height and width or resizing of the svg/chart
*/
if (prevProps.height !== this.props.height || prevProps.width !== this.props.width) {
if (
prevProps.height !== this.props.height ||
prevProps.width !== this.props.width ||
prevProps.data !== this.props.data
) {
this._fitParentContainer();
this._points = this.props.data.lineChartData ? this.props.data.lineChartData : [];
this._calloutPoints = this.CalloutData(this._points) ? this.CalloutData(this._points) : [];
}
}

Expand Down Expand Up @@ -237,6 +243,7 @@ export class LineChartBase extends React.Component<
index: number,
) => (
<div
id={`${index}_${xValue.y}`}
className={mergeStyles(this._classNames.calloutBlockContainer, {
borderLeft: `4px solid ${xValue.color}`,
})}
Expand Down Expand Up @@ -580,17 +587,6 @@ export class LineChartBase extends React.Component<
);
}
} else {
lines.push(
<circle
id={circleId}
key={lineId + 1}
r={5}
cx={this._xAxisScale(x1)}
cy={this._yAxisScale(y1)}
opacity={0.1}
fill={lineColor}
/>,
);
lines.push(
<line
id={lineId}
Expand All @@ -605,19 +601,6 @@ export class LineChartBase extends React.Component<
opacity={0.1}
/>,
);
if (j + 1 === this._points[i].data.length) {
lines.push(
<circle
id={circleId}
key={lineId + 2}
r={5}
cx={this._xAxisScale(x2)}
cy={this._yAxisScale(y2)}
fill={lineColor}
opacity={0.1}
/>,
);
}
}
}
}
Expand Down

0 comments on commit 957978a

Please sign in to comment.