IcCube Reporting V8 - possible to use Gantt chart? - amcharts

Using IcCube Reporting V7, I was able to create AmCharts Gantt charts as following :
Using following mdx behind the scene :
with member HDebut as [Measures].[Bloc Début Intervalle], format_string = "hh:mm"
member HFin as [Measures].[Bloc Fin Intervalle], format_string = "hh:mm"
member Date as [Measures].[Bloc Début Intervalle], format_string = "dd/mm/yyyy"
select
// Measures
{HDebut, HFin, Date, [Measures].[Bloc Début Intervalle], [Measures].[Bloc Fin Intervalle]} on 0,
// Columns
non empty [Temps utilisation bloc].[Temps utilisation bloc].[TempsIccube] * [Intervalle_Temps_Minute].[Intervalle_Temps_Minute] on 1,
non empty nonempty ([Salle_Box].[Salle_Box].[Salle], [Modélisation Minutes] ) * nonempty ([Numéro Unique].[Numéro Unique].[NumUnique], [Modélisation Minutes])
ON 2
FROM
[Cube]
where {[Date PH].[Libellé Jour Mois Année].[Jour].&[2022-01-01]}
* {[Temps utilisation bloc].[Temps bloc, visualisation].[Groupe visualisation].[Patient]}
* {[Salle_Box].[Groupe de Salle].[All-M]}
Can I still do it using IcCube Reporting V8 ? What would be the way to do so?

Currently, icCube does not support gantt charts out of the box. However, we agree with you that the gantt chart is a valuable addition to the icCube charting library of v8 (as it was for v7). We are going to add the gantt chart for the next release v8.3.1.

Related

How do I hide certain labels on Huggingface inference?

I am currently using my customized labels in a token classification model and have pushed the model to hub.
I am using the labels shown as below:
label_list = [“NORM”, “COMMA”, “PERIOD”, “QUEST_MARK”, “EXCLAMATION”]
label2id =
{‘COMMA’: ‘1’,
‘EXCLAMATION’: ‘4’,
‘NORM’: ‘0’,
‘PERIOD’: ‘2’,
‘QUEST_MARK’: ‘3’}
id2label =
{‘0’: ‘NORM’,
‘1’: ‘COMMA’,
‘2’: ‘PERIOD’,
‘3’: ‘QUEST_MARK’,
‘4’: ‘EXCLAMATION’}
Currently on inference API, it shows:
How may I hide the label of “NORM”(id=0) and make the inference only show labels of id1-4 (“COMMA”, “PERIOD”, etc.)?
Thank you!

Localized date format in tooltip

