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
Sugan G
authored and
Sugan G
committed
Mar 28, 2024
1 parent
1b73127
commit 2635971
Showing
9 changed files
with
79 additions
and
1 deletion.
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
Binary file added
BIN
+27.7 KB
...large/general-spec/x-axis_timeseries_allowcalibration_enabled_ticks_rotated.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
+22.1 KB
...edium/general-spec/x-axis_timeseries_allowcalibration_enabled_ticks_rotated.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
+19 KB
..._tiny/general-spec/x-axis_timeseries_allowcalibration_enabled_ticks_rotated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
33 changes: 33 additions & 0 deletions
33
...le-datasets/graphConfigObjects/General/timeseriesConfigXCalibrationEnabledTicksRotated.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,33 @@ | ||
import Carbon from '@cerner/carbon-graphs/lib/js/carbon'; | ||
|
||
const getConfig = (id) => ({ | ||
bindTo: id, | ||
axis: { | ||
x: { | ||
type: Carbon.helpers.AXIS_TYPE.TIME_SERIES, | ||
label: 'Datetime', | ||
lowerLimit: new Date(2016, 0, 1, 9, 0).toISOString(), | ||
upperLimit: new Date(2016, 0, 1, 15, 59).toISOString(), | ||
allowCalibration: true, | ||
ticks: { tickLabelsRotation: -45 }, | ||
}, | ||
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, | ||
}); | ||
|
||
export default getConfig; |
29 changes: 29 additions & 0 deletions
29
...site/test/graphs/General/Axes/AllowCalibrationEnabledTimeseriesXAxisTicksRotated.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,29 @@ | ||
import React from 'react'; | ||
import Carbon from '@cerner/carbon-graphs/lib/js/carbon'; | ||
import utils from '@cerner/carbon-graphs/lib/js/helpers/utils'; | ||
import '@cerner/terra-graphs-docs/lib/terra-graphs-src/components/Graph.module.scss'; | ||
import '@cerner/terra-graphs-docs/lib/terra-graphs-src/components/Line/LineGraph.module.scss'; | ||
import ExampleGraphContainer from '@cerner/terra-graphs-docs/lib/terra-dev-site/ExampleGraphContainer/ExampleGraphContainer'; | ||
import getConfig from '@cerner/terra-graphs-docs/lib/example-datasets/graphConfigObjects/General/timeseriesConfigXCalibrationEnabledTicksRotated'; | ||
import exampleData from '@cerner/terra-graphs-docs/lib/example-datasets/dataObjects/Line/datasetTimeseries1'; | ||
|
||
/* | ||
Please refer to the documentation below to see the graphConfig and data objects | ||
*/ | ||
|
||
const graphConfig = utils.deepClone(getConfig('#allowCalibrationXTimeseriesTicksRotated')); | ||
const dataset = utils.deepClone(exampleData); | ||
|
||
const AllowCalibrationExample = () => { | ||
React.useEffect(() => { | ||
const graph = Carbon.api.graph(graphConfig); | ||
graph.loadContent(Carbon.api.line(dataset)); | ||
}, []); | ||
|
||
return ( | ||
<ExampleGraphContainer id="allowCalibrationXTimeseriesTicksRotated" /> | ||
); | ||
}; | ||
|
||
export default AllowCalibrationExample; | ||
|