Change the tooltip of Chart Widget

2629
2
Jump to solution
06-14-2016 04:07 PM
MichaelTootoo
New Contributor

I would like to : 1. remove the Pie chart black label text  as picture 1 (e.g., Populaiton_Other);  2. Change the popup tooltiop text color to white -- current it is green (see picture 2). Any hints how to do it? Thank you!

Picture 1

PieChart1.png

Picture 2

PieChart2.png

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Michael,

As you have probably figured out the things you are wanting to change are not configurable as they are hard coded into the widget files.

For the tooltip font color open the Preview.js in the Chart widgets folder and find line 1525, 1662, 1735, 1847,  2050, 2143, 2237, 2338, 2524, 2605, 2685 & 2771 (assuming wab ver 2.0) and you will find this line:

tooltip: "<div style='color:green;margin:5px 10px;'>" + (change as desired)

For the tooltip background color you need to modify the preview.css to add a rule that overwrites the dojo-override.css

.claro .dijitTooltipContainer {

   background-color: #fff !important;

   opacity: 0.9 !important;

   border: 1px solid #000 !important;

}

So far I have not been able to find a way to remove the labels from the chart.

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Michael,

As you have probably figured out the things you are wanting to change are not configurable as they are hard coded into the widget files.

For the tooltip font color open the Preview.js in the Chart widgets folder and find line 1525, 1662, 1735, 1847,  2050, 2143, 2237, 2338, 2524, 2605, 2685 & 2771 (assuming wab ver 2.0) and you will find this line:

tooltip: "<div style='color:green;margin:5px 10px;'>" + (change as desired)

For the tooltip background color you need to modify the preview.css to add a rule that overwrites the dojo-override.css

.claro .dijitTooltipContainer {

   background-color: #fff !important;

   opacity: 0.9 !important;

   border: 1px solid #000 !important;

}

So far I have not been able to find a way to remove the labels from the chart.

MichaelTootoo
New Contributor

Very helpful.Thanks!

0 Kudos