Charts flickering - chart.js

How can I identify why is this charts.js flickering?

Just a shot in the dark with the limited information.
A resize of the chart or window or the parent element (e.g. could be caused by a collapsing parent or sibling of the parent) will cause chartjs to trigger its resize event, redrawing the chart.
If you have animation turned off, this may not be noticeable unless you hover over a tooltip. Try turning animation on to see if the chart is redrawing.

Related

Wrong stem position in balloon-style tooltips in report list-view

I'd like to change the default style of the list-view control's tooltips to balloon.
I first called ListView_GetToolTips() to get the HWND of the list-view's tooltips control, and then used GetWindowLongPtr()/SetWindowLongPtr() to add the TTS_BALLOON style.
I handle LVN_GETINFOTIP to customize the tooltip for the items (first column) in the list-view: the tooltip texts that appear for the first column items are actually a copy of the text of the third column. The other columns (subitems) are managed automatically by the list-view.
The balloon-style tooltips for the first column items seem OK; their stems are correctly positioned:
But the tooltips for the second column seem drawn wrongly, e.g. the balloon is drawn as if it was referred to a subitem in a row below the actual row pointed by the mouse cursor.
In the following picture, the "star" indicates the position in which the mouse cursor was when the tooltip appeared, but the tooltip's stem points to a row below, marked with an ellipse:
The strange thing is that the tooltips for the third column seem drawn correctly.
Is this a bug in the list-view control? (I'm using Windows 7.)
Or what am I missing here?
The ListView uses a tracking tooltip and positions it to unfold and reveal the hidden text in a column that's too small. It's not expecting its tooltip to be a balloon and so doesn't compensate for that.
You'd need to sub-class the tooltip itself, watch for TTM_TRACKPOSITION messages from the ListView, and adjust the coordinates.
Your second question - the shaded background comes from the system theme. You should be able to get it by calling SetWindowTheme on the tooltip (I'm not sure why the ListView disables themes for the tip).

How to get window's scroll bars region?

I have a list control and disable the scroll bar using the following code.
InitializeFlatSB(this->m_hWnd);
FlatSB_EnableScrollBar(this->m_hWnd, SB_BOTH, ESB_DISABLE_BOTH);
The scroll bars don't disappear, they just become white, which is what I need because I want to redraw my own scroll bars on their original rectangle region. In that way, my own scroll bars won't cover the list content and I can add functionality so that the mouse wheel function will be enabled.
But now how can I get the rectangle region of the scroll bars?
As suggested in the comments, can you try to deduce the rectangle from GetWindowRect and GetClientRect? It seems to be a easy calculation to do subtractions and get a Non Client rectangle for the Vertical scroll bar and another for the Horizontal.

in wxpython using a GLCanvas, tooltips sometimes covered by the GLCanvas

I have a wxpython application, and I'm using both a toolbar and a wx.glcanvas.GLCanvas sub-window to draw my client area content. The toolbar is vertically just above the GLCanvas. When I roll over a tool and the tool tip pops up, it often (but not always) gets overdrawn by the GLCanvas, so the part of the tooltip that extends into the canvas area gets whited out by the all-white canvas rect. As I say, it doesn't happen all the time -- sometimes the tooltip shows over the canvas area just fine. I assume the difference is just in whether wxpython (or Windows?) happens to decide to sent me a paint message to repaint the canvas while the tooltip is shown. But even if the canvas is repainted, you'd think it could just respect its z order and repaint under the tooltip. But I realize opengl canvases might be special in not playing nice with the window z order.
Any suggestions for a solution or work-around? I was hoping to be able to tell the tooltips to show above the tools instead of below them, but there doesn't appear to be a way to set that.

Stringray Grid transparent background

In Stringray grid, there is the ability to use a transparent background which allows the background of the dialog to be shown through the grid.
In the documentation it states:
But be careful; you should disable scrolling or you have to redraw the grid each time it is scrolled (by overriding DoScroll).
I have a scrollable gird and override the DoScroll and make sure I call Redraw and also tried Invalidate, however the grid is still not completely erasing and redrawing.
I also tried using the old drawing method by setting m_bForceOldDrawing to TRUE.
How can I create a grid that has a transparent background that paint correctly after a scroll without leaving artifacts?
Yes you have to redraw the grid by overriding DoScroll because it is no longer using ScrollWindow to scroll contents because the background is transparent.
However you now have artifacts of the grid over your background.
This is because the background behind the grid is not getting redrawn.
Do you have clipchildren set for the parent?
Another potential problem is that the background is not being drawn because it doesn't realize it has been exposed.
Try calling the parent with the following.
Parent.Invalidate();
Parent.UpdateWindow();
before calling...
Invalidate();

Qt - QGraphicsView without ScrollBar

I am trying to show a picture in it's full view using QGraphicsScene. But when ever I put the QgraphicsScene inside the QGraphicsView, I am getting a scroll bar. I tried so many ways But all are went to veins. So can anybody tell me how to obtain the full view without the scrollbar.
You might be getting scrollbars because the scene is larger than the usable area within the graphics view. By default, a QGraphicsView comes with a 1-pixel margin. To fix this, you can try:
QRect rcontent = graphicsView.contentsRect();
graphicsView.setSceneRect(0, 0, rcontent.width(), rcontent.height());
I had been getting scrollbars because I was manually setting the scene rect to the size of the graphics item I was adding -- which was as large as the QGraphicsView widget. I wasn't taking into account the margin.
QGraphicsView v;
v.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
v.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
To adjust the scrolling programmatically once these have been hidden, use one of the overloads of v.ensureVisible().