charts

Any easy way to plot a 3d scatter in Python that I can rotate around?

会有一股神秘感。 提交于 2019-12-17 22:32:28
问题 Currently I'm using matplotlib to plot a 3d scatter and while it gets the job done, I can't seem to find a way to rotate it to see my data better. Here's an example: import pylab as p import mpl_toolkits.mplot3d.axes3d as p3 #data is an ndarray with the necessary data and colors is an ndarray with #'b', 'g' and 'r' to paint each point according to its class ... fig=p.figure() ax = p3.Axes3D(fig) ax.scatter(data[:,0], data[:,2], data[:,3], c=colors) ax.set_xlabel('X') ax.set_ylabel('Y') ax.set

How to draw gauge chart in R?

蹲街弑〆低调 提交于 2019-12-17 22:18:47
问题 How can i draw a following plot in R? Red = 30 Yellow = 40 Green = 30 Needle at 52. Pls help me out as i am in great need. Thanks 回答1: So here's a fully ggplot solution. Note: Edited from the original post to add numeric indicator and labels at the gauge breaks which seems to be what OP is asking for in their comment. If indicator is not needed, remove the annotate(...) line. If labels are not needed, remove geom_text(...) line. gg.gauge <- function(pos,breaks=c(0,30,70,100)) { require

How to add a horizontal line at a specific point in chart.js when hovering?

﹥>﹥吖頭↗ 提交于 2019-12-17 22:01:52
问题 I want to be able to add multiple points as a reference place where I can show the horizontal line. Here is an image of what I'm trying to achieve: I want to also make it so that when you don't hover over a point its opacity gets reduced and when you hover over it the opacity is normal. I'm also not sure how to add the square and make the square bigger when hovered hover and it adds the 'wow' text. I appreciate any help. 回答1: You can use chart.js annotations plugin to draw horizontal lines at

Show values on top of bars in chart.js

☆樱花仙子☆ 提交于 2019-12-17 21:52:43
问题 Please refer this Fiddle : https://jsfiddle.net/4mxhogmd/1/ I am working on chart.js If you see in fiddle, you will notice that value which is top on bar is not properly displayed in some cases(goes outside the canvas) While research I came across this link how to display data values on Chart.js But here they used tooltip also for same cases to the text tweak inside of bars. I don't want this. var ctx = document.getElementById("myChart"); var myChart = new Chart(ctx, { type: 'bar', data: {

Issue with displaying Google Chart in a bootstrap tab

别来无恙 提交于 2019-12-17 21:31:41
问题 I have an issue with displaying a Google Chart in a Boostrap tab. I have two tabs, and a Google Chart in each. In the first one, the chart is correctly displayed, but in the second one, the chart is tiny and compressed. I don't understand why.. Here is my code : <div class="tab-pane active" id="player"> <h3>Players' resources</h3> <div id="totalPlayerChart" style="height: 500px;"></div> </div> <div class="tab-pane" id="producer"> <h3>Producers' resources</h3> <div id="totalProducerChart"

MPAndroidChart: How do I get the corresponding chart x-value for a pixel point?

限于喜欢 提交于 2019-12-17 21:13:05
问题 How can I obtain the corresponding x-axis value (xIndex) of a pixel point in a ScatterChart? I have been looking through the source code of the library and I think that one of the methods below (which I copy/pasted from the source code from the library here) can help. It seems getValuesByTouchPoint is the correct method but I don't know how to use it. /** * Transformer class that contains all matrices and is responsible for * transforming values into pixels on the screen and backwards. * *

Is it possible to set a chart datasource from a generic list?

我是研究僧i 提交于 2019-12-17 21:12:49
问题 I have a list created from a linq query that contains 2 columns of data. var result = root.Descendants().Elements("sensor") .Where(el => (string)el.Attribute("name") == "Sensor1") .Elements("evt") .Select(el => new { t1 = el.Attribute("time").Value, v1 = el.Attribute("val").Value }) .ToList() I'm trying to use the chart control datasource to use that list, but when I call the bind method I receive this error: System.ArgumentException was unhandled HResult=-2147024809 Message=Series data

Stacked Column Chart in C#

ぐ巨炮叔叔 提交于 2019-12-17 21:08:06
问题 I am trying to set up my program so that the user can display a stacked column chart that displays the number of reject categories that appear in each department (for example, 5 appear in department 1, 3 in department 2, etc). I've had a look around online and taken a crack at it myself but I cannot seem to get it working. If anyone would be able to help that would be fantastic. What the chart currently does when the user presses a button to switch to a stacked column chart: Code: private

Rendering Swing component smoothly every 500 millisecond

*爱你&永不变心* 提交于 2019-12-17 20:52:43
问题 I am facing rendering problem when I call paintComponent() every 500 millisecond to show updated charts. I have around 30 barcharts created by using JFreeChart on Panel . Rendering with error and How can I solve this problem? private void ShowGraphs() { FirstChart.removeAll(); SecondChart.removeAll(); ThirdChart.removeAll(); FirstChart.add(Label1); SecondChart.add(Label2); ThirdChart.add(Label3); ChartUpdate(P1,FirstChart); ChartUpdate(P2,SecondChart); ChartUpdate(P3,ThirdChart); //FirstChart

Make Chart Legend represent two colors

大兔子大兔子 提交于 2019-12-17 20:29:27
问题 I created a column chart in my application which look like this: As you can see the positive values are green and the negative values are red. I need to represent this in the legend. I just don't know how. What I already tried: I added CustomItems to the Legend . Here is the code: Legend currentLegend = chart.Legends.FindByName(chart.Series[series].Legend); if (currentLegend != null) { currentLegend.LegendStyle = LegendStyle.Table; LegendItem li = new LegendItem(); li.Name = series; li.Color