This function creates an HTML widget to display matrix, data.frame and factor array, using the JavaScript library ECharts3.
eParallel(dat, series = NULL, axisList = list(), size = NULL,
colorStyle = "black", layout = "horizontal", left = "5%",
right = "18%", bottom = 100, top = 100, theme = "default",
title = NULL, subtitle = NULL, title.x = "center", title.y = "top",
legend = TRUE, legend.x = "left", legend.y = "top",
legend.orient = "horizontal", axis.scale = TRUE, axis.nameGap = 20,
axis.nameLocation = "end", axis.nameColor = NULL, line.width = 1,
line.opacity = 0.8, axis.line = TRUE, axis.tick = FALSE,
axis.lable = TRUE, axis.splitLine = TRUE, axis.splitArea = FALSE,
axis.boundaryGap = TRUE, calculable = TRUE, showLabel = TRUE,
opt = list())
a data object (a matrix, a data frame or a factor array)
an "formula" object: Associates the levels of variable
with symbol color, e.g. series = ~groupName
an array of html widget width and height(either numeric pixels or percentage could be accepted): e.g. size = c(1024, 768).
an object of theme name. see(http://datatables.net/extensions/index) for detail.
supported theme: c("default", "vintage", "dark", "westeros", "essos", "wonderland", "walden",
"chalk", "infographic", "macarons", "roma", "shine", "purple-passion")
an overall title for the plot. you can modify title widget after chart has been generated: barEchart + eTitle(title = "your title.")
the xy coordinates of main title, besides the excat exact pixels value,
x accept c("left", "right", "center") and y accept c("top", "bottom", "center") as legal input.
you can modify title widget after chart has been generated:
barEchart + eTitle(title="main title", x = "left", y=10)
logical whether the legend widget show or not, default is TRUE.
you can modify legend widget after chart has been generated, the legend position and
legend orientation are available at present.
barEchart + eLegend(show = TRUE)
the xy coordinates of legend, besides the excat exact pixels value,
x accept c("left", "right", "center") and y accept c("top", "bottom", "center") as legal input.
you can modify legend widget after chart has been generated:
barEchart + eLegend(x = "right", y="top")
an element of c("horizontal", "vertical"), default is "horizontal"
you can modify legend widget after chart has been generated:
barEchart + eLegend(orient = "vertical")
logical whether the front-end interactive chart will
support the drag-recalculable feature.
the size and calculable option can be setted after bar chart has been
generated through eOption: barEchart + eOption(calculable = TRUE)
objects of class "formula" (or one that can be coerced
to that class): x,y coordinates of the given data.frame colnames, e.g.
xvar = ~xAxisName
; yvar = ~yAxisName
. xvar, yvar only needed for the
data.frame data input.
logical. If FALSE, the bars are drawn vertically with the first bar to the left.
list object, used to make series pre-stacked before rendering
whole bar chart, if unique(df[["groupName"]])
= c("a", "b", "c", "d",
"e", "f") and an example legal input for stackGroup should be:
stackGroup = list(c("a","b"), c("e","f"))
. And the c("a","b") and
c("e","f") will be stacked into two bar, and the "c" and "d" will account
two seperated bars.
logical whether the toolbox widget show or not, default is TRUE.
you can modify toolbox widget after chart has been generated, the toolbox position, toolbox
element and toolbox orientation are available at present.
barEchart + eToolbox(show = TRUE)
the xy coordinates of toolbox, besides the excat exact pixels value,
x accept c("left", "right", "center") and y accept c("top", "bottom", "center") as legal input.
you can modify toolbox widget after chart has been generated:
barEchart + eToolbox(x = "right", y="top")
an element of c("horizontal", "vertical"), default is "horizontal"
you can modify toolbox widget after chart has been generated:
barEchart + eToolbox(orient = "vertical")
logical variable whether the dataview
, mark, restore, dataZoom or magicType tool in toolbox widget show or not,
default is TRUE. you can modify toolbox widget after chart has been generated,
the toolbox position, toolbox element and toolbox orientation are available at present.
barEchart + eToolbox(dataView = FALSE)
logical whether the tooltip widget for front-end interactive chart
show or not. default is TRUE. you can modify tooltip widget after chart has been generated,
the tooltip trigger and tooltip formatter is available at present.
barEchart + eTooltip(show = FALSE)
an element of c("axis", "item"), default is "axis" for bar chart.
"axis" option for trigger will show all the information of mouse;
"item" option for tirgger will only show the given item information of mouse.
you can modify tooltip widget after chart has been generated:
barEchart + eTooltip(trigger = "axis")
the information formatter for tooltip widget,
default is "<a>:<b><c>" for bar chart.
you can modify tooltip widget after chart has been generated:
barEchart + eTooltip(formatter = "<a><b>:<c>")
# NOT RUN {
require(plyr)
axisList = list(
list(index=7, type="category", data = c("low", "middle", "high")),
list(index=6, inverse=TRUE, max=50, nameLocation="start")
)
eParallel(head(parallelDf, 20), series=~groupName, axisList = axisList)
# }
Run the code above in your browser using DataLab