w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Bubble chart , scatter chart ,candlestick chart using core plot
Core Plot natively supports scatter plots and candlestick charts. You can make a bubble chart easily by using custom plot symbols for a scatter plot and varying the size of the plot symbols to represent the third variable.

Categories : IOS

Plot data labels in a line chart
First lets prepare the data prices<- c(100,101,102,103,104,105,108,107,106,105,104,100,98,97,94,90,88,89,89,90,91,90,92,90,94,95,90,89,84,89,80,91,94,94,95,98,103,110,112,70,65) date<- Sys.Date() -41:1 library(quantmod) data<- xts(prices,date) colnames(data) <- "price" Now we want to find local maxima minima. We'll use the ZigZag overlay to smooth the graph chart_Series(data) data$n <- 1:nrow(data) data$z <- ZigZag(data$price , change = 2 , percent = T) add_TA(data$z , on = 1 ,col = 'red' , lty = 3 , type = 'l') ex <- data[c(findPeaks(data$z) , findValleys(data$z)) - 1 , ] add_TA(ex$z , on = 1 , col = 'red' , cex = 2 , type = 'p') Now all we have left is to add the labels text(x = ex$n , y = (ex$z) * 0.99 , label = ex$price) And the result

Categories : R

How to create pie chart with pyqtgraph.GraphicsWindow and create custom scale in x axis
For the first problem, pyqtgraph has no built-in pie chart graphics. However, these should be fairly simple to construct by creating one QGraphicsEllipseItem for each wedge. For the second, use the following: majorTickValues = [(0,"5"),(1,"7"),(2,"16")] plotItem.getAxis('bottom').setTicks([majorTickValues])

Categories : Python

How to read and plot time series data files as candlestick chart?
To read in this data set from the clipboard do from pandas import read_clipboard from matplotlib.dates import date2num names = ['date', 'open', 'close', 'high', 'low'] df = read_clipboard(sep=',', names=names, parse_dates=['date']) df['d'] = df.date.map(date2num) The top-level pandas.read_csv function works similarly to pandas.read_clipboard, if you have this data sitting in a CSV or some other type of character-delimited file. Now on to plotting: from matplotlib.pyplot import subplots, draw from matplotlib.finance import candlestick seconds_per_day = 60 * 60 * 24 fig, ax = subplots() candlestick(ax, df[['d', 'open', 'close', 'high', 'low']].values, width=1.0 / seconds_per_day) ax.xaxis_date() draw() gives

Categories : Python

How to create a custom gui design for a python program?
Custom GUIs with wxPython/wxWidgets You are correct that in general wxWidgets aims to provide a native look and feel by usually and by default using standard controls however the option exists not to do so. Install wxPython, in a recent version, then install the Docs & Demos package for the same version, and then run the demo and navigate to the Advanced Generic Widgets tab and you will find just about all of the features you are asking for demonstrated in the AUI demo. It does mention custom close, minimise, etc., the only thing you mention that is not in that one demo is gradient buttons. You will also find demos of gradient & aqua buttons, and a Zoom Bar - a la Mac but platform independent. screenshots of the AUI demo & the demo package on zoom bar are attached: wxPytho

Categories : Python

.NET Chart Box Plot Bleeding outside chart area
Are you setting the Min and Max values yourself or letting the control decide? Try setting them to auto. chart1.ChartAreas[0].AxisY.Maximum = double.NaN; chart1.ChartAreas[0].AxisY.Minimum = double.NaN;

Categories : Asp Net

How to create/design data strutures?
The IP header structure is specified in RFC 791: https://tools.ietf.org/html/rfc791#page-11 The struct combines version (4bit) and ihl (4bit) in one BYTE (8bit) and Flags(3bit)/Fragmentation (13bit) in a WORD (16bit). All other parts are mapped one-to-one to BYTE (8bit), WORD(16bit) and DWORD(32bit). Note: BYTE / WORD / DWORD are no C++ datatypes, this is probably defined somewhere in the code like this: typedef unsigned char BYTE; // 1byte typedef unsigned short WORD; // 2bytes typedef unsigned long DWORD; // 4bytes

Categories : C++

