JFreeChart create tooltip in ChartPanel

Most ChartFactory methods include a boolean tooltips parameter. Just look in the source for your factory of choice to see how to instantiate a default tooltip generator suitable for the designated renderer. You shouldn’t need to handle the events yourself. Addendum: As you are using createXYLineChart, an instance of StandardXYToolTipGenerator is supplied by default. The … Read more

Removing one tableGrob when applied to a box plot with a facet_wrap

It would probably make sense to let annotation_custom access facetting info *; this trivial change seems to do the trick, library(ggplot2) library(grid) library(gridExtra) annotation_custom2 <- function (grob, xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf, data) { layer(data = data, stat = StatIdentity, position = PositionIdentity, geom = ggplot2:::GeomCustomAnn, inherit.aes = … Read more

Highcharts percentage of total for simple bar chart

You’ll have to loop through the data and get the total, and then use the datalabel formatter function to get the percent. Example here: http://jsfiddle.net/JVNjs/319/ formatter:function() { var pcnt = (this.y / dataSum) * 100; return Highcharts.numberFormat(pcnt) + ‘%’; } edit:: updated example with axis labels: http://jsfiddle.net/JVNjs/320/ [[EDIT for comments If you are trying to … Read more

MS Chart Control Two Y Axis

Here’s what did it for me- after I created the chart I added the following lines: chrtMain.Series[0].YAxisType = AxisType.Primary; chrtMain.Series[1].YAxisType = AxisType.Secondary; chrtMain.ChartAreas[0].AxisY2.LineColor = Color.Transparent; chrtMain.ChartAreas[0].AxisY2.MajorGrid.Enabled = false; chrtMain.ChartAreas[0].AxisY2.Enabled = AxisEnabled.True; chrtMain.ChartAreas[0].AxisY2.IsStartedFromZero = chrtMain.ChartAreas[0].AxisY.IsStartedFromZero; There was no need to superimpose two charts or anything!

Plotting a stacked bar plot?

ggplot(df, aes(x = factor(Time), y = Value, fill = factor(Type))) + geom_bar(stat=”identity”, position = “stack”) ggplot(df, aes(x = factor(Time), y = Value, fill = factor(Type))) + geom_bar(stat=”identity”, position = “dodge”) You can do one or the other but not both. When they are dodged, the different values of type are being used. By adding a … Read more