1

Я использую библиотеку для построения графика введите сюда описание ссылки При наведении на ось графика я получаю белый цвет таблицы, т.к. я изменил цвет background самой страницы. Как мне поменять цвет этой всплывающей таблицы ? Никак не могу найти нужную настройку..

<template>
  <div>
    <div id="chart">
      <h2 class="text-lg text-center font-semibold" v-if="title">
        {{ title }}
      </h2>

      <apexchart
        type="line"
        height="350"
        :options="chartOptions"
        :series="series"
        ref="chart"
      ></apexchart>
    </div>
  </div>
</template>

<script>
import VueApexCharts from "vue3-apexcharts";
export default {
  components: {
    apexchart: VueApexCharts,
  },
  props: {
    dataset: {
      type: Object,
      default: () => {},
    },
    title: {
      type: String,
      default: "",
    },
  },

  data() {
    return {
      series: [],
      chartOptions: {
        xaxis: {
          type: "numeric",
          labels: {
            rotate: 0,
          },
        },

        colors: ["#a4a82c", "#c416b9"],
        /*         theme: {
          palette: "palette7",
        }, */
        tickAmount: "dataPoints",
        grid: {
          show: true,
          borderColor: "#2a2c3d",
          strokeDashArray: 0,

          fill: {
            type: "gradient",
          },
          position: "back",

          xaxis: {
            lines: {
              show: true,
            },
          },
          yaxis: {
            lines: {
              show: true,
            },
          },
          row: {
            colors: undefined,
            opacity: 0.5,
          },
          column: {
            colors: undefined,
            opacity: 0.5,
          },
          padding: {
            top: 0,
            right: 0,
            bottom: 0,
            left: 10,
          },
        },
      },
    };
  },

  watch: {
    title(val) {
      console.log("val", val);
    },

    dataset: {
      handler: function(newValue, oldValue) {
        console.log("newValue-dataset", newValue);
        console.log("oldValue", oldValue);
        if (newValue && newValue["x"]) {
          let series = [
            {
              name: "First Y Data 1 - portfolio pnl",

              data: this.dataset["y_portf"].map((item, index) => {
                return {
                  x: this.dataset["x"][index],
                  y: item.toFixed(2),
                };
              }),
            },
            {
              name: "First Y Data 2 - structure pnl",
              data: this.dataset["y_struct"].map((item, index) => {
                return {
                  x: this.dataset["x"][index],
                  y: item.toFixed(2),
                };
              }),
            },
          ];

          this.series = series;
        }
      },
      deep: true,
      immediate: true,
    },
  },
  mounted() {
    this.$nextTick(() => {
      this.$refs.chart.hideSeries("First Y Data 1 - portfolio pnl");
      console.log("this.$refs.chart", this.$refs.chart);
    });
  },
};
</script>

<style lang="scss" scoped></style>

1 ответ 1

1

Я так понимаю речь о tooltip когда наводитесь на график? Если так тогда советую залезть в документацию по apexCharts tooltips там есть поле где вы можете задать кастомные стили

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.