-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(xy): apply the data value formatter to data values over bars (#1419
- Loading branch information
Showing
82 changed files
with
90 additions
and
31 deletions.
There are no files selected for viewing
Binary file added
BIN
+11.5 KB
...al-tests-for-all-stories-bar-chart-data-value-visually-looks-correct-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.7 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.7 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.6 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.3 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.5 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.3 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.3 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.3 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.7 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.7 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.7 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.3 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.31 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.36 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.35 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.34 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.4 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.51 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.51 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.49 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.35 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.4 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.4 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.38 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.42 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.43 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.54 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.54 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+9.59 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Oops, something went wrong.
Binary file removed
BIN
-27.6 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-27.7 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-27.6 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.2 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.9 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.1 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.3 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.9 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.3 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.8 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.5 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.7 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.2 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.2 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.2 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-27.2 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-27.4 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-27.4 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.2 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.8 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.8 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.7 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.7 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.8 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.4 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.5 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.1 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30.1 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.9 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-30 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.9 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.8 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.8 KB
...rizontal-alignment-center-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.8 KB
...horizontal-alignment-left-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
Binary file removed
BIN
-29.6 KB
...orizontal-alignment-right-place-the-value-labels-on-the-correct-area-1-snap.png
Diff not rendered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { select } from '@storybook/addon-knobs'; | ||
import React from 'react'; | ||
|
||
import { Axis, BarSeries, Chart, ScaleType, Settings, PartialTheme } from '@elastic/charts'; | ||
|
||
import { BARCHART_1Y0G_LINEAR } from '../../../packages/charts/src/utils/data_samples/test_dataset'; | ||
import { useBaseTheme } from '../../use_base_theme'; | ||
import { getChartRotationKnob } from '../utils/knobs'; | ||
|
||
export const Example = () => { | ||
const theme: PartialTheme = { | ||
barSeriesStyle: { | ||
displayValue: { | ||
fontSize: 15, | ||
fill: { textBorder: 2.5, color: 'white', borderColor: 'black' }, | ||
alignment: { | ||
horizontal: select( | ||
'Horizontal alignment', | ||
{ | ||
Default: undefined, | ||
Left: 'left', | ||
Center: 'center', | ||
Right: 'right', | ||
}, | ||
undefined, | ||
), | ||
vertical: select( | ||
'Vertical alignment', | ||
{ | ||
Default: undefined, | ||
Top: 'top', | ||
Middle: 'middle', | ||
Bottom: 'bottom', | ||
}, | ||
undefined, | ||
), | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
return ( | ||
<Chart> | ||
<Settings theme={theme} baseTheme={useBaseTheme()} rotation={getChartRotationKnob()} /> | ||
<BarSeries | ||
id="bars" | ||
data={BARCHART_1Y0G_LINEAR} | ||
yAccessors={['y']} | ||
xScaleType={ScaleType.Linear} | ||
displayValueSettings={{ showValueLabel: true }} | ||
/> | ||
<Axis id="bottom-axis" position="bottom" tickFormat={(d) => `${d} H`} /> | ||
<Axis id="left-axis" position="left" tickFormat={(d) => `${d} V`} /> | ||
</Chart> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters