mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-26 13:05:15 +00:00
Show all lines in legend
This commit is contained in:
parent
e41b23e02f
commit
6e497f1214
|
@ -9,6 +9,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { timestampms } from '@/shared/formatters';
|
import { timestampms } from '@/shared/formatters';
|
||||||
import ECharts from 'vue-echarts';
|
import ECharts from 'vue-echarts';
|
||||||
|
import randomColor from '../../shared/randomColor';
|
||||||
import 'echarts';
|
import 'echarts';
|
||||||
|
|
||||||
const MARGINLEFT = '5%';
|
const MARGINLEFT = '5%';
|
||||||
|
@ -103,7 +104,6 @@ export default {
|
||||||
if ('subplots' in this.plotConfig) {
|
if ('subplots' in this.plotConfig) {
|
||||||
let plotIndex = 2;
|
let plotIndex = 2;
|
||||||
Object.entries(this.plotConfig.subplots).forEach(([key, value]) => {
|
Object.entries(this.plotConfig.subplots).forEach(([key, value]) => {
|
||||||
subPlots.legend.push(key);
|
|
||||||
// define yaxis
|
// define yaxis
|
||||||
subPlots.yaxis.push({
|
subPlots.yaxis.push({
|
||||||
scale: true,
|
scale: true,
|
||||||
|
@ -134,16 +134,17 @@ export default {
|
||||||
height: '8%',
|
height: '8%',
|
||||||
});
|
});
|
||||||
Object.entries(value).forEach(([sk, sv]) => {
|
Object.entries(value).forEach(([sk, sv]) => {
|
||||||
|
subPlots.legend.push(sk);
|
||||||
// entries per subplot
|
// entries per subplot
|
||||||
const col = this.dataset.columns.findIndex((el) => el === sk);
|
const col = this.dataset.columns.findIndex((el) => el === sk);
|
||||||
if (col) {
|
if (col) {
|
||||||
const sp = {
|
const sp = {
|
||||||
name: key,
|
name: sk,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
xAxisIndex: plotIndex,
|
xAxisIndex: plotIndex,
|
||||||
yAxisIndex: plotIndex,
|
yAxisIndex: plotIndex,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: sv.color,
|
color: sv.color || randomColor(),
|
||||||
},
|
},
|
||||||
encode: {
|
encode: {
|
||||||
x: colDate,
|
x: colDate,
|
||||||
|
|
4
src/shared/randomColor.ts
Normal file
4
src/shared/randomColor.ts
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
export default function () {
|
||||||
|
// eslint-disable-next-line no-bitwise
|
||||||
|
return `#${((Math.random() * 0xffffff) << 0).toString(16)}`;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user