add tooltip

This commit is contained in:
MuslemRahimi 2024-08-09 21:41:43 +02:00
parent c9d796ca69
commit f193771b63
9 changed files with 39 additions and 25 deletions

View File

@ -6,12 +6,12 @@
import { init, use } from 'echarts/core'
import { LineChart } from 'echarts/charts'
import { GridComponent } from 'echarts/components'
import { GridComponent, TooltipComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
export let data;
use([LineChart, GridComponent, CanvasRenderer])
use([LineChart, GridComponent, TooltipComponent, CanvasRenderer])
let isLoaded = false;

View File

@ -6,9 +6,9 @@ import { Chart } from 'svelte-echarts'
import { abbreviateNumber } from "$lib/utils";
import { init, use } from 'echarts/core'
import { BarChart } from 'echarts/charts'
import { GridComponent } from 'echarts/components'
import { GridComponent, TooltipComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
use([BarChart, GridComponent, CanvasRenderer])
use([BarChart, GridComponent, TooltipComponent, CanvasRenderer])
export let data;
@ -52,6 +52,11 @@ function getPlotOptions() {
const option = {
silent: true,
animation: false,
tooltip: {
trigger: 'axis',
hideDelay: 100, // Set the delay in milliseconds
},
grid: {
left: $screenWidth < 640 ? '0%' : '2%',
right: $screenWidth < 640 ? '5%' : '2%',

View File

@ -5,10 +5,10 @@
import { abbreviateNumber, formatDateRange } from "$lib/utils";
import { init, use } from 'echarts/core'
import { LineChart } from 'echarts/charts'
import { GridComponent } from 'echarts/components'
import { GridComponent, TooltipComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
use([LineChart, GridComponent, CanvasRenderer])
use([LineChart, GridComponent, TooltipComponent, CanvasRenderer])
export let data;
@ -97,12 +97,6 @@ function getPlotOptions() {
tooltip: {
trigger: 'axis',
hideDelay: 100, // Set the delay in milliseconds
backgroundColor: '#202327',
axisPointer: {
lineStyle: {
color: ''
},
},
},
animation: false,
grid: {

View File

@ -5,13 +5,13 @@
import { Chart } from 'svelte-echarts';
import { init, use } from 'echarts/core'
import { BarChart } from 'echarts/charts'
import { GridComponent } from 'echarts/components'
import { GridComponent, TooltipComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
export let data;
// now with tree-shaking
use([BarChart, GridComponent, CanvasRenderer])
use([BarChart, GridComponent, TooltipComponent, CanvasRenderer])
let isLoaded = false;
@ -37,7 +37,6 @@ function normalizer(value) {
function getPlotOptions() {
let dates = [];
let enterpriseValue = [];
let numberOfShares = [];
let marketCapitalization = [];
let addTotalDebt = [];
let cashEquivalent = [];
@ -61,6 +60,10 @@ function getPlotOptions() {
const option = {
silent: true,
animation: false,
tooltip: {
trigger: 'axis',
hideDelay: 100, // Set the delay in milliseconds
},
grid: {
left: $screenWidth < 640 ? '0%' : '2%',
right: $screenWidth < 640 ? '2%' : '2%',

View File

@ -6,12 +6,12 @@
import { init, use } from 'echarts/core'
import { LineChart } from 'echarts/charts'
import { GridComponent } from 'echarts/components'
import { GridComponent, TooltipComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
export let data;
use([LineChart, GridComponent, CanvasRenderer])
use([LineChart, GridComponent, TooltipComponent, CanvasRenderer])
let isLoaded = false;

View File

@ -6,10 +6,10 @@
import { init, use } from 'echarts/core'
import { LineChart } from 'echarts/charts'
import { GridComponent } from 'echarts/components'
import { GridComponent, TooltipComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
use([LineChart, GridComponent, CanvasRenderer])
use([LineChart, GridComponent, TooltipComponent, CanvasRenderer])
export let data;
@ -76,6 +76,10 @@ function getPlotOptions() {
const option = {
silent: true,
animation: false,
tooltip: {
trigger: 'axis',
hideDelay: 100, // Set the delay in milliseconds
},
grid: {
left: '2%',
right: '2%',

View File

@ -7,10 +7,10 @@
import { init, use } from 'echarts/core'
import { LineChart } from 'echarts/charts'
import { GridComponent } from 'echarts/components'
import { GridComponent, TooltipComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
use([LineChart, GridComponent, CanvasRenderer])
use([LineChart, GridComponent, TooltipComponent, CanvasRenderer])
export let data;

View File

@ -6,10 +6,10 @@
import { abbreviateNumber, formatDateRange } from "$lib/utils";
import { init, use } from 'echarts/core'
import { LineChart, BarChart } from 'echarts/charts'
import { GridComponent } from 'echarts/components'
import { GridComponent, TooltipComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
use([LineChart, BarChart, GridComponent, CanvasRenderer])
use([LineChart, BarChart, GridComponent, TooltipComponent, CanvasRenderer])
export let data;
@ -101,6 +101,10 @@ function getPlotOptions() {
const option = {
silent: true,
animation: false,
tooltip: {
trigger: 'axis',
hideDelay: 100, // Set the delay in milliseconds
},
grid: {
left: '0%',
right: '0%',

View File

@ -9,9 +9,9 @@ import { abbreviateNumber } from "$lib/utils";
import { init, use } from 'echarts/core'
import { BarChart } from 'echarts/charts'
import { GridComponent } from 'echarts/components'
import { GridComponent, TooltipComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
use([BarChart, GridComponent, CanvasRenderer])
use([BarChart, GridComponent, TooltipComponent, CanvasRenderer])
export let data;
@ -58,6 +58,10 @@ function getPlotOptions() {
const option = {
silent: true,
animation: false,
tooltip: {
trigger: 'axis',
hideDelay: 100, // Set the delay in milliseconds
},
grid: {
left: $screenWidth < 640 ? '1%' : '2%',
right: $screenWidth < 640 ? '0%' : '2%',