In my chart I'm displaying revenue data on a date axis by day. I would like to show the date in the tooltip formatted by locale setting, i.e.
* en-us: 2019-03-19
* de DE: 19.03.2019
I created a codepen inspired by the amcharts example here: https://codepen.io/Me12345678/pen/vPorre
When I specify a locale, the tooltip is still showing the en-US format:
chart.language.locale = am4lang_de_DE;
I can format the date in the tooltip text, but then the format is static and won't change with the locale:
series.tooltipText = `{dateX.formatDate("dd MMM yyyy")}: [b]{valueY}[/]`;
Is there any way to specify an abstract format like "date without time" or "date with time" or "month only", so that amcharts displays it according to the locale setting?
Thanks for reading :-)
try this formatDate(\"dd.MM.YYYY\")
series.tooltipText = "[bold]{date.formatDate(\"dd.MM.YYYY\")}[/] \n + [bold]{valueY}[/]";

How to speed up heavy conditional formatting rules

At our marketing company/agency, we're using a master tracker in Google Sheets to keep track of all paid advertising campaigns that we are handling for our clients. The document is getting longer and longer, and the variety of conditional formatting rules we are using is getting heavy and slow upon any change made to the document.
Five employees are using the document at any given time, making changes to the "STATUS" column upon any change to the campaign – if it is ready to upload, if it is LIVE, if it is paused etc. The conditional formatting simply changes the color of each line based on the value in the "STATUS" column. It also looks at the start/end dates and marks the line red if there is an issue. Etc.
How can I speed up processing using this document? I have created a minified version of our tracker with one line for each conditional formatting rule to make it easy for you to have a look.
I'm sure there are smarter ways to consolidate the rules and/or build a script that can handle the task more easily and more efficiently.
This answer uses a script to change the background color of a row whenever the Status is changed (works for "READY", "LIVE" and "DONE").
Live demo:
https://docs.google.com/spreadsheets/d/1bVwM1wSBVlZTmz5S95RXSrRQxlTKWWN_Hl4PZ81sbGI/edit?usp=sharing
The script is viewable under the "Tools - Script Editor..." menu. It is activated by an "onEdit" trigger (see Is it possible to automate Google Spreadsheets Scripts (e.g. without an event to trigger them)?).
Here is the script itself:
function onEdit(e) {
var STATUS_COL = 18;
var MAX_COLS = 18;
var COLOR_READY = "grey";
var COLOR_LIVE = "#512da8";
var COLOR_DONE = "green";
var activeSheet = SpreadsheetApp.getActiveSheet();
var cell = activeSheet.getActiveSelection();
var val = cell.getValues()[0][0];
var color = null;
switch (val) {
case "READY":
color = COLOR_READY;
break;
case "LIVE":
color = COLOR_LIVE;
break;
case "DONE":
color = COLOR_DONE;
break;
}
if (color != null) {
var row = activeSheet.getRange(cell.getRow(), 1, 1, MAX_COLS);
row.setBackgroundColor(color);
}
}
I had whole rows changing colors depending on some conditions. So I extracted complex formulas from conditional formatting panel into columns on sheet (I got "TRUE" or "FALSE") and referenced those columns in conditional formatting rules. For some reason calculation of conditional formatting formulas is much slower than same calculation inside cells.

ActiveReports as a convert to pdf machine

The company I'm with is likely to obtain an ActiveReports 7 license. There's a new project requirement that several webgrids (not actually webgrids, but more like html rendered with zurb) need to be converted into pdfs. At one point in the code behind they're effectively datasets or can be created into such. Is there a way to shuttle the data from the datasets into active reports, then render it out as a PDF. I'd like to keep the report as generic as possible, and thus have one active report for all the datatables, so doing using active reports as its usually done is kind of out of the question.
The only thing I can think of at the moment is a single textbox in the group header into which I could concatenate all the headers, and a single textbox in the details into which I could throw all the data for each row. The problem here is that I'd run into many formatting issues as nothing would line up properly - as tab delimiting would solve nothing here. I could have multiple textboxes with various spacing, but then it would eventually devolve into a different report for each dataset. Is it possible to apply some sort of markup so that I could keep the spacing of columns as I feed the data in. Do active reports richtextboxes honor html markup? Or is there another solution altogether?
I'd use Itextsharp, but its not free for commercial products.
Thanks,
Sam
You can dynamically build a report that will output a simple table based on a specified DataSet, well actually a System.Data.DataTable. Basically for each column in the DataTable, add a textbox to the header to hold the name of the column and add another textbox to the Detail section to hold the value.
For the textbox in the detail section set its DataField property to the name of the column. With the binding in place, you can set the report's DataSource property to the DataTable and then run the report and export it to PDF.
The following code is a basic example:
var left = 0f;
var width = 1f;
var height = .25f;
var space = .25f;
var rpt = new SectionReport();
rpt.Sections.Add(SectionType.ReportHeader, "rh").Height = height;
rpt.Sections.Add(SectionType.Detail, "detail").Height = height;
rpt.Sections.Add(SectionType.ReportFooter, "rf").Height = height;
foreach (System.Data.DataColumn col in dataTable.Columns)
{
var txt = new TextBox { Location = new PointF(left, 0), Size = new SizeF(width, height) };
txt.Text = col.ColumnName;
rpt.Sections["rh"].Controls.Add(txt);
txt = new TextBox { Location = new PointF(left, 0), Size = new SizeF(width, height) };
txt.DataField = col.ColumnName;
rpt.Sections["detail"].Controls.Add(txt);
left += width + space;
}
rpt.DataSource = dataTable;
rpt.Run();
var pdf = new PdfExport();
pdf.Export(rpt.Document, #"c:\Users\scott\downloads\test.pdf");

MATLAB date selection popup calendar for gui

Does anyone know of a method to display a popup date selection calendar in a MATLAB gui? I know the financial toolbox has a uicalendar function, but unfortunately I don't have that toolbox.
I have a hunch I'm going to have to use some Java or some other language for this one, which I know nothing about.
I'm looking for something similar to this:
(source: welie.com)
which would return a date string after the user selects the date.
Here are two approaches that would give you a professional-looking calendar component in Matlab without too much programming work:
Use a Java calendar component (for example, one of these or these). Once you download the relevant Java class or Jar-file, add it to your static Java classpath (use the edit('classpath.txt') command from the Matlab Command Prompt). Finally, use the built-in javacomponent function to place the component in your Matlab figure window.
If you are using a Windows OS, you can embed any Active-X calendar control that is available. Use the built-in actxcontrolselect function to choose your favorite calendar control (for example, Microsoft Office's "Calendar Control 11.0" - MSCAL.Calendar.7 - which is automatically installed with Office 2003; or "Microsoft Date and Time Picker Control 6.0" - MSComCtl2.DTPicker.2, or ...). Then use the actxcontrol function to place the component in your Matlab figure window.
Matlab has some pretty useful built-in calendar (date-selection) controls - I posted an article about them today
I don't have much time for a more complete answer, unfortunately, but I'd try uitable to create a table and to define the CellSelectionCallback to get the date.
Here's a bit to get you started:
dates = calendar;
dates(~any(dates,2),:) = [];
fh = figure;
uh = uitable('parent',fh,'data',dates,'ColumnWidth',repmat({20},1,7),...
'ColumnName',{'S','M','T','W','T','F','S'});
I'd start with the calendar() function which outputs a matrix containing the calendar for any month. I assume you could combine this with a user-clickable interface to retrieve a specific date?
The following code is really ugly, but could help you get started...
WINDOW_WIDTH = 300;
WINDOW_HEIGHT = 200;
f= figure('Position',[300 300 WINDOW_WIDTH WINDOW_HEIGHT]);
NB_ROWS = 6;
NB_COLS = 7;
width = round(WINDOW_WIDTH/NB_COLS);
height = round(WINDOW_HEIGHT/NB_ROWS);
buttons = nan(NB_ROWS,NB_COLS);
dates = calendar();
for row = 1:NB_ROWS
for col = 1:NB_COLS
if dates(row,col) == 0
mydate = '';
else
mydate = sprintf('%i', dates(row,col));
end
buttons(row,col) = uicontrol('Style', 'PushButton', ...
'String', mydate, ...
'Position', [(col-1)*width (NB_ROWS - row)*height width height]);
end
end

Resources