This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
UM100080
authored and
UM100080
committed
Nov 6, 2023
1 parent
722464a
commit ade981b
Showing
6 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
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
49 changes: 49 additions & 0 deletions
49
...hs-docs/src/example-datasets/graphConfigObjects/General/generalDefaultXAxisOverlapping.js
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,49 @@ | ||
import Carbon from '@cerner/carbon-graphs/lib/js/carbon'; | ||
|
||
const getLineTimeseriesConfig = (id) => ({ | ||
bindTo: id, | ||
rotateAngle: true, | ||
axis: { | ||
x: { | ||
type: Carbon.helpers.AXIS_TYPE.TIME_SERIES, | ||
label: 'Datetime', | ||
lowerLimit: new Date(2016, 0, 1).toISOString(), | ||
upperLimit: new Date(2016, 0, 12).toISOString(), | ||
ticks: { | ||
values: [ | ||
new Date(2016, 0, 1).toISOString(), | ||
new Date(2016, 0, 2).toISOString(), | ||
new Date(2016, 0, 3).toISOString(), | ||
new Date(2016, 0, 4).toISOString(), | ||
new Date(2016, 0, 5).toISOString(), | ||
new Date(2016, 0, 6).toISOString(), | ||
new Date(2016, 0, 7).toISOString(), | ||
new Date(2016, 0, 8).toISOString(), | ||
new Date(2016, 0, 9).toISOString(), | ||
new Date(2016, 0, 10).toISOString(), | ||
new Date(2016, 0, 11).toISOString(), | ||
], | ||
format: '%Y, %X', | ||
}, | ||
}, | ||
y: { | ||
label: 'Line Set A', | ||
lowerLimit: 10, | ||
upperLimit: 30, | ||
}, | ||
y2: { | ||
show: false, | ||
label: 'Line Set B', | ||
lowerLimit: 0, | ||
upperLimit: 250, | ||
}, | ||
}, | ||
showLabel: true, | ||
showLegend: true, | ||
showShapes: true, | ||
showVGrid: true, | ||
showHGrid: true, | ||
locale: Carbon.helpers.LOCALE.de_DE, | ||
}); | ||
|
||
export default getLineTimeseriesConfig; |
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
31 changes: 31 additions & 0 deletions
31
...aphs-docs/src/terra-dev-site/test/graphs/General/Axes/XAxisTickValuesOverlapping.test.jsx
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,31 @@ | ||
import React from 'react'; | ||
import utils from '@cerner/carbon-graphs/lib/js/helpers/utils'; | ||
import LineGraph from '@cerner/terra-graphs-docs/lib/terra-graphs-src/components/Line/LineGraph'; | ||
import '@cerner/terra-graphs-docs/lib/terra-dev-site/ExampleGraphContainer/ExampleGraphContainer.module.scss'; | ||
import getGraphConfig from '@cerner/terra-graphs-docs/lib/example-datasets/graphConfigObjects/General/generalDefaultXAxisOverlapping'; | ||
import exampleData1 from '@cerner/terra-graphs-docs/lib/example-datasets/dataObjects/Line/dataset1'; | ||
import exampleData2 from '@cerner/terra-graphs-docs/lib/example-datasets/dataObjects/Line/dataset2'; | ||
import exampleData3 from '@cerner/terra-graphs-docs/lib/example-datasets/dataObjects/Line/dataset3'; | ||
import exampleData4 from '@cerner/terra-graphs-docs/lib/example-datasets/dataObjects/Line/dataset4'; | ||
import exampleData5 from '@cerner/terra-graphs-docs/lib/example-datasets/dataObjects/Line/dataset5'; | ||
import exampleData6 from '@cerner/terra-graphs-docs/lib/example-datasets/dataObjects/Line/dataset6'; | ||
|
||
const graphConfig = utils.deepClone(getGraphConfig('#xAxisTicksVlauesOverlapping')); | ||
const dataset = [ | ||
utils.deepClone(exampleData1), | ||
utils.deepClone(exampleData2), | ||
utils.deepClone(exampleData3), | ||
utils.deepClone(exampleData4), | ||
utils.deepClone(exampleData5), | ||
utils.deepClone(exampleData6), | ||
]; | ||
|
||
const timeoutArray = [0, 750, 750 * 2, 750 * 3, 750 * 4, 750 * 5, 750 * 6]; | ||
|
||
export default () => ( | ||
<> | ||
<div id="tooltip" className="initial-tooltip" /> | ||
<LineGraph graphID="xAxisTicksVlauesOverlapping" graphConfig={graphConfig} dataset={dataset} timeout={timeoutArray} /> | ||
; | ||
</> | ||
); |