Can the Treemap be configured with a different legend location? - gooddata

I'm using #gooddata/react-components version 5.3.0. The documentation here suggests that you can supply a chart config to the config property. I'm using the same chart config that I'm using for other chart types:
{
legend: {
enabled: true,
position: 'bottom'
}
}
Unfortunately when I use this config for the Treemap chart type, the legend always renders on the right. Is this a bug? Or is it not possible to configure the position of the Treemap's legend?

In the current version, 5.3.0 legend position for Treemap can't be configured like for other charts. But in the next version, coming about the end of September, you will be able to configure legend position for all provided charts including Treemap. We will add a note to the doc. Thx for asking!

Related

Using matplotlib with latex mode with non-default fonts

I am using Windows 10 with Anaconda and Spyder 4. When using matplotlib, I would like to use the font Proxima Nova and render with LaTeX.
If in my matplotlibrc file I specify
font.family : Proxima Nova
then the figure renders with the font Proxima Nova. This means that the font is installed on my system (as it is) and matplotlib can use it. However, if in the matplotlibrc file I also specify
text.usetex: True
then, even though I have specified Proxima Nova as the font, the figure renders in the default LaTeX font, which I guess is Computer Modern.
I have tried
matplotlib.font_manager._rebuild()
In the source code file and also have tried specifying the fonts in the source code file and not in the matplotlibrc file. However I always get the same result. I have also followed all the advice on this help page, including making sure that latex, dvipng and ghostscript are all the PATH variable. However nothing seems to work.
I would like to note that I can use Proxima Nova separately when compiling Latex documents, so that should not be an issue either.
How can I get matplotlib to be able to use a non-default font and render with LateX at the same time?
After some further investigation, I was able to get to use Proxima Nova with Latex, although there are still some outstanding issues.
The main issue is that if the font Proxima Nova is used with Latex, one needs to use Lualatex and not plain Latex. Here is the Matplotlib instruction on using matplotlib with Lualatex.
The key to getting things to work was this post.
At the very beginning of my .py file, I have the following code:
import matplotlib as mpl
mpl.use("pgf")
mpl.rcParams.update({
'font.family': 'sans-serif',
'text.usetex': True,
'pgf.rcfonts': False,
'pgf.texsystem': 'lualatex',
'pgf.preamble': r'\usepackage{fontspec} \setmainfont{Proxima Nova}',
})
The code above should be placed at the very top of the code, above any other imports.
The problem, however is that this solution works only after performing the following steps:
Delete the .matplotlib/tex.cache folder and restart spyder
Replace 'font.family': 'sans-serif' and \setmainfont{Proxima Nova} with 'font.family': 'serif' and \setmainfont{Times New Roman} respectively. Run python once.
Revert back to 'font.family': 'sans-serif' and
\setmainfont{Proxima Nova} and run python again.
The output with the correct font is produced.
Unless the above 4 steps are performed, the output is compiled with the default DejaVu Sans font and not with Proxima Nova. I am not sure why...
After getting help on the matplotlib github forum, I was pointed to the following solution:
mpl.rcParams.update({
'font.family': 'sans-serif',
'text.usetex': True,
'pgf.rcfonts': False,
'pgf.texsystem': 'lualatex',
'pgf.preamble': r'\usepackage{fontspec} \setsansfont{Proxima Nova}',
})
In other words you need to use setsansfont in stead of setmainfont. You can see the matplotlib forum page here.

setup ColumnChart from WinRTXamlToolkit

I'm trying to setup Column Chart from WinRTXamlToolkit.
Let me ask:
Is there any guide for charts from this lib? Or which way you found the easiest to learn using charts?
How can I put labels near axises? In points like on below image:
P0: Times
P1: States
How to move labels above chart (like on below image)?
Thank you in advance!
I found "workarounds" (far away from perfection but works).
Below WinRTXamlToolkit = WXT
Fastest way (if you don't know WXT) is:
hide WXT elements
title (just dont set it)
legend (see Hide legend of WPF Toolkit chart with more than one data series)
create your own equivalent of above elements using native XAML (TextBlocks ..) and place it wherever you like
To get column colors for legend do
MethodInXamlBackingObject() {
var paletteOfFirstColumn = ColumnChart.Palette[0];
var columnFirstBrush = paletteOfFirstColumn["Background"];
}
BTW. tips where from to learn WXT:
analyse sources of samples in WXT - these are very detailed
analyse WXT behaviour with tool "WXT Debug Console" (included in demo app) - very powerfull
read arts about WXT and WPF Toolkit (from which WXT is a fork)

when minimize browser's window, tooltipster's position not the same as has been set

I use tooltipster library.
I set tooltipster's position to be bottom. When I minimize the browser's window the tooltip is floating above, it's like the position was set to top.
How could I solve this?
Thank you in advance
According to the author's documented feedback, this functionality has been written but it not officially released yet.
This specific functionality has been requested and he has explained how it is implemented within the plugin options.
instead of:
...
position: 'bottom'
...
you put it in an array:
...
position: ['bottom']
...
this is how the scripts tells that it is to be forced.
have a look at these 2 links.
https://github.com/iamceege/tooltipster/issues/335
https://github.com/iamceege/tooltipster/issues/342

Showing Tick Marks on input[type=range]

I'm creating a windows 8 app and need to create a vertical slider that also displays tick marks. I'm able to get the range slider to appear vertically by appying the windows specific class: win-vertical.
There are also psuedo-selectors for input[type=range]::-ms-ticks-after and input[type=range]::-ms-ticks-before but I cannot find any documentation on how to use them correctly and any rules I add to them seem to not do anything. Any help would be greatly appreciated. Thx
Have you tried the -ms-track selector? Detailed here: http://msdn.microsoft.com/en-us/library/windows/apps/hh465813.aspx
I tested this in IE10 (should be equivalent to Windows 8) and I am able to set the tick marks to red using the following CSS.
input[type=range]::-ms-track { color: red; }

Removing Directions markers from the Google Maps API V3

To remove a normal marker from a map, I understand you simply call marker.setMap(null), but when implementing the Google Maps directions services, it automatically adds markers A and B onto the map ( calculating directions from point A to point B ). I do not have control over these markers, so I cannot remove them in the normal way. So how can I remove these markers (I have custom markers on the map instead)?
Set the suppressMarkers option to true when creating your DirectionsRenderer object and then the markers won't show up. You could also change the style or icon of the markers. See the API spec for DirectionsRendererOptions for other properties you can set.
...
directionsDisplay = new google.maps.DirectionsRenderer({suppressMarkers: true});
...
EDIT: It looks like the API changed a little bit since my original answer almost 6 years ago, so the answer from #joni-jones is now the correct way. I tweaked my example above to reflect that.
I had a similar problem. The previous solution did not help me. But I tried this:
var directionsDisplay = new google.maps.DirectionsRenderer({suppressMarkers: true}); And it's work.