how to make custom doughnut Chart from aChartEngine in Android?
For label and background you can use overlay, using another views one below for the background and another on top for the label, all than inside the same ViewGroup with the same metrics, it is easier I guess. But for the border you will need to change on the class DoughnutChart at char engine source code, more specifically at method draw. I do not test, but probably this should solve your problem: paint.setStyle(Paint.Style.STROKE); paint.setStrokeWidth(strokeWidth); paint.setStrokeCap(Paint.Cap.SQUARE); after this line: paint.setColor(mRenderer.getSeriesRendererAt(i).getColor());

Categories : Android

how do you create a ggplot chart with subsetting the data
you need to pass the data as a named argument geom_line(data=subset(...), ...) since data is the second argument. You could also reverse your aes and subset in geom_line to accomplish the same thing. Take a look at ?geom_line for more info.

Categories : R

Rails - Create array for Highcharts Chart data
Initialize a variable before the definition of the series: array_of_records = ServerStatus.success.find(:all, :select => 'generated_at, count', :conditions => {:generated_at => DateTime.strptime("07/25/2013", '%m/%d/%Y').beginning_of_day..DateTime.strptime("07/25/2013", '%m/%d/%Y').end_of_day}, :order => 'generated_at ASC').to_json and then, inside the series definition, define data as follows: data: <%= array_of_records.map { |record| [record["generated_at"], record["count"]] } %>

Categories : Ruby On Rails

How to create Android custom keyboard OR write custom Dictionary
Refer this link, http://www.fampennings.nl/maarten/android/09keyboard/index.htm. Hope this will help you

Categories : Java

How to create a pairs-plot (matrix-like plot) with `grid`?
I think you can divide the task in two main parts, like the basic examples in grid.panel() and grid.multipanel() 1- build a function that will produce a single panel, returned as a gTree. You need to figure out all the parameters, i.e. limits, axes, colours, shapes, grid, coordinates, ... You might end up rewriting lattice panel functions and axes, grid.newpage() grid::grid.panel(vp=viewport(width=0.8, height=0.8)) 2- assemble the panels in a layout. This is much easier (and cleaner) with gtable, library(gtable) grid.newpage() lg <- replicate(16, grobTree(rectGrob(), pointsGrob()), simplify=FALSE) gt <- gtable_matrix("pairs", grobs=matrix(lg, ncol=4), widths=unit(rep(1, 4), "null"), heights=unit(rep(1, 4), "null")) gt <- gtable_add

Categories : R

Redraw chart by passing new data to Data Table in Google Chart using javascript
You need to assign an "onchange" event handler to your radio buttons that calls the drawChart function. If the value of the hidden input is being changed at the same time, you should probably tack on the drawChart call to the end of that code instead of creating a new event handler, to make sure that things happen in the correct order.

Categories : Javascript

Create Highchart (Column chart) and read data from external json file
after you recieve the response (I mean the JSON) in success call back pass the response.data to a routine which will parse this JSON data as accepted by Highcharts. series:[{ name: 'series 1' data: [1,2,4,5,6,74] },{ name: 'series 2' data: [1,2,4,5,6,74] },{ name: 'series 3' data: [1,2,4,5,6,74] }] you can exclude name if you don't want to give a specific name to every series. although highcharts generates unique name for every series. to get the column chart set the type to column. chart:{ type: 'column' }

Categories : Javascript

Plotting JTransform data with Android Plot
When you say the code shuts down, what do you mean? Does it freeze indefinitely and no stack trace is produced or does the application actually crash and produce a stack trace? If it's the former, can you run the app in debug mode and check whether or not its freezing somewhere in the Androidplot library? If it's the latter, could you provide the stack trace? A couple thoughts on the code above: First, from what I remember, FFT's can be -very- cpu intensive operations. Maybe not as bad as their DFT counterparts, but from the CPU/main thread's perspective still very heavy duty. I can't tell for sure but appears that you are doing all your FFT processing on the main thread, which is bad. I'd strongly suggest doing those calculations on a background thread. There's a fair chance thi

Categories : Android

