How do I put tick labels inside of a line graph in Flot - flot

I essentially want to have the tick labels sitting inside the graph in their own column. Similar to how Campaign Monitor graphs are. But I can't find a way to do this. Is it possible?

In current versions of flot, the only thing you can control about the ticks is the contents and the label class (all ticks have the class "tickLabel").
I think with those two abilities, you cannot do what you're looking for.
Check out this flot bug for some code modifications that might get you to what you want: http://code.google.com/p/flot/issues/detail?id=191

How is this question different than this one?
jQuery Flot data/axis labels on top of graph
For that one, someone suggests negative labelMargins

Related

Can I bold invididual elements in y_range of a bokeh chart?

I would like to bold some of the values in my y_range but not others.
I have tried using p.yaxis.major_label_text_font_style = 'bold'. This bolds everything. I have also tried setting it equal to a column in a ColumnDataSource, but major_label_text_font_style does not accept that as an input.
# Orient y axis labels
p.yaxis.major_label_text_font_size = '18pt'
p.yaxis[0].major_label_text_font_style = 'bold'
p.yaxis.major_label_text_font = "calibri"
I would like some of the text in my y_range to be bold, but not all of the text
As of Bokeh 1.1 there is no built-in way to accomplish this. [1] The main reason is that, in general, tick labels and locations can be chosen dynamically, as a result of panning and zooming. There is no guarantee a tick you want to treat differently will actually be labeled or on the screen at all. I.e. it's not useful to say "make the third tick bold" if you have no idea of knowing or controlling what the third tick will be.
However, it might be possible to do something different in the case of categorical ticks, which are normally always all displayed, and so known up-front. I'd encourage you to file a GitHub feature request issue to discuss it.
[1] One could potentially create a custom extension Axis subclass to do this, but that would be non-trvial work, as Axis is one of the most complicated BokehJS objects.

Italicize and color legend manually for different graphs using same labels and colors

I am trying to create multiple graphs that share the same legend.
I have found many ways to combine multiple graphs and it seems that ggarrange has the ability to create one shared legend for all that is supposed to be unique.
However I am having some problems when graphing since a few of the graphs do not have the same phyla (what defines the legend colors) present, but I would like them all to be the same colors throughout all of the graphs so the combined legend will have the correct colors.
For just one graph I would assign a color to the label manually like below
labs<-c("Arthropoda"="#FF66CC"
,"Cercozoa"="#FF6000")
and plot with the addition of scale_fill_manual(values=labs) and this seems to work
then I modified it so I could have portions of them italicized.
labsPhylum <-c('expression(paste(italic("Arthropoda")))'="#CC0000"
,'expression(paste(italic("Cercozoa")))'= "#FF6000"
,'expression (paste("unknown", ~italic("Eukaryota")))'= "#990000")`
However when I create a plot using ggplot and scale_color_manual() using the labsPhylum that I think should be italicized and colored I plot an empty graph with this warning so there is something vital I am not understanding here.
ggplot(data=sigtab_dil, aes(x=Species, y=log2FoldChange, color=Phylum))+
geom_point(size=2) +
scale_color_manual(values=labsPhylum)
Warning message:
Removed 9 rows containing missing values (geom_point).
Could someone please help me figure out where I am going wrong?
Thank you
Answered my own question
I realized I had to make separate vectors for breaks, labels, and values rather than combining them.
In short
colsPhylum <-c("Arthropoda"="#CC0000"
,"Cercozoa"= "#FF6000"
,"Chlorophyta"= "#CC9900"
labsPhylum <-c(expression(paste(italic("Arthropoda")))
,expression(paste(italic("Cercozoa")))
,expression(paste(italic("Chlorophyta ")))
breaksPhylum <-c("Arthropoda", "Cercozoa","Chlorophyta", "Choanozoa"
,"Ciliophora"
,"Cryptista"

d3.js. How to organize bubbles along the line without overlaps?

I want to make such kind of bubble chart:
But only i can do is here - http://jsfiddle.net/zeleniy/h646uopc/6/.
jsfiddle code mock
How i can move them apart to escape overlapping. I understand that in some cases bubbles will be shifted along the x axis because of chart height limit. But in any case i do not know how to do it? And i am not sure that want to use force layout to scatter bubbles. I want do draw it at once.
Finally i do it - http://zeleniy.me/stretched-bubble-chart.html.
You should use force layout with specific gravity implementation. Read this article for details - http://vallandingham.me/building_a_bubble_cloud.html

How can I change thickness on elycharts pie chart?

I'm trying to make a menu for a website, and the client has provided me the final view of the menu: three circles, one in another, divided into segments. And each segment is a link, which will load content with AJAX.
So, I'm playing with Elycharts, and managed to make the three circles and divide them into segments. The main difference between the current version and the desired result is that the three circles must be different in thickness ... but can't find a way to control this ...
What is the way to achieve this? Thanks in advance ;)
I managed to do it with d3.js, much simpler ... and generates simpler code too ;)

flot - legend entries and stacked bars have reverse order

I ran across another small stacked bars issue: When filling the plot, flot adds the legend entries top-down and stacks the bars bottom-up. This way the legend is ordered exactly reverse from the bars.
The flot API allows for sorting the labels in the order they were added, alphabetically, or by providing a custom sorting function. I've tried providing a sorting function that always returns -1, so that the original sorting would be reversed but for some reason the sorted option seems not to be evaluated at all when using stacked bars. At least nothing I tried there (ascending, descending, false, function of my own) had any effect on the actual legend.
I've put together a test case at http://jsfiddle.net/YvGZu/1/ that illustrates the problem(s).
Edit: After some more testing ... could it be that legend-sorting is broken all together?
I coincidentally ran into the same issue as you within a couple of days. After a bit of hairpulling, I realized that the commit to handle legend sorting was quite recent (July 2012) and was not included in the version of jquery.flot.js that I was using.
From inspecting the flot resource on your Fiddle, it appears the same is true for you. If you update your flot js file to one that includes the sorting algorithm, your issue will likely be resolved, as mine was. (Well, I manually patched, since I had other experimental changes.)
I'm going to guess that you will next encounter the same roadblock as me, which was that the sorting code as it exists only sorts alphabetically, or with a comparitor that can only examine the label text and colour code. That was not good enough for me -- I wanted to assign an arbitrary sort order server side. In order to accomplish this, I added a hidden sort order string to my series labels:
label: '<a class="hiddenOrder">2</a>foo'
And then style those a blocks in the Flot placeholder to hidden (edit: also need the style to apply to tooltips, which are not contained within the Flot placeholder).
#flotPlaceholder a.hiddenOrder,
#flotTooltip a.hiddenOrder
{display:none;}
I forked your fiddle and included my ordering technique so you could try it out, but unfortunately it looks like my resource links to GitHub aren't working within the fiddle. You should be able to get it rolling locally, though.
Good luck!

Resources