chart

ggplot2 line chart gives “geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic?”

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: With this data frame ("df"): year pollution 1 1999 346.82000 2 2002 134.30882 3 2005 130.43038 4 2008 88.27546 I try to create a line chart like this: plot5 <- ggplot ( df , aes ( year , pollution )) + geom_point () + geom_line () + labs ( x = "Year" , y = "Particulate matter emissions (tons)" , title = "Motor vehicle emissions in Baltimore" ) The error I get is: geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic? The chart appears as a scatter plot even though I want a line chart. I

ggplot2 pie and donut chart on same plot

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to replicate this with R ggplot. I have exactly the same data: browsers and it looks like this: > browsers browser version share ymax ymin 1 MSIE MSIE 6.0 10.85 10.85 0.00 2 MSIE MSIE 7.0 7.35 18.20 10.85 3 MSIE MSIE 8.0 33.06 51.26 18.20 4 MSIE MSIE 9.0 2.81 54.07 51.26 5 Firefox Firefox 3.5 1.58 55.65 54.07 6 Firefox Firefox 3.6 13.12 68.77 55.65 7 Firefox Firefox 4.0 5.43 74.20 68.77 8 Chrome Chrome 10.0 9.91 84.11 74.20 9 Safari Safari 4.0 1.42 85.53 84.11 10 Safari Safari 5.0 4.55 90.08 85.53 11 Opera Opera 11.x 1.65 91.73

Click events on Pie Charts in Chart.js

匿名 (未验证) 提交于 2019-12-03 02:51:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've got a question regard Chart.js. I've drawn multiple piecharts using the documentation provided. I was wondering if on click of a certain slice of one of the charts, I can make an ajax call depending on the value of that slice? For example, if this is my data var data = [ { value: 300, color:"#F7464A", highlight: "#FF5A5E", label: "Red" }, { value: 50, color: "#46BFBD", highlight: "#5AD3D1", label: "Green" }, { value: 100, color: "#FDB45C", highlight: "#FFC870", label: "Yellow" } ], is it possible for me to click on the Red labelled

dc.js - Listening for chart group render

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to refactor some custom d3 code that I wrote to render a series of crossfilter-driven charts by bringing in dc.js. My main problem is that I have some chart types that are not supported by dc.js (e.g. a Sunburst Partition ) and I'm trying to figure out how to render them in conjunction with a dc.js chart group. Filtering a single dc.js chart will automatically render / redraw all other charts belonging to the same chartGroup . Is it possible to somehow hook into that global re-render event, so that I can re-draw the non-dc charts

HighCharts turn animation false for line chart

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to highCharts and want to know how I can turn off the animation for line charts. I've tried setting it to false in plotlines but no success. Thanks 回答1: It's the same that I answered here but you have to change column to line . plotOptions: { line: { animation: false } } demo If you want to remove animation from all types you can use series instead. 回答2: If you want to completely disable all animations in Highcharts (also these happening when toggling lines on or off) use the following: chart: { animation: false } See http://api

PHP MySQL Google Chart JSON - Complete Example

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have searched a lot to find a good example for generating a Google Chart using MySQL table data as the data source. I searched for a couple of days and realised that there are few examples available for generating a Google Chart (pie, bar, column, table) using a combination of PHP and MySQL. I finally managed to get one example working. I have previously received a lot of help from StackOverflow, so this time I will return some. I have two examples; one uses Ajax and the other does not. Today, I will only show the non-Ajax

Chart.js - Formatting Y axis

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Chart.js to draw a simple bar plot and I need to format its Y axis like 123456.05 to 123 456,05 $ I don't understand how to use scaleLabel : "<%=value%>" I saw someone pointing to " JS Micro-Templating ", but no clue how to use that with our scaleLabel option. Does someone know how to format this Y axis, and maybe give me an example ? 回答1: An undocumented feature of the ChartJS library is that if you pass in a function instead of a string, it will use your function to render the y-axis's scaleLabel. So while, "<%= Number(value)

Highcharts Marimekko chart refresh

匿名 (未验证) 提交于 2019-12-03 02:42:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The script below builds a basic Marimekko chart where the x-values are cumulative. This is awesome as an exciting way to plot data. http://jsfiddle.net/Guill84/1o926coh/ Unfortunately, when you toggle areas in the legend, the script simply 'hides' the areas concerned, meaning that there are gaps in the chart. How could I amend this script so the "allSeries" array is recalculated each time a button in the legend is toggled? To repeat and hopefully clarify what I'm after: tHe idea is that if I remove the green area, then the black and orange

parsing json to bar chart d3js

匿名 (未验证) 提交于 2019-12-03 02:42:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to create a bar chart using the json url. With respect to impressions and time. I don't think I'm referencing the data correctly at .data(data) how do I access the impressions field from json file in d3? var url = "https://script.google.com/macros/s/AKfycbwy56QiQwyfkkaLFWZ33QHVieAHhtLJYNa_AzKcCBr-J7Catgv2/exec?id=1vQsWQPUET20KcgeRKgs5NOOBngqLeUuNTHI1bWi5Et8&sheet=Sheet1"; d3.json(url, function(data) { console.log(data.Sheet1[0]); var canvas = d3.select("body").append("svg") .attr("width", 500) .attr("height", 500) canvas.selectAll

PyQt And MatPlotLib - (Embedded) Pie Chart without PyPlot

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to embed a pie chart of data produced by an analytics class method in my PyQt GUI. Using PyPlot or PyLab I have been able to plot the chart but only in a separate window. class MyMplCanvas(FigureCanvas): def __init__(self, parent=None, width=5, height=4, dpi=100): fig = Figure(figsize=(width, height), dpi=dpi) self.axes = fig.add_subplot(111) self.compute_initial_figure() FigureCanvas.__init__(self, fig) self.setParent(parent) FigureCanvas.setSizePolicy(self, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) FigureCanvas