AmCharts4: add data dynamically - amcharts4

In my application, I have many charts. Those charts show realtime data from 1 day ago until now. I implemented an autoupdate, which periodically adds new datapoints to the chart. I use this method: chart.addData(dataArray,removeCount)
I also implemented a function that loads one further day in the past by pressing a button. This works fine by loading the data, and then doing:
chart.data.unshift(...dataArray);
chart.invalidateData();
but i rather want something like this:
chart.unshiftData(dataArray,removeCount)
Because if i call invalidate on a chart with 15000 datapoints, the chart freezes the browser for a moment. I do not really know where to start.
Thanks in advance!

Related

Oracle APEX - Interactive Grid not rendering correctly in IE 11

I am currently using Oracle APEX version 18.2.0.00.12 on Internet Explorer 11 and I am experiencing problems with getting my interactive grids to render correctly with regards to the widths of the columns.
I created an Interactive Grid on my page with the following query:
SELECT * FROM TABLE_NAME;
I did not change any of the default settings for the region; all I did was create the IG and then run the page.
When I run the page in IE, this is what I see:
Note: I have not yet added any data to the table.
The problem is that all of the columns are too narrow. However, when I run the same page in Google Chrome, this is what I see:
The columns are all sized proportionally in order to take up the full width of the IG, which is what I want.
I do not understand why the IG is rendered differently in IE versus Chrome. I know that I can set the Minimum Column Width for each column in the IG, but I would hate to do that every time I create an IG. Is there a different solution that would make the IG render in IE the same way that it does in Chrome?
Thank you in advance.
Actually remembered a solutuion. I cannot explain to you why this works, or how best to use it. But when I had this problem I sort of patched it by saving a default report.
But the strange thing, you had to manually adjust every column, even if it was to the same size as before, it just had to have been adjusted before the default report was saved. Then the grid would show as it should, but this isnt that good a solution since its only ok if everybody uses the same size display,..

How to return a first, second last instance of the event in the same row? POWER BI

I am looking for assistance to come up with a formula to display pictures (via URL) of first, second and last occurrence of the event in the table in which the events are grouped by item names and category (every single event has a image of its own).
I seemed to try everything I can think of, and got nowhere. The following is the principle of the data sheet:
Please have in mind that these events of same items can occur in several places and they all have their own image. So my objective is to display several images as examples in one line. (probably it is best to display them in different columns??
My expected results should look similar to as the following:
Could any of you help me out with coming up with formulas to do something like that?
Looking forward to any help/guidance,

Hide Chart.js bubble points based on filtering

I am using Chart.js 2.5.0 and wondered if anyone could give me some pointers on the following functionality requirement.
I have a bubble chart that for arguments sake contains tweets.
I have a list view next to the chart that display the tweets. Connected to this is the ability to filter, so it will only display tweets with specific string value the user inputs.
What I would like to do is when the user utilities the filter, it only shows the bubbles corresponding to the filtered result. I am passing the pointIndex and the datSetIndex into my table. However, I am really struggling in working out how to update the chart so it hides the bubbles that are not matching the current filter output.
Any suggestions?
This doesnt solve my entire issue as Im using Vue which seems to be causing issues with updating the chart. However if you are using plain chart.js the blow fiddle gives one way to hide specific or all points
`https://jsfiddle.net/prmw1bm2/12`
it may help someone somewhere

Navigate to "next" and "previous" Item

I hava a slightly complicated data model.
The main model is a betround in which several people can bet on sport events. Within every betround everyone bets on multiple games (maybe 1 game day). Now I want to build a stats screen which shows all bets grouped by games. But I only want to show the bets for one game at a time and then via next / previous buttons navigate to the bets for the next game within the betround.
I am currently trying to achieve this with queryparams. ( Filter with query parameter based on related model).
But the next question will be how to navigate to the next game. Maybe query params are not even the best approach, maybe I should have went for a grouping or something. Anyways, I have no idea how to navigate / paginate around within one betround. My statsscreen might be active on game 30. And within my Betround there are only game 28, 30 and 31. I would need to create a Array only with the games, sort them by date and then locate the "current" game. And then determine the next and previous within my collection.
How could I tackle this kind of thing?

Adding row to QTableView slows the app down after a lot of inserts

I have a QTableView thats using a model i made which extends the QAbstractTableModel. The model uses a
QList< QVector<QString> * >
as the collection. The table view is used to display logging messages from the application so the collection will eventually get extremely large... After it inserts a few thousand rows i notice the table view starts to slow down a lot and eventually the view freezes for a few seconds before refreshing.. Is it the type of collection im using thats making it slow down soo much? Is there a better way to store the data thats being inserted? Does the QTableView support a large amount of data?
Edit
Posted code on Qt forumn:
http://www.qtforum.org/article/37326/qttableview-slows-down-when-a-lot-of-data-is-inserted.html
I have successfully used QTableView displaying ~10000 rows so QTableView is capable of supporting it but your collection leaves to be desired.
QList is very expensive to insert in the middle since you have to reallocate everything sitting below the index you are trying to insert at granted you are only shifting pointers around but still.
Normally for data storage I would use an std::vector< data_struct * > rather then using vectors of strings. QVariant is quite capable of presenting integers and other types so you don't have to do the conversion up front.
The best suggestion that I can come up with would be to run gprof or a similar tool to time where exactly you are spending time and then address that particular piece.