apexcharter/docs/search.json

2 lines
236 KiB
JSON
Raw Normal View History

2021-10-20 18:23:29 +02:00
[{"path":"/articles/apexcharter.html","id":"bar-charts","dir":"Articles","previous_headings":"","what":"Bar charts","title":"Starting with ApexCharts","text":"Simple bar charts can created : Flipping coordinates can done using type = \"bar\": create dodge bar charts, use aesthetic fill : stacked bar charts, specify option stacked ax_chart :","code":"data(\"mpg\") apex(data = mpg, type = \"column\", mapping = aes(x = manufacturer)) apex(data = mpg, type = \"bar\", mapping = aes(x = manufacturer)) apex(data = mpg, type = \"column\", mapping = aes(x = manufacturer, fill = year)) apex(data = mpg, type = \"column\", mapping = aes(x = manufacturer, fill = year)) %>% ax_chart(stacked = TRUE)"},{"path":"/articles/apexcharter.html","id":"line-charts","dir":"Articles","previous_headings":"","what":"Line charts","title":"Starting with ApexCharts","text":"Simple line charts can created (works character, Date POSIXct): represent several lines, use data.frame long format group aesthetic: Create area charts type = \"area\":","code":"data(\"economics\") apex(data = economics, type = \"line\", mapping = aes(x = date, y = uempmed)) data(\"economics_long\") apex(data = economics_long, type = \"line\", mapping = aes(x = date, y = value01, group = variable)) %>% ax_yaxis(decimalsInFloat = 2) # number of decimals to keep apex(data = economics_long, type = \"area\", mapping = aes(x = date, y = value01, fill = variable)) %>% ax_yaxis(decimalsInFloat = 2) %>% # number of decimals to keep ax_chart(stacked = TRUE) %>% ax_yaxis(max = 4, tickAmount = 4)"},{"path":"/articles/apexcharter.html","id":"scatter-charts","dir":"Articles","previous_headings":"","what":"Scatter charts","title":"Starting with ApexCharts","text":"Simple bar charts can created : Color points according third variable: change point size using z aesthetics:","code":"apex(data = mtcars, type = \"scatter\", mapping = aes(x = wt, y = mpg)) apex(data = mtcars, type = \"scatter\", mapping = aes(x = wt, y = mpg, fill = cyl)) apex(data = mtcars, type = \"scatter\", mapping = aes(x = wt, y = mpg, z = scales::rescale(qsec)))"},{"path":"/articles/apexcharter.html","id":"pie-charts","dir":"Articles","previous_headings":"","what":"Pie charts","title":"Starting with ApexCharts","text":"Simple pie charts can created :","code":"poll <- data.frame( answer = c(\"Yes\", \"No\"), n = c(254, 238) ) apex(data = poll, type = \"pie\", mapping = aes(x = answer, y = n))"},{"path":"/articles/apexcharter.html","id":"radial-charts","dir":"Articles","previous_headings":"","what":"Radial charts","title":"Starting with ApexCharts","text":"Simple radial charts can created (pass values directly aes, can use data.frame) : Multi radial chart (one value):","code":"apex(data = NULL, type = \"radialBar\", mapping = aes(x = \"My value\", y = 65)) fruits <- data.frame( name = c('Apples', 'Oranges', 'Bananas', 'Berries'), value = c(44, 55, 67, 83) ) apex(data = fruits, type = \"radialBar\", mapping = aes(x = name, y = value))"},{"path":"/articles/apexcharter.html","id":"radar-charts","dir":"Articles","previous_headings":"","what":"Radar charts","title":"Starting with ApexCharts","text":"Simple radar charts can created : grouping variable:","code":"mtcars$model <- rownames(mtcars) apex(data = head(mtcars), type = \"radar\", mapping = aes(x = model, y = qsec)) # extremely complicated reshaping new_mtcars <- reshape( data = head(mtcars), idvar = \"model\", varying = list(c(\"drat\", \"wt\")), times = c(\"drat\", \"wt\"), direction = \"long\", v.names = \"value\", drop = c(\"mpg\", \"cyl\", \"hp\", \"dist\", \"qsec\", \"vs\", \"am\", \"gear\", \"carb\") ) apex(data = new_mtcars, type = \"radar\", mapping = aes(x = model, y = value, group = time))"},{"path":"/articles/apexcharter.html","id":"polar-area","dir":"Articles","previous_headings":"","what":"Polar area","title":"Starting with ApexCharts","text":"custom options color mapping:","code":"apex(mtcars, aes(rownames(mtcars), mpg), type = \"polarArea\") %>% ax_legend(show = FALSE) %>% ax_colors(col_numeric(\"Blues\", domain =