Giter Club home page Giter Club logo

ramcharts4's Introduction

rAmCharts4


Copies of license agreements

The 'rAmCharts4' package as a whole is distributed under GPL-3 (GNU GENERAL PUBLIC LICENSE version 3).

It includes other open source software components. The following is a list of these components:

Full copies of the license agreements used by these components are included in the file LICENSE.note.

ramcharts4's People

Contributors

stla avatar stlagsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ramcharts4's Issues

Disable labels in piecharts

Hi! Thank you for the library, it's been really helpful! I was trying to disable the labels on pie charts, but didn't have any sucess. Is there a way to do it?

More manipulations

Hello Stéphane, I would like to thank you for this amazing repo. I am trying to use the draggable bar chart on a website that I am developing for education in bayesian interfaces. I was wondering if there are more manipulations possible, for eg: having the user input a value in a table to change the the chart.

Race Bar

Hi...
How to produce bar race using the package?

Export functionality

Hi - Just wanted to check if exporting functionality (export data to Excel, Image ) is available in this awesome charting library.

amCharts not always disposed when rendered together DT::datatables in dynamic UI

I encountered some problems with dynamic UI (created using renderUI or insertUI/removeUI) and dispose of previous charts in Shiny. The values of the charts are used to fill tables created using DT::renderDataTable and therefore the use of renderUI is necessary to show contemporary dynamically created datatables and graphs.
According to my experience, it is like that previous charts are not always disposed and therefore they stop the rendering of new ones.
In fact, after a query a new UI is recreated (renderUI) or inserted (insertUI) but very often graphs (especially if the ID is the same) are not rendered, even if the DIV is closed and reopened. The same will not occur using plot_ly .
The only way (and not in all the cases) I found to overpass this limitation is to pass to renderUI the datatable and amChart as a list without using amChart4Output, but than I had other problems, i.e. reactive values linked to amCharts (e.g. input[["linecharts"]] and used as datasets in the tables were not updated.
See a short (datatable and charts are not linked here) reproducible example as follow (just try to create different UI, remove one or all of them and recreate with the same ID).
Thank you in advance for your help and suggestions,
Kind regards


library(shiny)
library(plotly)
library(rAmCharts4)
rm(list = ls(all.names = TRUE)) #will clear all objects includes hidden objects.
gc() #free up memory and report the memory usage.

ui <- fluidPage(
textInput("divID", "Enter an ID for the custom area:", ""),
helpText("Leave the text input blank for automatically unique IDs."),
actionButton("isrt", "Add a datatable"),
tags$div(id = "placeholder"),
uiOutput("prova")
)

server <- function(input, output, session) {
rv <- reactiveValues()
dat2 <- data.frame(
country = c("USA", "China", "Japan", "Germany", "UK", "France"),
visits = c(3025, 1882, 1809, 1322, 1122, 1114)
)

take a dependency on isrt button

observeEvent(input$isrt, {

# handle the case when user does not provide ID
divID <- if (input$divID == "") gsub("\\.", "", format(Sys.time(), "%H%M%OS3"))
else input$divID
dtID <- paste0(divID, "DT")
dt2ID <- paste0(divID, "DT2")
btnID <- paste0(divID, "rmv")
plotlyID <- paste0(divID, "plotly")
amChartID <- paste0(divID, "amChart")

# only create button if there is none
if (is.null(rv[[divID]])) {
  # output$prova <- renderUI({
  #   plotlist <- list(
  #   actionButton("download", "button1", class = "pull-right btn btn-danger"),
  #   actionButton("upload", "button2", class = "pull-right btn btn-danger"),
  #   actionButton("modify", "button3", class = "pull-right btn btn-danger"),
  #   actionButton(btnID, "Remove this UI", class = "pull-right btn btn-danger"),
  #   DT::dataTableOutput(dtID),
  #   DT::dataTableOutput(dt2ID),
  #   plotlyOutput(plotlyID),
  #   amChart4Output(amChartID, height = "500px"),
  #   hr()
  #   )
  #   do.call(tagList, plotlist)
  # })
  insertUI(
    selector = "#placeholder",
    ui = tags$div(id = divID,
                  actionButton("download", "button1", class = "pull-right btn btn-danger"),
                  actionButton("upload", "button2", class = "pull-right btn btn-danger"),
                  actionButton("modify", "button3", class = "pull-right btn btn-danger"),
                  actionButton(btnID, "Remove this UI", class = "pull-right btn btn-danger"),
                  DT::dataTableOutput(dtID),
                  DT::dataTableOutput(dt2ID),
                  plotlyOutput(plotlyID),
                  amChart4Output(amChartID, height = "500px"),
                  hr()
    )
  )

  output[[dtID]] <- DT::renderDataTable(head(iris))
  output[[dt2ID]] <- DT::renderDataTable(head(cars))
  output[[plotlyID]] <- renderPlotly(
    plot_ly(data = cars, x= ~speed, y = ~dist)
  )
  output[[amChartID]] <- renderAmChart4({
    amBarChart(
      data = dat2,
      data2 = dat2,
      width = "600px",
      category = "country", values = "visits",
      draggable = TRUE,
      tooltip =
        "[bold font-style:italic #ffff00]{valueY.value.formatNumber('#,###.')}[/]",
      chartTitle =
        amText(text = "Visits per country", fontSize = 22, color = "orangered"),
      xAxis = list(title = amText(text = "Country", color = "maroon")),
      yAxis = list(
        title = amText(text = "Visits", color = "maroon"),
        gridLines = amLine(color = "orange", width = 1, opacity = 0.4)
      ),
      yLimits = c(0, 4000),
      valueFormatter = "#,###.",
      caption = amText(text = "Year 2018", color = "red"),
      theme = "material")
  })
  # make a note of the ID of this section, so that it is not repeated accidentally
  rv[[divID]] <- TRUE

  # create a listener on the newly-created button that will
  # remove it from the app when clicked
  observeEvent(input[[btnID]], {
    removeUI(selector = paste0("#", divID))

    rv[[divID]] <- NULL

  }, ignoreInit = TRUE, once = TRUE)

  # otherwise, print a message to the console
} else {
  message("The button has already been created!")
}

})
}

shinyApp(ui = ui, server = server)

Parameters to updateAmBarChart

Thank you for the awesome package, I really like it a lot!
I noticed that the yLimits will not adjust on updateAmBarChart, when yLimits = NULL and expandY is set to some number, but will stay constant. Would it be possible to pass other parameters (for example chartTitle, chartYLabel, yLimits) than the new data to the updateAmBarChart function? Would be nice to have if the data updates based on user input and has a large variability.

Custom export functionality

Thanks a ton for this great package. Would be great if you can add export functionality to export data used in chart in excel or CSV format. Menu button shown in this link for export (previous version of ramcharts) is very useful -

Export

Export chart in formats:
“.png”
“.svg”
“.jpg”
“.pdf”

Here you can also export the dataProvider in formats:
“.xlsx”
“.csv”

Bullets point wrongly positioned or disappeared after zoom-in and zoom-out

1

2

3

Dear Staff,
I uploaded some basic examples (fig.1 to 3 ) of the encountered issue. By dragging up and down the bullets the zoom-in feature change the plot and some bullets are therefore positioned in wrong position (picture 2) or even, if there is a horizontal drag of one bullet (e.g. during the creation of the zoom square window) it disappears (picture 3).
Currently, solved by using the amBarChart that it does not have this issue but it would be nice to fix the problem so that amLineChart can be used without problems for plotting continuous functions.
Thanks in advance for your help.
Kind regards,
Whakaoo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.