charts

Adding percentage labels on pie chart in R

淺唱寂寞╮ 提交于 2019-12-17 19:53:43
问题 My data frame looks like df Group value 1 Positive 52 2 Negative 239 3 Neutral 9 I would like to make a pie chart of the data frame using ggplot. pie <- ggplot(df, aes(x="", y=value, fill=Group)) + geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) This is my pie chart. But when I try to add percentage labels on the chart pie <- ggplot(df, aes(x="", y=value, fill=Group)) + geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) + geom_text(aes(y = value/2 + c(0,

MySQL - fill missing dates [duplicate]

橙三吉。 提交于 2019-12-17 19:30:18
问题 This question already has answers here : MySQL how to fill missing dates in range? (4 answers) Closed 2 years ago . I have this query and I want to fill missing dates with some values (zero for example...) SELECT date, SUM(val1) as sum_val FROM table1 WHERE date BETWEEN '2016-03-04' AND '2016-03-10' GROUP BY date Here is result: |-------------------------- |date, sum_val |-------------------------- |2016-03-04, 21568 |-------------------------- |2016-03-05, 14789 |--------------------------

How can I fill the area(s) between two Series of Splines or Lines

a 夏天 提交于 2019-12-17 19:25:35
问题 I have this Chart : How can I fill the area between two Series S0 and S1 , say the blue and the yellow Series ? 回答1: To do that we code one of the Paint events: Here the ValueToPixelPosition functions are valid and provide us with the necessary conversion between the DataPoint values and Chart pixels..: private void chart1_Paint(object sender, PaintEventArgs e) { // we assume two series variables are set..: if (sps1 == null || sps2 == null) return; // short references: Axis ax = chart1

Morris graphs. Have custom tooltip when hover

丶灬走出姿态 提交于 2019-12-17 18:55:56
问题 I am using morris.js (which has a dependency on raphael) for creating stacked bar graphs. For each stacked bar I want to show the split for the various levels in the bar as a tooltip. I tried using the hoverCallback: but it doesn't seem to give me control over the particular element I am hovering over. I only get the content for that particular bar. I have setup a JSBIN example for the same here: When you hover over the bar it shows the index of the bar at the bottom. I want to show the

Chart.js Show labels on Pie chart

元气小坏坏 提交于 2019-12-17 18:27:59
问题 I recently updated my charts.js library to the most updated version (2.5.0). This version doesn't show the labels on the chart. I have an example of working one on fiddler: http://jsfiddle.net/g6fajwg8 . However, I defined my chart exactly as in the example but still can not see the labels on the chart. Note: There are a lot of questions like this on Google and Stackoverflow but most of them are about previous versions which is working well on them. var config = { type: 'pie', data: {

show label in tooltip but not in x axis for chartjs line chart

爱⌒轻易说出口 提交于 2019-12-17 18:27:24
问题 I currently am using a line chart with chart.js, and have a label set that looks like this ["January 2015", "February 2015", "March 2015", "April 2015", "May 2015", "June 2015"] . I want the relevant label to show up in the tooltip for the chart, but only want every alternating label to show up on the x axis of the chart to prevent crowding. Is there a way I can achieve this ? I am currently replacing every second value from my array with "", but while that removes the crowding from my x axis

Remove x-axis label/text in chart.js

末鹿安然 提交于 2019-12-17 17:53:55
问题 How do I hide the x-axis label/text that is displayed in chart.js ? Setting scaleShowLabels:false only removes the y-axis labels. <script> var options = { scaleFontColor: "#fa0", datasetStrokeWidth: 1, scaleShowLabels : false, animation : false, bezierCurve : true, scaleStartValue: 0, }; var lineChartData = { labels : ["1","2","3","4","5","6","7"], datasets : [ { fillColor : "rgba(151,187,205,0.5)", strokeColor : "rgba(151,187,205,1)", pointColor : "rgba(151,187,205,1)", pointStrokeColor : "

Cardio graph for android

萝らか妹 提交于 2019-12-17 17:53:12
问题 I want to make an app which shows cardio graph in real time. That means i want to measure heart bit and want to show the bit rate in graph in my application. But i wondering to draw the cardio graph. I have gone through many sample graph codes but dint get any clue to draw cardio graph. Is there any clue from any body? 回答1: For this specific application, you may want to draw the graph "by hand" using Path and a SurfaceView. Get a Paint instance ready during initialization: Paint paint = new

Bar chart using achartengine

风流意气都作罢 提交于 2019-12-17 17:46:13
问题 I want to draw a bar chart which contains five individual bars - I have used Achartengine. I am able to display all five bars in the same color but I want to differentiate one bar with a different color, but I cant display more than one color. Please show me how to display different colors. My code... values.add(new double[] {21,56,33,10,20}); int[] colors = new int[] { Color.rgb(227, 121, 15) }; XYMultipleSeriesRenderer renderer = buildBarRenderer(colors); setChartSettings(renderer, "", "",

Chart creating dynamically. in .net, c#

我们两清 提交于 2019-12-17 17:34:22
问题 Does anybody have some experience working with charts in .NET ? Specially I want to create them programmatically. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using System.Diagnostics; namespace WindowsFormsApplication6 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }