а

DHTMLX pie chart with DHTMLX pop up as tool tip


#1

We wanted to show DHTMLX Pop up as tooltip on a pie chart. Is it possible? Would you have a sample code on how to do it?

I tried following code:
dhtmlxChart.attachEvent(“onMousemove”, function (id, ev, trg)
{
myPop = new dhtmlXPopup();
myPop.hide();
myPop.attachHTML(“hello”);
myPop.show();
});

Pie chart doesn’t throw any error, but doesn’t show pop up box also.

Please Advise.


#2

I was hoping to get something like the attached sample. Attached chart is a google chart and if you mouse over the slices the individual pie slice gets highlighted nicely.
pie-chart.zip (576 Bytes)


#3

#4

In case of using the popup standlone. You need to define the positions of your showing popUp.
f.ex.: myPop.show(20,20,400,300); //params are: x, y, width, height
Here you can find a tutorial:
docs.dhtmlx.com/popup__initiali … standalone


#5

Thanks Sematik it worked, i was missing the positions… Would you have a sample of using DHTMLX pop up for chart tooltips?

I tried following:
dhtmlxChart.attachEvent(“onMousemove”, function (id, ev, trg)
{
myPop = new dhtmlXPopup();
myPop.hide();
myPop.attachHTML(“hello”);
var rect = trg.getBoundingClientRect();
myPop.show(rect.left, rect.top, rect.width, rect.height);
});

dhtmlxChart.attachEvent("onMouseout", function (ev)
{
	if (myPop != null)
		myPop.hide();
});

It doesn’t look good. Have following issues:

  1. Position… Was trying to put it just outside the slice.
  2. Text: How can i get slice size or label on the pop up.

Would really appreciate one.


#6

here you can find a simple snippet:
snippet.dhtmlx.com/1f3855872


#7

Thanks a lot sematik…