In Victory charts, the custom tooltip has performance issues. How to resolve? - tooltip

Custom tooltip added to a bar chart. However, the tooltip renders some static line in the background after hover movement from one point to the other. The way I've used it in victory bar is as follows
<VictoryBar
data={lineData}
barWidth={dynamicStyles.backgroundBarWidth[type]}
dataComponent={<CustomBar />}
labelComponent={
<VictoryTooltip
renderInPortal={false}
flyoutComponent={
<VictoryPortal>
<ProfitLossAnalysisChartToolTip type={type} />
</VictoryPortal>
}
/>
}/>
Please guide me in this regard

Related

Xamarin.Forms on iOS: Shrink height of page instead of shifting it up when the softkeyboard appears

Got the problem that the softkeyboard overlaps an entry field placed at the bottom.
XAML code:
<ContentPage.Content>
<AbsoluteLayout VerticalOptions="Fill">
<ScrollView AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,0.9">
<Label Text="Heading" />
</ScrollView>
<Entry x:Name="SearchEntry" AbsoluteLayout.LayoutBounds=".5,1,1,.1" AbsoluteLayout.LayoutFlags="All" Placeholder="Suchen..." ReturnType="Done" />
</AbsoluteLayout>
</ContentPage.Content>
I installed the KeyboardOverlap! plugin via nuget. It shifts the whole page upwards till the entry is visible again. The entry is visible, but the top of the page isn't visible anymore because it's shifted up.
Another often mentioned solution is wrapping the pages's content in a ScrollView. Because I definitively need an AbsoluteLayout as root content, that's unfortunately not a solution.
I'm looking for a solution which shrinks the height of the page and don't just shifts it up when the softkeyboard appears.
Why I need this? The page is filled dynmically with search result based on the entrie's input. If there are only few result, they're not visible because of the page's upward shift. The user could think that there aren't any search results. Displaying a text like 'No search results.' above the entry would be a simple solution but is not an option here.
Using this CustomRenderer class in the iOS project instead of the KeyboardOverlap plugin did the trick.
Don't forget to customize line 14 with your concrete page classname(s) where you need the functionality. Otherwise the renderer is called for all pages in your app!
Many thanks to Jack Hua - MSFT!

Highcharts crosshair event

I am using the "Custom Events" highchart plugin by Black Label, to detect right click in my chart. My goal is to use the right click in the chart as "Back" button when drilling out from my custom data. I know highchart has drilling options embedded, but this is a highly custom application, and my problem is that I need a way to detect right click on the x-axis crosshair line.Since the crosshair is following the mouse, 90% percent of the right clicks is triggered on the crosshair line itself, and I can not manage to detect that click. I need the event to be catched inside highcharts, because there is multiple charts on my page, and I need to know which chart was clicked on, and on what point.
I hope you understand my explanation and problem.
BR,
Benjamin Kruger

How can I change a vaadin grid filter and the layout at the same time?

I have a vaadin grid with some filters on top and the filters can be displayed/hidden by a button.
The problem now is that if the data source of a grid is modified and at the same time the position of the grid changes the grid is not properly redrawn. The grid only shows 5 out of 10 items and a empty line at the top.
The button action is setting setVisible to false and reseting the filters.
filter.addClickListener(event -> {
if (filters.isVisible()) {
location.setValue(null);
filter.setCaption("Filter");
filters.setVisible(false);
} else {
filter.setCaption("Show all");
filters.setVisible(true);
}
});
Is there a way to mark the layout as dirty or to demand a rebuild?
PS: I have a full blown example app with the problem at https://github.com/jansauer/vaadin/tree/filtergrid/
It appears the bug is caused by a bug in Vaadin UI. Simply moving your horizontal-layout with id="filters" behind the grid does the trick.
<v-vertical-layout size-full>
<v-horizontal-layout>
<v-button _id="filter" style-name="borderless-colored">Filtern</v-button>
</v-horizontal-layout>
<v-grid _id="grid" size-full :expand />
<v-horizontal-layout _id="filters" style-name="filters" margin spacing width-full>
<v-text-field _id="name" caption="Name" width="220px" />
<v-combo-box _id="location" caption="Standort" />
<v-css-layout :expand />
</v-horizontal-layout>
</v-vertical-layout>
From my almost 2 years experience with Vaadin I would discourage you from using Vaadin views based on *.html's since I often find weird bugs like this one.

How to supply tooltip for PaperDropdown that behaves nicely

If I wrap the paper-dropdown that comes in the paper_elements example in a core-tooltip, the tip displays on hover as expected.
<core-tooltip position="bottom" label="Choose country of residence">
<paper-dropdown>
<template repeat="{{countries}}">
<paper-item label="{{name}}"></paper-item>
</template>
</paper-dropdown>
</core-tooltip>
The problem is, after selecting an item, the tooltip is still displayed. Additionally in dartium and on chrome there is a fine blue line outlining the tip and the dropdown even as I hover over other elements.
Please explain what is going on and what is the best way to register with the PaperDropdown and/or CoreTooltip that it no longer has focus? I've tried calling focus() another element in the onClick PaperItem in my own examples and that did not seem to work.
Any suggestions on better approaches that might make tooltip unnecessary would be useful as well. The reason for a tooltip is there is no comparable Floating label as with PaperInput for the dropdown. So once a selection is made there is no description, thus the tooltip.
It seems to have to do with focus. Mybe this improves your situation. If this is not what you want just add a comment:
core-tooltip:focus {
visibility: hidden !important;
}
Sometimes the tooltip seems just not to recognize that the element isn't mouse-overed anymore when not the mouse moved out but instead the mouse-overed element shrank away. I would report this as a bug in the <core-overlay> element.

highcharts context menu hidden for small charts

I am migrating a dashboard type screen to highcharts and would like to use the default context menu (for exporting various image formats and printing the chart).
The problem is that a lot of these charts are small gauge type charts and the context menu gets hidden when charts get below a certain size, mainly due to the fact that the context menu appears above the button for small charts size.
Is there anyway to make the context menu always appear below the button? I know I can limit the options and this will solve the problem but I would ideally like to use the default options list. Also I don't really want to have to calculate positions and move it myself.
See jsfiddle
see code at jsfiddle
Add the following styles to the context menu.
.highcharts-contextmenu {
bottom: auto !important;
top: 5px;
}
FIDDLE
Not sure if it would work for your situation, but have you considered using their pie chart with the legend at the bottom?
http://www.highcharts.com/demo/pie-legend

Resources