charts

ggplot2 timeseries chart with background shading

匆匆过客 提交于 2020-01-02 11:03:27
问题 I have an excel graph that I want to create in R. I tried recreating it with some dummy data a<-rnorm(12) a_ts<-ts(a, start=c(2015, 1), frequency=12) a_time<-time(a_ts) a_series<-ts.union(ret=a_ts, date=a_time) a_series_df<-as.data.frame(a_series) ggplot() + geom_rect(data=data.frame(xmin=decimal_date(as.Date(c("2015-01-01"))), xmax=decimal_date(as.Date(c("2015-05-31"))), ymin=-Inf, ymax=Inf), aes(xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax), fill="pink", alpha=0.5) + geom_line(data = a_series_df

ggplot2 timeseries chart with background shading

北慕城南 提交于 2020-01-02 11:03:13
问题 I have an excel graph that I want to create in R. I tried recreating it with some dummy data a<-rnorm(12) a_ts<-ts(a, start=c(2015, 1), frequency=12) a_time<-time(a_ts) a_series<-ts.union(ret=a_ts, date=a_time) a_series_df<-as.data.frame(a_series) ggplot() + geom_rect(data=data.frame(xmin=decimal_date(as.Date(c("2015-01-01"))), xmax=decimal_date(as.Date(c("2015-05-31"))), ymin=-Inf, ymax=Inf), aes(xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax), fill="pink", alpha=0.5) + geom_line(data = a_series_df

Format time labels in charts_flutter time series chart

折月煮酒 提交于 2020-01-02 09:45:25
问题 I have implemented a time series chart in my flutter app which displays energy data over time: final List<charts.Series<TimeSeriesEnergy, DateTime>> seriesList = [ new charts.Series<TimeSeriesEnergy, DateTime>( id: 'Energy', colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, domainFn: (TimeSeriesEnergy p, _) => p.time, measureFn: (TimeSeriesEnergy p, _) => p.energy, data: data, ) ]; final bool animate = true; var chart = new charts.TimeSeriesChart<TimeSeriesEnergy>( seriesList,

Format time labels in charts_flutter time series chart

落花浮王杯 提交于 2020-01-02 09:45:08
问题 I have implemented a time series chart in my flutter app which displays energy data over time: final List<charts.Series<TimeSeriesEnergy, DateTime>> seriesList = [ new charts.Series<TimeSeriesEnergy, DateTime>( id: 'Energy', colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, domainFn: (TimeSeriesEnergy p, _) => p.time, measureFn: (TimeSeriesEnergy p, _) => p.energy, data: data, ) ]; final bool animate = true; var chart = new charts.TimeSeriesChart<TimeSeriesEnergy>( seriesList,

Chart js: Update line chart having two data sets

安稳与你 提交于 2020-01-02 09:19:26
问题 I want to update a line chart in chart js with two data sets. I've somehow managed to empty the chart and then able to fill in one of the data set. but unable to make both data sets working. here's the code. ajaxRequest( { url: 'reports/updateChart/?filter=true', method: 'post', data: data }, function (response) { /*refresh the tables with the new data sets*/ removeData(myChart); let label = [1, 234, 234, 234, 234, 234, 234, 34, 234, 23, 23, 41, 3, 2, 4]; let data = [234, 234, 5, 23, 34, 234,

Draggind data points and submitting values

纵然是瞬间 提交于 2020-01-02 08:35:25
问题 On page jqPlot there is an example of dragging data point on jqPlot chart. How can I submit (e.g. with jQuery ajax) to server changed values? Are changed (current) values stored somewhere in jqplot object? 回答1: The hardest thing here is knowing when the user drags a point, not getting the data afterward. I recommend you use a postDrawSeries hook like so: $(document).ready(function () { // set up plot $.jqplot.config.enablePlugins = true; s1 = [['23-May-08',1],['24-May-08',4],['25-May-08',2],[

MPAndroidChart is there a way to set different colors for different bars?

ぐ巨炮叔叔 提交于 2020-01-02 07:15:44
问题 I am using MPAndroidChart in my app and i was wondering if there is a way to set a diferent color for the first bar in a dynamically moving bar chart, like this: The bars are added dynamically while the whole stack is being moved to the left as the data keeps coming, is there a way to set the color of the first bar to be a different color? thank you in advance. EDIT and Solution: here is my code for adding a new entry to the chart, it occurs dynamically every 500 millis or so. private void

Chart.js tooltip hover customization for mixed chart

ε祈祈猫儿з 提交于 2020-01-02 07:04:53
问题 I was having some problem when trying to customize the hover tooltip for mixed chart using chart.js. I have a bar chart which show the total profit for certain product and a line chart to show the total quantity of that certain product. When I hover over the bar chart, I wanted the tooltip to show something like: Total profit: $ 1399.30 The price should be in two decimal format appended to the back of 'Total profit: $'. When I hover over the line chart, I wanted to show something like:

Label Values and Total in Google Visualization Stacked Bar Chart

人盡茶涼 提交于 2020-01-02 05:26:46
问题 I am trying to display the value of each bar and then the total value of all bars in a stacked bar chart The problem is, I get the last bar's value and the total both outside the bar. If I do not show the total, I get the value inside the bar. Using the code below the the last two annotations are outside the second bar even when the second bar is long enough to show its label. <html> <head> <base target="_top"> </head> <body> <h3>Registrations</h3> <div id="registrations_chart"></div> </body>

Hide some graphic elements, c3js, without unloading data

烈酒焚心 提交于 2020-01-02 04:46:13
问题 Is it possible to hide certain lines, bars and other graphic elements from a c3js chart, without unloading or hiding data? I wish to keep that data in the tooltip but hide some graphic elements. Hover over one bar and see data for other hidden bars. I know about the hide method - chart.hide(['data2', 'data3']); - but this also deletes the data from the tooltip. My question is not discussed in the documentation it seems. A similar issue in November was not solved. I don't have any code right