Comments (2)
Hi,
This is an example with some StockEvents with stock chart :
### Generate dates ----
start <- as.POSIXct("01-01-2015", format = "%d-%m-%Y")
end <- as.POSIXct("31-01-2015", format = "%d-%m-%Y")
period <- seq.POSIXt(from = start, to = end, by = "hour")
### Generate mesures ----
values <- rnorm(length(period), mean = 500, sd= 200)
data <- data.table(values, date = period)
data[ , date := format(date, "%m-%d-%Y %H:%M:%S")]
amStockChart(theme = "default" , dataDateFormat = "MM-DD-YYYY JJ:NN:SS") %>>%
addDataSet(dataSet(title = "Values", categoryField = "date") %>>%
setDataProvider(data, keepNA = FALSE) %>>%
addFieldMapping(fromField = "values", toField = "values") %>>%
addStockEvent(date = "01-02-2015 23:00:00", type = "sign", graph ="g1",
text = "Event1", description = "This is an event") %>>%
addStockEvent(date = "01-15-2015 23:00:00", type = "sign", graph ="g1",
text = "Event2", description = "This is a second event")) %>>%
addPanel(stockPanel(showCategoryAxis = FALSE, title = "values", percentHeight = 70) %>>%
addStockGraph(id = "g1", valueField = "values", comparable = TRUE,
compareField = "values", balloonText = "[[title]] =<b>[[value]]</b>",
compareGraphBalloonText = "[[title]] =<b>[[value]]</b>") %>>%
setStockLegend(periodValueTextComparing = "[[percents.value.close]]%",
periodValueTextRegular = "[[value.close]]")) %>>%
setChartScrollbarSettings(graph = "g1") %>>%
setChartCursorSettings(valueBalloonsEnabled = TRUE, fullWidth = TRUE,
cursorAlpha = 0.1, valueLineBalloonEnabled = TRUE,
valueLineEnabled = TRUE, valueLineAlpha = 0.5) %>>%
setCategoryAxesSettings(minPeriod = "ss", maxSeries = 1000) %>>%
plot(width = "100%")
from ramcharts.
Hi
It works like a charm. I realized my mistake. I missed dataDateFormat = "MM-DD-YYYY JJ:NN:SS"
Wonderful and very happy with the package. Cheers to the whole team
Regards,
SD
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.