Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip integration on regression lines #37

Closed
dvago opened this issue Jun 15, 2021 · 1 comment
Closed

Tooltip integration on regression lines #37

dvago opened this issue Jun 15, 2021 · 1 comment

Comments

@dvago
Copy link

dvago commented Jun 15, 2021

Hi there,

I'm currently looking into displaying a tooltip showing the regression calculation when the user goes on hover the regression line.

As far as I can tell there is no way to achieve it.

given a series of objects such as:

series: [
    {
     type: 'scatter',
     xAxisIndex: 0,
     yAxisIndex: 0, 
     emphasis: {
        focus: 'series',
      },
     data: [
        {
         name: 'point',
         value: [
            0.69,
            97.843, '...'
          ]
        }
      ]
    },
    {
     type: 'scatter',
     xAxisIndex: 0,
     yAxisIndex: 0,
     emphasis: {
        focus: 'series',
      },
     data: [
        {
         name: 'point',
         value: [
            0.89,
            107.343, '...'
          ]
        }
      ]
    },
    {
     name: 'Regression',
     type: 'line',
     datasetIndex: 1,
     symbolSize: 0,
    }
]

The tooltip works for the datasetIndex: 0 which is the list of dots but doesn't show for the index 1

tooltip parameter is set at the root of the configuration as:

tooltip: {
    trigger: 'item'
}

Looking forward to find a solution
Thanks in advance.

@dvago
Copy link
Author

dvago commented Jun 16, 2021

Further investigation seems to drive this issue into the main Echarts library, as far I can tell the tooltip triggers on hover of a data point only rather than on hovering the entire regression line.

The regression lines seem to have the last point as single way to trigger the tooltip therefore if the symbolSize is equal to 0 no datapoint are visible so no tooltip gets generated.

It's not ideal but I believe it's not even your fault.

@dvago dvago closed this as completed Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant