mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-21 23:53:52 +00:00
feat: support chagne scatter size
This commit is contained in:
parent
aec27859a6
commit
629159c574
|
@ -3,6 +3,8 @@ import { ChartType, ChartTypeString, IndicatorConfig } from '@/types';
|
|||
|
||||
import { watchDebounced } from '@vueuse/core';
|
||||
|
||||
const DEFAULT_SCATTER_SYMBOL_SIZE = 3;
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { required: true, type: Object as () => Record<string, IndicatorConfig> },
|
||||
columns: { required: true, type: Array as () => string[] },
|
||||
|
@ -16,6 +18,7 @@ const availableGraphTypes = ref<ChartTypeString[]>(Object.keys(ChartType) as Cha
|
|||
const selAvailableIndicator = ref('');
|
||||
const cancelled = ref(false);
|
||||
const fillTo = ref('');
|
||||
const scatterSymbolSize = ref(DEFAULT_SCATTER_SYMBOL_SIZE);
|
||||
|
||||
function newColor() {
|
||||
selColor.value = randomColor();
|
||||
|
@ -32,6 +35,9 @@ const combinedIndicator = computed<IndicatorConfig>(() => {
|
|||
if (fillTo.value && graphType.value === ChartType.line) {
|
||||
val.fill_to = fillTo.value;
|
||||
}
|
||||
if (graphType.value == ChartType.scatter) {
|
||||
val.scatterSymbolSize = scatterSymbolSize.value;
|
||||
}
|
||||
return {
|
||||
[selAvailableIndicator.value]: val,
|
||||
};
|
||||
|
@ -59,7 +65,7 @@ watch(
|
|||
);
|
||||
|
||||
watchDebounced(
|
||||
[selColor, graphType, fillTo],
|
||||
[selColor, graphType, fillTo, scatterSymbolSize],
|
||||
() => {
|
||||
emitIndicator();
|
||||
},
|
||||
|
@ -108,5 +114,12 @@ watchDebounced(
|
|||
class="mt-1"
|
||||
label="Area chart - Fill to (leave empty for line chart)"
|
||||
/>
|
||||
<BFormGroup
|
||||
v-if="graphType === ChartType.scatter"
|
||||
label="Scatter symbol size"
|
||||
label-class="mt-1"
|
||||
>
|
||||
<BFormSpinbutton v-model="scatterSymbolSize" />
|
||||
</BFormGroup>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -10,6 +10,7 @@ export interface IndicatorConfig {
|
|||
color?: string;
|
||||
type?: ChartType | ChartTypeString;
|
||||
fill_to?: string;
|
||||
scatterSymbolSize?: number;
|
||||
}
|
||||
|
||||
export interface PlotConfig {
|
||||
|
|
|
@ -24,6 +24,12 @@ export function generateCandleSeries(
|
|||
},
|
||||
showSymbol: false,
|
||||
};
|
||||
if (value.type === ChartType.scatter) {
|
||||
sp['symbolSize'] = value.scatterSymbolSize;
|
||||
sp['emphasis'] = {
|
||||
disabled: true,
|
||||
};
|
||||
}
|
||||
return sp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user