Chartjs - button in legend to toggle all datasets show/hide - chart.js

Is there way to toggle display/hide all datasets in a chart at once?
I'm working on a chart that will have about 30 datasets so that different sets of data can be easily compared... but it's a hassle to deselect 28 in order to just see two. Or to go from 2 to then select 25 to view.
I'd like to find some way to show all/hide all... I wonder if creating the legend via a callback would be required... and if so, how to do it (I haven't yet figured out how to use callbacks).
Any ideas?
Thanks,
Scott

Related

How deselect a radio button on select of another in power bi?

I have used chiclet slicer to achieve radio button,
In my case from 3 measures I have taken 3 chiclet slicers, While clicking on a single radio button it is working fine, but on selecting another how to deselect the other two radio buttons.
I have data in 3 different measures "daily", "weekly" and "monthly".
My requirement is on the select of any those rest two options should be deselected, which is the default behavior of the radio button.
Or you can suggest me if there is any other way to implement the radio button.
I've always achieved this using the standard slicer and a hidden table with the needed labels and/or values.
Create a table by using "Enter data" or by using DAX, and put in it your 3 labels "Daily","Weekly","Monthly", I will call the table "MyTable" and the column "SwitchLabel"
Create a slicer with field "SwitchLabel", in the selection control enable "single select". (you can change the orientation in the "general" section).
Create a switch measure like the one below:
SalesSwitch = SWITCH( SELECTEDVALUE('MyTable'[SwitchLabel])
,"Weekly", [WeeklySalesmeasure]
,"Daily", [DailySalesmeasure]
,[DefaultMeasure] --optional "else", if nothing matches or there are multiple selections
)
Put the "SalesSwitch" measure in the charts.
The slicer/filter on the "switch" table must be present on every page that uses the measures, otherwise (without filter), it will always fall in the default case.
One limit of this solution is that it cannot change the X axis, in fact you are just calling different measures based on the selection.
If you need to also change the X-axis use Seymour's method with buttons and bookmarks.
There are many ways to implement the same need.
Buttons + Bookmark (built-in)
Slicer + Switch (built-in)
custom visuals in the store
In general, I prefer built-in Power BI functionalities because for enterprise production solution you do not want to rely on custom tools not officially supported by the software vendor.
Therefore, if your project is a real work then my suggestion is to use the Buttons + Bookmark built-in functionality. For your case you need:
Buttons
Bookmarks
In practice, create 3 buttons: Daily, Weekly and Monthly.
Next, create a bookmark with the default view, calling it Default.
Then, update one bookmark for each of the three view. It could simply be hiding or showing a visualization in the same page. Please note that a hidden visualization will not trigger any computation when the page is opened.
Finally, set the action of clicking the button to direct the user toward the bookmark.

Is there a "tab control" Control for PowerBi

Is there a Tab Control control in Power Bi that can be dropped onto a dashboard similar to other controls, like checkbox, list, etc. I would like the user to be able to add various inputs on each tab and then be able to plot a line on a chart based on their selections. Each tab on the Tab control would represent a separate product. An image of a tab control can be found at the link below.
Not sure if Power BI has something like that out of the box, but you could roll your own.
It looks like you want a bunch of slicers that are overlapping and come to the top when their "tab" is clicked. You can achieve this by showing/hiding slicers when a button is clicked. Conceptually:
add slicers to the report and arrange to overlap
add buttons to the report and arrange side by side
add bookmarks to the page that show the different hidden/visible states of the slicers
assign the bookmarks to the buttons
Matt Allington has a blog post about this technique. He uses just one slicer panel, so you will need to adjust it to your needs but it has everything you need to do what you describe.

Hover Over Text in PowerBI

Wondering if there's a way to make a text bubble show up when the user hovers over a metric in a Power BI report.
I have tried using alt text, but that does not show up anywhere.
I had the same problem just now, and the documentation page Create tooltips based on report pages in Power BI Desktop describes how to do this. Probably this functionality was not around in March 2018 (when the accepted answer was posted).
Steps
In summary the steps are as follows (assuming you already have a visualization):
Create a new page, name it Tooltip 1
On the Tooltip 1 page, go to Format → Page Information and switch on the Tooltip toggle
Go to Canvas settings and set the Type to Tooltip.
Create a text box via Home → Text box, fill it with the text you want to show when one hovers over your visualization.
Select your visualization
Click on Format → Tooltip
Set Type to Report page
Set Page to Tooltip 1
Now when you hover over the visualization, the text box from step 4 will be shown.
Additions
You can mark the page Tooltip 1 as hidden, such that it does not show up as a tab on your report.
You can also customize the tooltip size by setting the Page size of the tooltip page to Custom with suitable width and height values.
As described in the link, instead of text you can also create a whole visualization.
Currently, I don't think this is possible natively.
There are some ideas related to this that you can vote for:
Custom Alt Text (tooltip) On Hover Over Any Visual
Tooltip for Matrix visual (and others)
Tooltips for Tables
There is also a Dynamic Tooltip custom visual that you might be close enough to what you are looking for.
You can use a transparent shape as an overlay on the text you want the hover over test to appear on
Turn Action On
Type Page Navigation
Destination None
Tooltip - Add the test you want to display on the hover

How to overlay a line plot over a bar graph in APEX?

Right now I have a stacked bar graph and a line graph on one page using apex 'create a region' functionality. I'd like to combine these to one chart. I am thinking if you pehaps create a custom xml code in order to do so, but i'm not sure if that's the right direction to go to. Any help in this regard is appreciated.
No need to fiddle with XML. Create a second series in the chart using the SQL of your second chart and set the 'Series type' attribute to 'Line'.
Check "Multiple Y-Axis" in the display settings to plot your second series with a separate set of Y values. This means the number range offered in both series can be different scales. This can rescale as you show/hide specific series, as offered in one of the Legend properties.
Here is a link to a sample application by Hilary from the APEX team, plenty of examples in there regarding what is possible:
https://apex.oracle.com/pls/apex/f?p=36648

Display value labels on multi-series google column charts

Is anyone know wether there is a way to display the values of a multi-series google column chart over each columns ?
Muhammad Tayyab Shei succeded in making it, but for a single-serie : see put labels on top of inside bar in google interactive bar chart
Since the annotation role is not supported for column charts yet, it cannot be done with a multi-column chart (the single-series version works by using a combo-chart which allows annotations for the line chart portion).
The easiest way to implement this would be to create a javascript function to either display the tooltips full time, or to draw custom tooltips and turn them on (using HTML-enabled Tooltips, for instance).