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

feat(declarative-chart): Create Scatter plot #33843

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Prev Previous commit
change in RTL condition
  • Loading branch information
Anush2303 committed Feb 28, 2025
commit 0b3ffcbe92ea53d6cd6ae82c9dc0df130835d553
Original file line number Diff line number Diff line change
@@ -74,6 +74,9 @@ let xMin = Number.NEGATIVE_INFINITY;
//minimum of all y of line chart points
let yMin = Number.NEGATIVE_INFINITY;

//maximum of all x of line chart points
let xMax = Number.POSITIVE_INFINITY;

/**
*
* @param x units from origin
@@ -648,7 +651,7 @@ export class LineChartBase extends React.Component<ILineChartProps, ILineChartSt
};
private _getRangeForScatterMarkerSize(containerHeight: number, containerWidth: number): number {
const extraXPixels = this._isRTL
? containerWidth - this.margins.right! - this._xAxisScale(xMin)
? containerWidth - this.margins.right! - this._xAxisScale(xMax)
: this._xAxisScale(xMin) - this.margins.left!;
const extraYPixels = containerHeight - this.margins.bottom! - this._yAxisScale(yMin);
return Math.min(extraXPixels, extraYPixels);
@@ -1656,7 +1659,7 @@ export class LineChartBase extends React.Component<ILineChartProps, ILineChartSt
return d3Min(point.data, (item: ILineChartDataPoint) => item.x as number)!;
})!;

const xMax = d3Max(points, (point: ILineChartPoints) => {
xMax = d3Max(points, (point: ILineChartPoints) => {
return d3Max(point.data, (item: ILineChartDataPoint) => {
return item.x as number;
});