Create line chart using Google Chart API and JSON for DataTable
The problem is a very small typo. In the JSON, row should be rows. Eg, changing the example JSON to var result = { "cols":[ {"type":"string"}, {"type":"number"}], "rows":[ {"c":[{"v":"20-01-13"}, {"v":22}]}, {"c":[{"v":"21-01-13"}, {"v":24}]}, {"c":[{"v":"22-01-13"}, {"v":27}]} ]}; and your code works : Update Look at Format of the Constructor's JavaScript Literal data Parameter You need to wrap each "c"-section into brackets and also misses "v" (value indicator) for the first column. Your updated test JSON is "cols": [ {"type":"string"},{"type":"number"} ], "rows":[ {"c":"20-01-13"},{"v":35}, {"c":"21-01-13"},{"v":30} ] } giving a "can't read 0 of undefined", becuase it should be { "cols":[ {"type":"string"},{"type":"number"} ], "rows":[

Categories : Javascript

Plot Smith Chart in R
Revised code based on the comment from Carl Witthoft: #!/usr/bin/rscript --vanilla filename='smith_chart.pdf' pdf(filename, 6, 6) # applies conformal map (z-1)/(z+1) to complex number z cmap <- function(z) (z-1)/(z+1) plot.new() plot.window(c(-1, 1), c(-1, 1), asp = 1) dd <- c(seq(-100, 100, 1), seq(-10, 10, 0.1), seq(-2, 2, 0.02)) dd <- round(dd, digits = 2) # fix roundoff errors dd <- sort(unique(dd)) # remove duplicates smith_grid <- function (val, step) { # applies conformal map to lines having fixed real component r_grid <- outer(1i * dd[dd >= -val & dd <= val], seq(0, val, step), '+') r_grid <- cmap(r_grid) matlines(Re(r_grid), Im(r_grid), lwd = 0.5, col = 1, lty = 1) # applies conformal map to lines having fixed imaginary component x_

Categories : R

How to plot pseudo-3d bar chart in matplotlib?
The thickness of the bars are set by the dx, dy arguments in ax.bar3d for which you have the values 0.5, 0.001. The issue, as I'm sure you noticed is that changing dy will change the length of the bar (in your case the untitled axis), but matplotlib helpfully rescales the y axis so the data fills it. This makes it look strange (I am assuming this is the problem, sorry if it isn't). To remedy this you could set the y limits using ax.set_ylim(0, 0.002) (basically your y values go from 0->0.001). If you change either dy or the value of y given to bar3d which is currently 0, then you will need to update the limits accordingly. Example: from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np row = [0, 0, 0, 22, 0, 0, 4, 16, 2, 0, 4, 4, 12, 26] length = le

Categories : Python

How to plot bar chart wth continous coloring
I would comment on this, but not enough rep yet... Your problem with the Diamonds data set is that the data is discrete, meaning each value / observation belonging to it is distinct and separate. In order to do a continuous fill you need continuous data (values / observations belonging to it may take on any value within a finite or infinite interval). When you have a continuous data set you can use the following ggplot2 command: scale_colour_gradient. EDIT You can try this: ggplot(diamonds, aes(clarity, fill=..count..)) + geom_bar(), but you loose the Cut information:

Categories : R

How to plot summaries of a table in bar chart
you have four columns and you provide 5 names.arg Same for density, but this alone wouldn't come up with an error... the first item of barplot, called height, according to ?barplot shall be: height either a vector or matrix of values describing the bars which make up the plot. If height is a vector, the plot consists of a sequence of rectangular bars with heights given by the values in the vector. If height is a matrix and beside is FALSE then each bar of the plot corresponds to a column of height, with the values in the column giving the heights of stacked sub-bars making up the bar. If height is a matrix and beside is TRUE, then the values in each column are juxtaposed rather than stacked. you have character columns, what did you expect :-) ? you need to do some summary statistics

Categories : R

