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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...