Jump to content

Tooltip on chart


nandrianakis

Recommended Posts

@Serzod,

Hello  Serzod;

it works very well tooltip on the barchart  with this code work very well

series 0

function chart.beforeInit(sender, config)
{
   config.series[0].tooltip = 
  {
        trackMouse: true,
        width: 400,
        renderer: function(tip, item) 
        {
            tip.setTitle(item.get('LL'));
            tip.update('DİF: ' + item.get('A'));
        }
  }

}

and for serie 1

function chart.beforeInit(sender, config)
{
   config.series[1].tooltip = 
  {
        trackMouse: true,
        width: 400,
        renderer: function(tip, item) 
        {
            tip.setTitle(item.get('LL'));
            tip.update('DİF: ' + item.get('B'));
        }
  }

}

But how i can use this code for 2 series

i mean, i want to show value tooltip when i mouse, for 2 series

 

i.e. I want to see data from two series at the same time.
but I can show the series one by one.

Is it possible to show values for 2 series at same time ?

Best Regards,

2021-11-17_03-15-53.thumb.png.9fc82b28c10f76bc4a35d14c2c417a65.png

 

Link to comment
Share on other sites

4 hours ago, loQsoft said:

Is it possible to show values for 2 series at same time ?

Maybe you want something like this?

function chart.beforeInit(sender, config) 
{
    config.series[0].tooltip = {
        trackMouse: true,
        width: 400,
        renderer: function(tip, item) {
            tip.setTitle(item.get('LL'));
            tip.update('DİF: ' + item.get('A') + ', ' + item.get('B'));
        }
    };
}

 

  • Thanks 1
Link to comment
Share on other sites

5 hours ago, Sherzod said:

Maybe you want something like this?

function chart.beforeInit(sender, config) 
{
    config.series[0].tooltip = {
        trackMouse: true,
        width: 400,
        renderer: function(tip, item) {
            tip.setTitle(item.get('LL'));
            tip.update('DİF: ' + item.get('A') + ', ' + item.get('B'));
        }
    };
}

 

Yes Exactly,

and Thank you very much @Serzod

 

Best Regards,

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
4 minutes ago, Sherzod said:

 

Test this solution, but not found

function chart.beforeInit(sender, config)
{
    config.series[0].tooltip = {
        trackMouse: true,
        width: 120,
        renderer: function(tip, item) {
            tip.setTitle(item.get('LL'));
            tip.update('Значение: ' + item.get('A'));
        }
    }
    
   config.series[1].tooltip = {
        trackMouse: true,
        width: 120,
        renderer: function(tip, item) {
            tip.setTitle(item.get('LL'));
            tip.update('Значение: ' + item.get('B'));
        }
    }  
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...