Plot excel bar chart from Matlab
Ok, I figured it out just after posting it. We can get this by changing eCO.Chart.ChartType = 65; to eCO.Chart.ChartType = 57; e = actxserver('excel.application'); eWs = e.Workbooks; eW = eWs.Add; eS = eW.ActiveSheet; e.Visible = 1; x=(0:2:100)';y=sin(x); eS.Range('A1:B50').Value = [x y]; eCO = eS.ChartObjects.Add(100, 30, 400, 250); eC = eCO.Chart; eC.SeriesCollection.NewSeries; eC.SeriesCollection(1).Value = eS.Range('B1:B50'); eC.SeriesCollection(1).XValue = eS.Range('A1:A50'); eCO.Chart.ChartType = 1; eCO.Chart.ChartType = 57; eCO.Chart.HasTitle = true; eCO.Chart.ChartTitle.Text = 'This is the title text'; % view it again eW.Close;e.Quit;delete(e); For further reference to other charts check this http://it.toolbox.com/wiki/index.php/EXCEL_Chart_Type_Enumeration

Categories : Excel

How to draw the area chart in core plot?
if you want to change your dot's color which are on the line of chart then just change the color in this line of code aaplSymbol1.fill = [CPTFill fillWithColor:googColor]; and if you want to change every dot's color different then change the color different different in this line aaplSymbol1.fill = [CPTFill fillWithColor:googColor]; for every different point.

Categories : Iphone

Plot Combined Stacked bar and Bar chart Achartengine
You can get to that by building a stacked bar chart only. You don't need to combine a regular bar chart with a stacked bar chart. There is also the new HEAP type of bar charts which is a stacked bar chart, but with every piece being appended to the previous piece of the bar rather than stacking them one above the other.

Categories : Android

Plot Chart Using Flot library in MVC4.0
Your data has to be in the correct format for flot, that means Array of arrays (datasets) of arrays (points), no objects The datetime values must be converted to timestamps (see the documentation) The data should look like this: [[[1356998400 ,1.0001], [1356998460, 1.5001]]]

Categories : Jquery

Flot: Plot rolling 1 hour chart
The real-time updates example demonstrates rolling data, where each time a new point is added the oldest one is shifted off the array. What you want to do is basically identical, except with a time axis. Edit: I still don't understand what the question is; your screenshot shows a time axis, and if you have an hour of data in your array (as opposed to the five seconds shown) then it will show an hour on the axis. I think maybe you're confused about having to configure the x-axis in some way. You don't: if you provide data whose x-values are spaced an hour apart, the axis will fit to match it. The only thing you might need to tweak is the timeformat (see the Time Series section of the docs for more info) option, if you want the ticks to appear with only H:M:S rather than Y/M/D.

Categories : Javascript

Core Plot : Plotting percentage in pie chart
To make a slice width of 25.0 take up 1/4 of the pie, the other slices should total 75.0. Each slice takes up a fraction of the full circle computed by x / sum(x) where x is the slice width value and sum(x) is the sum of the widths of all pie slices. Alternatively, set the startAngle and endAngle of the pie chart. All of the slices will be drawn between those two angles, sized proportional to their values. This should work with only one slice which can have any value.

Categories : IOS

How do I plot multiple data subset forecast predictions onto a single plot
This is answered in another post Is there an easy way to revert a forecast back into a time series for plotting? This was initially posted as two unique questions, but they have the same answer. The core question being addressed is "how to restore the original time stamps to the forecast data". What I have learned with trial and error is "configure, then never loose the time series attribute" by applying these steps: 1: Make a time series Use the ts() command and create a time series. 2: Subset a time series Use 'window()' to create a subset of the time series in 'for()' loop. Use 'start()' and 'end()' on the data to show the time axis positions. 3: Forecast a time series Use 'forecast()' or 'predict()' which operate on time series. 4: Plot a time series When you plot a time series, the

Categories : R

core-plot scatter plot not showing with only one data point
The -scaleToFitPlots: method doesn't have enough information from only one data point to calculate "reasonable" axis ranges. In that case, set the xRange and yRange yourself based on the data you do have.

Categories : IOS

How to add white space in the line chart plot points?
You can use border/fillColor parameters for marker. http://jsfiddle.net/XWGFs/ http://api.highcharts.com/highcharts#plotOptions.series.marker.fillColor

Categories : Highcharts

Core Plot : Is a sliced (little split from the rest) like pie chart possible?
See here: http://core-plot.googlecode.com/hg/documentation/html/iOS/protocol_c_p_t_pie_chart_data_source-p.html radialOffsetForPieChart

