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

[Feature] Allow tooltips text to be customised #217

Open
accforgithubtest opened this issue Feb 7, 2024 · 4 comments
Open

[Feature] Allow tooltips text to be customised #217

accforgithubtest opened this issue Feb 7, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@accforgithubtest
Copy link

With all the charts in sqlpage, the tooltips seem to be only auto-generated.

It would be nice if the tooltips can be customized, allowing users to add extra data / context to the tooltip, (using data from columns or other static text) that are not necessarily required for the chart, but is extra info that can be passed on to a user via tooltips.

@accforgithubtest accforgithubtest added the enhancement New feature or request label Feb 7, 2024
@DSMejantel
Copy link

DSMejantel commented Feb 7, 2024

Hi, it's possible to add some informations like this :

select 
    SUBSTR(aesh.aesh_firstname, 1, 1) ||'. '|| aesh_name as label,
    SUBSTR(eleve.prenom, 1, 1) ||'. '||eleve.nom||' ('||eleve.classe||')' as series,
    sum(suivi.temps/mut)        as value
        FROM suivi JOIN...

Capture-20240207072712-379x276

@accforgithubtest
Copy link
Author

accforgithubtest commented Feb 7, 2024

Hi @DSMejantel , thanks for your response.

In this example is the x-axis the same as the label ?
According to the docs, looks like label is just an alias for x.

So when I tried to add a .... as label to a chart that already had a timeseries for x, it broke the chart.
I think it means a chart cannot have different values for x and label at the same time. label is just an alias for x.

Pls let me know if I am missing something.

@DSMejantel
Copy link

You're right. If we have 'something as x', we can't ask for 'anotherthing as label'.
What I propose with my example, you can concate differents rows in the label with || in relation with the context of the data
like here with firstname and name :
SUBSTR(aesh.aesh_firstname, 1, 1) ||'. '|| aesh_name as label

@accforgithubtest
Copy link
Author

Thanks for the reply @DSMejantel. I am on the same page with you about this now.

The feature request is to allow for values that are not the same as the x or y to be passed to the tooltip.
For example x is a time series, y is a dollar amount. Tooltip can provide other extra info (other than the dollar amount / predefined x-axis).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants