Click here to Skip to main content
15,666,183 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I am using the below code to display a google piechart in my php page. it is just to display the open tasks from the database, no interaction is there with the piechart.
After displaying the chart, on mouseover the piechart hyperlinks to a page that i developed. Please advise

<pre> <script type="text/javascript">
      google.charts.load('current', {'packages':['corechart']});

      function drawChart1() {

        var data = google.visualization.arrayToDataTable([
          ['Task', 'Open / Closed'],
		  ['My Assigned Tasks Closed', <?php echo $my_assigned_task_closed_before_due_date; ?>],
          ['My Assigned Overdue Tasks',  <?php echo $my_assigned_overdue_tasks_count; ?>],

        var options = {
          title: '% of My Assigned tasks closed before due date',
			is3D: true,

        var chart = new google.visualization.PieChart(document.getElementById('piechart1'));

        chart.draw(data, options);

What I have tried:

I tried all the possible changes
Updated 28-Nov-20 23:55pm

1 solution

Their documentation looks good enough explaining all features: Visualization: Pie Chart  |  Charts  |  Google Developers[^]

You describe url on mouseover - it would be called tooltip in their documentation: Tooltips  |  Charts  |  Google Developers[^]

There are examples like:
- building an HTML tooltip customized[^]
- tooltips with some action[^]:

Try out!
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900