Categories : IOS

Highcharts: How to plot Bar Chart where each series is plotted together rather than separated?
You can configure it by groupPadding http://api.highcharts.com/highcharts#plotOptions.column.groupPadding

Categories : Highcharts

plotting the old data(for an earlier plot) again while making a new plot
You need to close or clear the plot between loops: eg. plt.close() cla() clears an axis, i.e. the currently active axis in the current figure. It leaves the other axes untouched. clf() clears the entire current figure with all its axes, but leaves the window opened, such that it may be reused for other plots. close() closes a window, which will be the current window, if not specified otherwise.

Categories : Python

How to bring up the effect on core plot pie chart selected slice
Every plot delegate method passes the plot that sent the message as one of the parameters. Give each pie chart a unique identifier and use that to determine which one sent the message.

Categories : Misc

iReport 5.0.0: Remove space betwen Y bar and plot for Timeseries chart
In your chart customizer, cast your plot to an XYPlot (or just call chart.getXYPlot()) and then call setAxisOffset on it. This method sets the gap between the axes and the plot. (javadoc here) Removing the gap from the y-axis should be as simple as calling: plot.setAxisOffset(new RectangleInsets(5.0, 0.0, 5.0, 5.0)); Removing all of the gaps can be done with: plot.setAxisOffset(new RectangleInsets(0.0, 0.0, 0.0, 0.0)); or plot.setAxisOffset(RectangleInsets.ZERO_INSETS); Edit: By default, the plot will begin slightly before the first data point. If you want the data to begin immediately at the edge of the plot, call setMinimumDate on your date axis, setting it to the same value as the first point in your dataset.

Categories : Java

how to add values from a database output to the data field in Line Chart of Chart.js
First thing first You need to replace data : [0,9,0,8,56,55,40] with data : [data_array1] data_array1 is an data_string came from database, all you need to do is just convert that data array into highchart acceptable format. For that you need to fetch the data from database, implode it with comma(,), that it will return a string which will be something like this 0,9,0,8,56,55,40 Just echo it data : [data_array1]

Categories : Javascript

updating bar chart data of various lengths on a chart with an x-axis timeline using d3
that's funny. You have the following line inside the 'click' handler: var chart = d3.select("body"); After that you're effectively inserting the new rect elements into BODY, not SVG.

Categories : Javascript

After changing the chart type of Shield UI Chart no data is shown
There is the possibility to just change the chart type and to have the data displayed in the now layout. However you need to consider where the data types are compatible or not. Bar charts are intended to show single values e.g. 1,2,3,4 and so on. While the range bar's data values come in pairs. Look at the code below: { seriesType: 'rangebar', data: [[0.75, 0.79], [0.95, 1.03], [0.70, 0.79], [0.65, 0.70], [0.5, 0.69], [0.77, 0.89], [0.79, 0.87], [0.55, 0.89], [0.65, 0.99]] }

Categories : Misc

How to auto adjust Y axis plot lines in live high chart
set the max plot line value to any fixed number plots the plot line. from then onwards the plot line will be visible. if the value of plot lines is very small compared to the scale then it may be tough. in this case go for a logarithmic scale. That will help. yAxis:{ type: 'logarithmic' } updated your fiddle at http://jsfiddle.net/z6QXW/12/ hope this will help you

Categories : Highcharts

ggplot2 stats="identity" and stacking colors in bar plot gives "striped" bar chart
One way would be to order your data by category2. This can be done also inside ggplot() call. ggplot(d[order(d$category2),], aes(x=category1, y=qty, fill=category2)) + geom_bar(stat="identity")

Categories : R

How to make bar chart not be crushed with a lot of data in google bar chart?
You can calculate a height for your BarChart dynamically, based on the number of rows of data in your DataTable: // set inner height to 30 pixels per row var chartAreaHeight = data.getNumberOfRows() * 30; // add padding to outer height to accomodate title, axis labels, etc var chartHeight = chartAreaHeight + 80; var chart = new google.visualization.BarChart(document.querySelector('#chart_div')); chart.draw(data, { height: chartHeight, chartArea: { height: chartAreaHeight } });

Categories : HTML



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.