@@ -23,6 +23,7 @@ import { useChartStore } from '@/stores/chartStore';
2323import { computed , watch } from ' vue' ;
2424import { useGradientColorMapStore } from ' @/stores/gradientColorMapStore' ;
2525import { useGlobalChartStore } from ' @/stores/globalChartStore' ;
26+ import { useActiveTabStore } from ' @/stores/activeTabStore' ;
2627
2728// Props definition
2829const props = withDefaults (
@@ -41,32 +42,47 @@ const props = withDefaults(
4142const chartStore = useChartStore ();
4243const globalChartStore = useGlobalChartStore ();
4344const gradientColorMapStore = useGradientColorMapStore (props .reqIdStr );
44-
45+ const activeTabStore = useActiveTabStore ();
4546const computedDisplayGradient = computed (() => {
4647 return ( chartStore .getMinValue (props .reqIdStr , props .data_key ) !== null && chartStore .getMaxValue (props .reqIdStr , props .data_key ) !== null );
4748});
4849
50+ const isTimeSeries = computed (() => {
51+ if (activeTabStore .activeTabLabel === ' Time Series' ){
52+ return true ;
53+ } else {
54+ return false ;
55+ }
56+ });
4957
5058const useSelectedMinMax = computed (() => {
5159 return chartStore .stateByReqId [props .reqIdStr ]?.useSelectedMinMax ;
5260});
5361
5462const minValue = computed (() => {
5563 let min;
56- if (useSelectedMinMax .value ){
57- min = chartStore .getLow (props .reqIdStr , props .data_key );
58- } else {
59- min = globalChartStore .getLow (props .data_key );
64+ if (isTimeSeries ){
65+ min = chartStore .getMinValue (props .reqIdStr , props .data_key );
66+ } else {
67+ if (useSelectedMinMax .value ){
68+ min = chartStore .getLow (props .reqIdStr , props .data_key );
69+ } else {
70+ min = globalChartStore .getLow (props .data_key );
71+ }
6072 }
6173 return (min !== null && min !== undefined ) ? parseFloat (min .toFixed (1 )) : ' ?' ;
6274});
6375
6476const maxValue = computed (() => {
6577 let max;
66- if (useSelectedMinMax . value ){
67- max = chartStore .getHigh (props .reqIdStr , props .data_key );
78+ if (isTimeSeries ){
79+ max = chartStore .getMaxValue (props .reqIdStr , props .data_key );
6880 } else {
69- max = globalChartStore .getHigh (props .data_key );
81+ if (useSelectedMinMax .value ){
82+ max = chartStore .getHigh (props .reqIdStr , props .data_key );
83+ } else {
84+ max = globalChartStore .getHigh (props .data_key );
85+ }
7086 }
7187 return (max !== null && max !== undefined ) ? parseFloat (max .toFixed (1 )) : ' ?' ;
7288});
0 commit comments