inst/test/script_test.R

require(magrittr)
require(rAmCharts4)

amCharts4(data = data.frame(country = c("Lithuania", "Ireland"), litres = c(10, 20)),
          type = "PieChart",
          series = list(list(type = "PieSeries",
                             dataFields = dataFields(value = "litres",
                                               category = "country"))),
          responsive = list(enabled = TRUE))



data = data.frame(country = c("Lithuania", "Ireland"), litres = c(10, 20))
amPieChart() %>% amc_data(data) %>%
  amc_series(type = "PieSeries",
                  dataFields = dataFields(value = "litres",
                                    category = "country")) %>%
  amc_legend()

amPieChart(data = data)  %>%
  amc_series(type = "PieSeries",
             dataFields = dataFields(value = "litres",
                               category = "country")) %>%
  amc_legend()


amXYChart(data = data)  %>%
  amc_xAxes(type = "CategoryAxis",
            dataFields = list(category = "country", title = list(text = "Countries"))
  ) %>%
  amc_yAxes(type = "ValueAxis") %>%
  amc_series(type = "ColumnSeries",
             dataFields = dataFields(valueY = "litres",
                               categoryX = "country")) %>%
  amc_legend() %>% amc_cursor()
datastorm-open/rAmCharts4 documentation built on Oct. 13, 2019, 5:15 a.m.