Oracle APEX - How to hide tooltip for one series in a stacked bar chart - oracle-apex

I am using Oracle APEX 19.1.0.00.15 and I have a question regarding tooltips for a stacked bar chart. I have created a stacked bar chart that consists of three series, but I would only like for the tooltip to be rendered for two of the series. I see that there is an option in the chart's Attributes section to hide or show the tooltip for the chart as a whole, but not for individual series within the chart. I have tried to find the relevant JavaScript for the tooltip in the Oracle JavaScript Extension Toolkit API Reference http://https://www.oracle.com/webfolder/technetwork/jet/jsdocs/oj.ojChart.html but I was not able to find anything useful. Does anyone have any advice for how to achieve this?
Thank you.

You need to set shortDesc attribute for each item of the series to an empty string.
You can do that in initialization phase using the following code:
function( options ){
options.dataFilter = function( data ) {
var l_items = data.series[ 0 ].items
for (var i=0; i<l_items.length; i++) {
l_items[i].shortDesc = "";
}
return data;
};
return options;
}
The above code will disable tooltip for the items of the first series.

Related

How to remove blank data in Bar chart in PowerBI?

Hi everyone,
I want to remove the first bar (Blank) from the bar chart and the data label will recalculate the % by excluding the blank data. The reason why there are some blank data is because there are some data missing for some students. The DAX formula that I used to categorized the students into different % group is:
RankCategory =
VAR CatVar=[Success_Rate]
RETURN CALCULATE (VALUES ( BenchMark[Category]), CatVar>BenchMark[Lower_Level],CatVar<=BenchMark[Upper_Level])
May I know how should I modify in my Bar chart or modify the DAX formula so that it can achieve my goal? Any help or advise will be greatly appreciated!
You can apply a visual level advance filter as shown below-
Use the following method to suppress the NULL bars in Power BI:
Click the visual
Select the paint icon on the left
Change the X axis to "Categorical"

Flutter DropdownButton in DataTable, DropdownButton options from list

