Comments (3)
Hi,
Can you first send us some code ?
from ramcharts.
I will give this a try.
Let us use some large data sets
http://ichart.yahoo.com/table.csv?s=GOOG&a=0&b=1&c=2000&d=0&e=31&f=2015&g=d&ignore=.csv
Now we try and plot a stockChart out of it.. Say it takes us 3-4 seconds to pull the data and extract the chart. Now if we parameterize the StockGraphType using a radio button. Now every time the radio button is changed, the entire plot is built from scratch once again because of the reactive nature of render function and hence takes ~3-4 seconds each time the radio button option is changed.
Now when you compare this with the below Javascript version of the example, ValiDateNow() is triggered which only changes the chart type instead of building the entire chart from scratch and hence boosts the performance.
JS Fiddle: http://jsfiddle.net/amcharts/32usT/
Shiny Code:
ui.R
shinyUI(fluidPage(
useShinyjs(),
fluidRow(
column(12,radioButtons("fcharttype4", label =NULL, choices = c("candlestick"="candlestick",
"ohlc"="ohlc",
"line" = "line"),
selected = "line",inline = TRUE, width = NULL)),
column(12,amChartsOutput("fspanel4a",height="100%"))
)
))
server.R
server = function(input, output, session) {
Prepare the Data - This is the data from the URL
datagoog<-fmydata4[,c("Date","Close","Volume")]
datagoog$Date = format(as.Date(datagoog$Date),"%Y-%m-%d")
Render the Chart
output$fspanel4a <- renderAmCharts({
K1<-pipeR::pipeline(
amStockChart(startDuration = 0,
theme = "light"),
addDataSet(dataSet(title = "Main",
categoryField = "Date",
compared=TRUE,
dataProvider = data.table(datagoog)) %>>%
addFieldMapping(fromField = "Close",
toField = "Close") %>>%
addFieldMapping(fromField = "Volume",
toField = "Volume")),
addPanel(stockPanel(showCategoryAxis = FALSE, title = 'Price', percentHeight = 70) %>>%
addStockGraph(id = 'g1',
valueField = "Close",
type=input$fcharttype4,
comparable = TRUE,
balloonText = '[[title]] =<b>[[value]]</b>',
compareGraphBalloonText = '[[title]] =<b>[[value]]</b>') %>>%
setStockLegend(periodValueTextComparing = '[[percents.value.close]]%',
periodValueTextRegular = '[[value.close]]') %>>%
addListener('zoomed', 'function(event) {alert("zoomed")}')),
addPanel(stockPanel(title = 'Volume',
percentHeight = 30) %>>%
addStockGraph(valueField = "Volume",
type = "column",
fillAlphas = 1) %>>%
setStockLegend(periodValueTextRegular = '[[value.close]]')),
setChartScrollbarSettings(graph = 'g1'),
setChartCursorSettings(valueBalloonsEnabled = TRUE,
fullWidth = TRUE,
cursorAlpha = 0.1,
valueLineBalloonEnabled = TRUE,
valueLineEnabled = TRUE,
valueLineAlpha = 0.5),
setPeriodSelector(periodSelector(position = 'left') %>>%
addPeriod(period = 'DD', selected = TRUE, count = 7, label = '1 week') %>>%
addPeriod(period = 'MAX', label = 'MAX') %>>%
addListener('changed', 'function(event) {alert("changed")}')),
setDataSetSelector(dataSetSelector(position = 'left') %>>%
addListener('dataSetCompared', 'function(event) {alert("dataSetCompared")}')),
setPanelsSettings(recalculateToPercents = FALSE)
)
})
}
So the question is how can we intelligently change parameters within the AmStockChart without having to rebuild it every time
from ramcharts.
The latest version of amCharts renders at a very high speed so closing the issue
from ramcharts.
Related Issues (20)
- Setting Axis via minimum and maximum properties not working HOT 7
- amTimeSeries, different hours are grouped at the same hour on the x-axis ? HOT 2
- pieChart with broken slices
- Functionality to create Time-lapse animation in rAmCharts HOT 3
- Display message when amCharts renders a chart onto screen HOT 1
- Compatibility with IE HOT 1
- jquery slider with rAmChart HOT 1
- amBoxplot with formula in shiny not working HOT 2
- Issue with amTimeSeries (groupToPeriods) HOT 1
- Example of stacked area / line chart? HOT 4
- amTimeSeries dont work with time < minute HOT 1
- multiple value axes HOT 1
- [Question] hyperlink on waterfall chart
- Default handling of date/time basis dataset for amStockMultiSet
- amchart v4 ? HOT 3
- how to apply my paid license on rAmchart
- [Question] Number formatting ? HOT 1
- Number formatting for amAngularGauge() HOT 1
- Error when calling plot()
- donut pie legend entries: sorting doesn't work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ramcharts.