I am using the R package, highcharter, to produce Sunburst plots. The code I'm using is functionally equivalent to the example code provided here.. I want to change the font size of the labels marking each slice or section of a slice in the plot (in this example, these labels identify specific countries, sub-continents, etc). Searching the documentation and related StackOverflow questions, I've found plenty of information about how to modify the font in a charts title or axis labels but I haven't been able to find any information about modifying the font on sub-sections of a Sunburst plot.
I worry it might not actually be possible to do this without modifying the package because there seems to be some built-in function for hiding labels of very small sub-sections. I would appreciate any suggestions about how to modify these font sizes whether they involve modifying the package or not.
I'm not too familiar with highcharter but most of the wrappers allow you to put in code directly in case you want to utilize the full functionality of highcharts.
In your case, you want to adjust the label size. That is totally do-able, I'm going to direct you to their documentation as well of how I found what you are looking for so in case you do not receive feedback that you need on SO, you can find it yourself next time.
Direct link to documentation
For your question, and using the example that you cited above, you would need to adjust the by adding a style in dataLabels that are under levels.
In this case:
levels: [{
level: 1,
levelIsConstant: false,
dataLabels: {
filter: {
property: 'outerArcLength',
operator: '>',
value: 64
},
style: {
fontSize: '22px'
}
}
}
This will allow you to have custom sizes for every layer in the sunburst that you would need.
Related
I'm trying to set click_policy to 'hide' in legend_opts for the object resulted from applying holoviews.operation.decimate on a set of hv.Points, but it doesn't seem to have the desired effect.
Now I'm using the muted_alpha option on the underlying hv.Points to hide the points, but this is suboptimal, since hovering over the invisible points still shows the tooltip, which is cluttering the output when showing multiple curves.
I've tried passing legend_opts={'click_policy': 'hide'} as opts for the Overlay container, as well as for both the underlying hv.Points and for the result of decimate (actually, I also tried passing it as an argument to decimate), but to no avail.
I even tried using a hook for the bokeh plot as suggested here to directly set plot_obj.state.legend.click_policy = 'hide', but that doesn't work either.
So, any idea on how to hide a set of decimated hv.Points completely (i.e., not showing the hover tooltips either)?
Note: I've followed the "Principles of datashading" section of holoviews' user guide on "Working with large data" and used decimate as indicated there.
Turns out that one has to set the options for hv.Overlay after calling collate on it.
I am using the Plots.text function from the Plots.jl package to annotate points in my plot. It appears that changing the plot(..., fontfamily="Computer Modern") does note seem to have an effect on these annotations.
Plots.text creates a text object including styling information. It is therefore necessary to change the font directly
Plots.text("abcde", "Arial")
seems to work
I'm an advanced R user, but have just started recently using Rcy3 to create better visualisations of my graphs.. problem is I don't know how to add a legend to my figure that would explain the coloring of my nodes.
You may want to look at the app "LegendCreator". It's sort of in the beta stage, but it can be useful particularly for gradient legends. It also supports automation, although generally, you'll want to manually position the legend.
-- scooter
These are probably separate questions but they both relate to controlling the look of an rCharts/Polycharts plots (to that end, my meta-question is: Where can I find a complete source for all the fields/methods for rCharts/Polycharts?)
My specific questions are:
1) How do I change the background color of the plot? Specifically, I need a color background instead of the default white.
2) How do I suppress the axes (and associated labels and ticks)?
Most of the SO posts with workarounds for the above are for nvd3.
The documentation found here:
https://media.readthedocs.org/pdf/rcharts/latest/rcharts.pdf
Was mostly just some basic examples, but nothing covering the above. I did find this thread on github from 2 years ago, noting that complete documentation was on the to-do list.
https://github.com/ramnathv/rCharts/issues/221
So maybe I'm just not finding it?
Thanks
Link to sample image with tilting graph:
Link to NVD3 Streamgraph page:
The nvd3 streamgraph will descend or ascend sharply over time. I searched SO and the NVD3 documentation but didn't find a variable that controls where the zero of the y axis is at each point in time. Nor have I found discussions of this. In other words what makes the whole graph tilt in one direction or the other and how to control or turnoff this tilt.
I read a bit of the initial paper on streamgraphs by Byron but couldn't figure it out and thought I'd ask here.
Could someone please point me towards documentation on this or otherwise provide insight?
The NVD3 code for the stacked area chart accepts four possibilities for the chart style: stack, stream, stream-center, and expand. The default stream graph is the "stream" style, and this is the version that gets off-centre if you have any zero values in your data.
If you set the style explicitly to "stream-center", the chart behaves as expected. However, the radio buttons that switch between display styles switch back to the problematic algorithm, so they will need to be disabled.
chart.style('stream-center')
.showControls(false);
It's possible that the existence of this other display algorithm means that the NVD3 folks are working on it. The github issue page might be a good place to look for updates or responses from them:
https://github.com/novus/nvd3/issues/416