In flutter I'm trying to have one of the columns of a DataTable be a DropdownButton. I would like the DataTable rows to populate from getUsers initially, then be able to edit the cell cell with a the DropdownButton based on the ratingList.
So I would like to be able to change the value of the DropdownButton cell to any of the values in the ratingList: ['Ok', 'Good', 'Great', 'Amazing']; Note I want to be able to select 'Great' or 'Amazing', these aren't one of the initial populated values.
It is essential for the data to be loaded from getUsers, as this will be grabbed from Firestore eventually. Then have the ability to change a DropdownButton cell after the data is loaded, based on the ratingList of values, which is a complete list of the ratings.
See below for example code (DropdownButton doesn't change cell value), also in DartPad.
Thanks in advance!
Just put user.rating = newValue into setState block.
Like this.
onChanged: (String newValue) {
setState(() {
//help!
user.rating = newValue;
});
},

APEX changing row colors in an IG

I am following an example I found on-line as since I found it on the internet I know it must be correct. I am trying to search for a specific value in an IG and when it is found the line/row is highlighted with red text, Below it the logic I followed and screen shots. Please let me know what I am missing. He is using an employee example and I using my car dealership example. Thank you !
"Here's another approach that works great:
For an IR with this query:
select EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO,
OFFSITE
from EMP
Define for the column JOB the following Static ID: MANAGER_STATIC
Then create a DA After Refresh on Region where On True Execute the following javascript with Fire
on Page Load=ON:
this.affectedElements.find('td[headers="MANAGER_STATIC"]').each(function(i) {
var lThis = $(this);
if (lThis.text() == "MANAGER") {
lThis.parent().children().css({
"background-color": "#C0C0C0"
});
}
});
And every row that has the value of MANAGER will be highlighted and this will respect pagination.
That Example appears to be for an Interactive Report, but you appear to be using an Interactive Grid.
The easiest way to do this (without coding) is to run the report and use the Actions Button to define Highlighting. E.G.
Fill out form similar to this (Change column selection and value to your requirement):
Afterwards, using the Action Button again to Report->Save the report so it saves the report for All Users.

Chart.js custom legend inside of chart

fiddle of where I'm at so far
I'm using chart.js, and I'm trying to create a legend that is inside the chart, and not a separate piece of html. I see a lot of posts about legendCallback, but that seems like it only works if you want the legend to be in an html block, and not a part of your canvas that chart.js renders on.
I need this to be all on the canvas, underneath the "Title" that I've place on the chart myself. The dates are my chart labels, the "Title" is a dataset where only the middle piece of data is set to visible, and the dashed line is my fifth dataset.
I'm preventing the title and dashed line datasets from showing up in the legend with this
legend: {
labels: {
filter: function(item, chart) {
return !item.text.includes('hide');
}
}
}
Further, I'd like my legends to look more like their lines:
If it's not possible to make custom shapes like that, is there any way to fill the rectangles in the legends, without changing the fill of my data points?
Edit: Sorry for the wonky variable declaration at the top, it's because this script get's transformed into a scirban template.

Button to change selected records

I have an interactive grid with a bunch of records, and I want to set up a button on the page that changes one column in all records currently selected.
Running APEX 18.2, the IG has a whole bunch of columns and I want to change just one of them, but on a whole bunch of rows, so I do need a button.
The IG has ROWID as PK because the actual PK is assembled from 4 different columns.
I have spent some time googling this issue and have found a couple people with solutions:
http://thejavaessentials.blogspot.com/2017/03/getting-selected-rows-in-oracle-apex.html
This is the first, and simplest solution. But it doesn't return any rowid or anything like that, it returns the value in the first column.
Then I also found
http://apex-de.blogspot.com/2018/09/update-several-rows-in-tabular-form-grid.html
and
https://ruepprich.wordpress.com/2017/03/23/bulk-updating-interactive-grid-records/
Which are pretty similair and seem to be the best for me, but I get a Javascript error in the console: http://prntscr.com/n5wvqj
And I dont really know much Javascript, so I dont know what went wrong or how to best fix it.
I set up a Dynamic action on button click that executes Javascript and I have the selected element being the region named CUR_STAT.
var record;
//Identify the particular interactive grid
var ig$ = apex.region("CUR_STAT").widget();
//Fetch the model for the interactive grid
var grid = ig$.interactiveGrid("getViews","grid");
//Fetch the model for the interactive grid
var model = ig$.interactiveGrid("getViews","grid").model;
//Fetch selected records
var selectedRecords = apex.region("CUR_STAT").widget().interactiveGrid("getViews","grid").view$.grid("getSelectedRecords");
//Loop through selected records and update value of the AVT_OBR column
for (idx=0; idx < selectedRecords.length; idx++)
{
//Get the record
record = model.getRecord(selectedRecords[idx][0]);
// set Value for column AVT_OBR on "D"
model.setValue(record,"AVT_OBR", 'D');
}
The column named AVT_OBR is a select list with display values(DA, NE) and return values(D, N). But I tried having it be a text field and it didnt help.
I want to be able to select multiple columns and change the data in those entries.
If possible I would also like to be able to change data in such a way in a hidden column. Or if I could get all the ROWIDs for selected records and execute a PLSQL block with them.
Ended up with noone responding so I spent a lot of time and finally came up with a solution.
var g = apex.region('myIG').widget().interactiveGrid('getViews','grid');
var r = g.getSelectedRecords();
for(i = 0; i < r.length; i++) {
g.model.setValue(r[i], 'myColumn', 'Value');
}
For some reason none of the solutions I found had worked. But I learned from those solutions and made this simple piece of code that does what I need.
Also, I was wanting to set up so I could do this set value on a hidden column, I achieved this by just having the column visible and editable, but then when running the page I clicked on the column and hid it, and set the current view as the default report.
If anyone stumbles upon this question, I hope it helps.