mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Restores default chart timezone
to 'local'
(#123265)
* fix timezone changes * fix failing checks and type errors Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
c2faea52f3
commit
7ce80f4c7f
5 changed files with 62 additions and 32 deletions
|
@ -105,7 +105,7 @@
|
|||
"@elastic/apm-rum": "^5.9.1",
|
||||
"@elastic/apm-rum-react": "^1.3.1",
|
||||
"@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace",
|
||||
"@elastic/charts": "40.1.1",
|
||||
"@elastic/charts": "40.3.0",
|
||||
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
|
||||
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.35",
|
||||
"@elastic/ems-client": "8.0.0",
|
||||
|
|
|
@ -31,30 +31,32 @@ const getPointFillColor = (points: VisSeries['points'], color: string | undefine
|
|||
);
|
||||
};
|
||||
|
||||
const getAreaSeriesStyle = ({ color, lines, points }: AreaSeriesComponentProps['visData']) =>
|
||||
({
|
||||
line: {
|
||||
opacity: isShowLines(lines, points) ? 1 : 0,
|
||||
stroke: color,
|
||||
strokeWidth: lines?.lineWidth !== undefined ? Number(lines.lineWidth) : 3,
|
||||
visible: isShowLines(lines, points),
|
||||
},
|
||||
area: {
|
||||
fill: color,
|
||||
opacity: lines?.fill ?? 0,
|
||||
visible: lines?.show ?? points?.show ?? true,
|
||||
},
|
||||
point: {
|
||||
fill: getPointFillColor(points, color),
|
||||
opacity: 1,
|
||||
radius: points?.radius ?? 3,
|
||||
stroke: color,
|
||||
strokeWidth: points?.lineWidth ?? 2,
|
||||
visible: points?.show ?? false,
|
||||
shape: points?.symbol === 'cross' ? PointShape.X : points?.symbol,
|
||||
},
|
||||
curve: lines?.steps ? CurveType.CURVE_STEP : CurveType.LINEAR,
|
||||
} as AreaSeriesStyle);
|
||||
const getAreaSeriesStyle = ({
|
||||
color,
|
||||
lines,
|
||||
points,
|
||||
}: AreaSeriesComponentProps['visData']): Partial<AreaSeriesStyle> => ({
|
||||
line: {
|
||||
opacity: isShowLines(lines, points) ? 1 : 0,
|
||||
stroke: color,
|
||||
strokeWidth: lines?.lineWidth !== undefined ? Number(lines.lineWidth) : 3,
|
||||
visible: isShowLines(lines, points),
|
||||
},
|
||||
area: {
|
||||
fill: color,
|
||||
opacity: lines?.fill ?? 0,
|
||||
visible: lines?.show ?? points?.show ?? true,
|
||||
},
|
||||
point: {
|
||||
fill: getPointFillColor(points, color),
|
||||
opacity: 1,
|
||||
radius: points?.radius ?? 3,
|
||||
stroke: color,
|
||||
strokeWidth: points?.lineWidth ?? 2,
|
||||
visible: points?.show ?? false,
|
||||
shape: points?.symbol === 'cross' ? PointShape.X : points?.symbol,
|
||||
},
|
||||
});
|
||||
|
||||
export const AreaSeriesComponent = ({ index, groupId, visData }: AreaSeriesComponentProps) => (
|
||||
<AreaSeries
|
||||
|
@ -69,6 +71,7 @@ export const AreaSeriesComponent = ({ index, groupId, visData }: AreaSeriesCompo
|
|||
sortIndex={index}
|
||||
color={visData.color}
|
||||
stackAccessors={visData.stack ? [0] : undefined}
|
||||
curve={visData.lines?.steps ? CurveType.CURVE_STEP : CurveType.LINEAR}
|
||||
areaSeriesStyle={getAreaSeriesStyle(visData)}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -11,10 +11,10 @@ import {
|
|||
Fit,
|
||||
FitConfig,
|
||||
LineSeriesStyle,
|
||||
RecursivePartial,
|
||||
SeriesColorAccessorFn,
|
||||
SeriesColorsArray,
|
||||
} from '@elastic/charts';
|
||||
import { DeepPartial } from 'utility-types';
|
||||
import { Maybe } from '../typings/common';
|
||||
|
||||
export interface Coordinate {
|
||||
|
@ -64,8 +64,8 @@ export interface APMChartSpec<
|
|||
y0Accessors?: Accessor;
|
||||
splitSeriesAccessors?: Accessor;
|
||||
markSizeAccessor?: string | AccessorFn;
|
||||
lineSeriesStyle?: DeepPartial<LineSeriesStyle>;
|
||||
areaSeriesStyle?: DeepPartial<AreaSeriesStyle>;
|
||||
lineSeriesStyle?: RecursivePartial<LineSeriesStyle>;
|
||||
areaSeriesStyle?: RecursivePartial<AreaSeriesStyle>;
|
||||
groupId?: string;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,22 @@ exports[`DonutChart component passes correct props without errors for valid prop
|
|||
"opacity": 0.3,
|
||||
"visible": true,
|
||||
},
|
||||
"fit": Object {
|
||||
"area": Object {
|
||||
"fill": "__use__series__color__",
|
||||
"opacity": 0.15,
|
||||
"visible": true,
|
||||
},
|
||||
"line": Object {
|
||||
"dash": Array [
|
||||
5,
|
||||
5,
|
||||
],
|
||||
"opacity": 1,
|
||||
"stroke": "__use__series__color__",
|
||||
"visible": true,
|
||||
},
|
||||
},
|
||||
"line": Object {
|
||||
"opacity": 1,
|
||||
"strokeWidth": 1,
|
||||
|
@ -260,6 +276,17 @@ exports[`DonutChart component passes correct props without errors for valid prop
|
|||
"verticalWidth": 200,
|
||||
},
|
||||
"lineSeriesStyle": Object {
|
||||
"fit": Object {
|
||||
"line": Object {
|
||||
"dash": Array [
|
||||
5,
|
||||
5,
|
||||
],
|
||||
"opacity": 1,
|
||||
"stroke": "__use__series__color__",
|
||||
"visible": true,
|
||||
},
|
||||
},
|
||||
"line": Object {
|
||||
"opacity": 1,
|
||||
"strokeWidth": 1,
|
||||
|
|
|
@ -1567,10 +1567,10 @@
|
|||
dependencies:
|
||||
object-hash "^1.3.0"
|
||||
|
||||
"@elastic/charts@40.1.1":
|
||||
version "40.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-40.1.1.tgz#9bcc480b4179f7b10a9a28571a5393f92fa49880"
|
||||
integrity sha512-+rQkGYpXkkG05NbWwpI75VZ4SAydtg+7RA5bAO3AWUAYFEOxqEjbleTONCT/blvXFSlrgg9RETxBH4pGlfWgig==
|
||||
"@elastic/charts@40.3.0":
|
||||
version "40.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-40.3.0.tgz#f7e8fb0e7770251484807b33dae01e36ff336b89"
|
||||
integrity sha512-ZY5PQiwmsMaJo2u9h7XbrGcuV8A3yO7pdgbSne8nICIaOfEz3qpH6JjGXxOXerb0els/Y9nTyYh/i1mQd8S/dA==
|
||||
dependencies:
|
||||
"@popperjs/core" "^2.4.0"
|
||||
chroma-js "^2.1.0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue