w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
HighChart: Donut Pie with URL
After debugging the broken examples, the problem is that the url is not included in the data passed in to the chart: // add browser data browserData.push({ name: categories[i], y: data[i].y, color: data[i].color, // missing this line! url: data[i].url }); Once that is done, it is as easy as the docs describe: point: { events: { click: function(e) { location.href = this.options.url; } } }

Categories : Jquery

How to take the middle out of a highchart donut chart?
To get empty space in the middle of a chart use 'size' and 'innerSize' - Like in your example: size: '80%', innerSize: '60%' Regarding text - I advice to use renderer.text().

Categories : Highcharts

Donut Pie Chart NVD3
Like most of the comments to your question, I found that replacing your inline data with data1 makes it work. data1 = [ { values : [ {"label":"One","value":29.765957771107}, {"label":"Two","value":0}, {"label":"Three","value":32.807804682612} ] } ]; nv.addGraph(function () { var chart = nv.models.pieChart() .x(function (d) { return d.label; }) .y(function (d) { return d.value; }) .donut(true) .donutLabelsOutside(false) .showLegend(true) .showLabels(true); d3.select("#chart svg") .datum(data1) .transition().duration(100) .call(chart); return chart; }); Not sure why you have a variable to store your values and then place them

Categories : Javascript

D3.js - Donut charts with multiple rings
Yes, you can do this quite easily. The key is to use nested selections. That is, you pass in your top level list of lists and create a container element for each list. Then you do the nested selection and draw the actual elements. In this particular case, you also need to adjust the radii of the arcs so that they don't overlap. var gs = svg.selectAll("g").data(d3.values(dataset)).enter().append("g"); var path = gs.selectAll("path") .data(function(d) { return pie(d); }) .enter().append("path") .attr("fill", function(d, i) { return color(i); }) .attr("d", function(d, i, j) { return arc.innerRadius(10+cwidth*j).outerRadius(cwidth*(j+1))(d); }); Updated jsfiddle here.

Categories : Javascript

Donut chart with partial ring around
I managed to get it working! I used startAngle, endAngle, innerRadius and outerRadius. Only the centering around the parent element isn't done yet. I just place the submenu always on top now. This is the result: Thanks for the help everyone!

Categories : D3 Js

How to build a split donut chart
Solved - added the event below to clear the default mouseOut function, then used .graphic.attr to make my changes. events: { load: function () { var seriesPoints = this.series[0].points; for (var i = 0; i < seriesPoints.length; i++) { seriesPoints[i].onMouseOut = function () { }; } } }

Categories : Javascript

HighCharts donut chart drilldown
Found out on my own after all. Hope this answer can help also other people. <?php $this->widget('bootstrap.widgets.TbHighCharts', array( 'chart' => array( 'borderColor'=>'#e5e5e5', 'type' => 'pie', ), // .. 'options', 'legend', .. 'series' => array( // --------- inner layer of the pie array( 'size' => '40%', 'data' => array( array( 'name' => //name 'y' => //value ), array( 'name' => //name 'y' => //value ), ), ), // -------- second layer from the inside array( 'size' => '60%', 'innerSize' => '40%', 'data' => array( array( 'name'

Categories : PHP

Highcharts Pie Donut Customize shape
You can try to use donut chart http://www.highcharts.com/demo/pie-donut and renderer to add arrow. http://api.highcharts.com/highcharts#Renderer

Categories : Javascript

Animate infographic SVG with CSS (donut chart)
I think this is what you've been looking for: http://www.chartjs.org/ It's a lightweight js-library that allows you to make piecharts, doughnutcharts, .. easily. Pretty easy to customize too. Customization is always a pain in the ass for such things, but starting from scratch is much harder, so i highly recommend this.

Categories : CSS

D3.JS Grouped Donut Chart from JSON
I have figured out a way to do stacked pie charts in D3. I'm not entirely sure if this is the "correct" convention, but it certainly works well. Here's a fiddle to follow along with. I've restructured my yeas and nays arrays into specifying the data value at the first level (this way, D3 can properly loop) in an object and then also including party and name alongside. Here's an example of how the yeas array looks: Essentially there's two arrays, yeas and nays, each having 9 objects withs values: value, party, and name. This way I can pass d3.layout.pie the data of either of the arrays and give the value in that pie layout d.value. More simply said, here's the code snippet to explain: var yea_pie = d3.layout.pie() .sort(null) .value(function(d) { return d.value; }) //This

Categories : Javascript

Highcharts donut legend toggle
You need to set ids for inner and outer rings. Then common it by legendItemClick and search correct point by id. legendItemClick: function () { var id = this.id, data = this.series.chart.series[0].data; $.each(data, function (i, point) { if (point.parentId == id) { if(point.visible) point.setVisible(false); else point.setVisible(true); } }); } http://jsfiddle.net/sbochan/PgpRv/4/

Categories : Jquery

Pie (donut) chart segment order in D3
d3 automatically sorts by value for pie charts. Luckily, disabling sorting is quite easy, just use the sort(null) method on thedonut function, i.e.: var donut = d3.layout.pie().value(function(d){ return d.itemValue; }).sort(null); Here's a fiddle.

Categories : Javascript

jqPlot donut change data
This might help: plot1.destroy(); plot1 = $.jqplot ('grafico_musica', [peliculas], { title: "M&uacute;sica", seriesDefaults: { renderer: $.jqplot.PieRenderer, rendererOptions: { dataLabelFormatString:'%.1f%', showDataLabels: true } }, legend: { show:true, location: 'e' }, highlighter: { show: true, formatString:'%s', tooltipLocation:'sw', useAxesFormatters: false } } ); Add the previous code to a function and call when needed. Hope that helps

Categories : Javascript

3 layer donut chart in Highcharts
You can do the same by using two charts. one chart will be having a pie and a donut while the second will have only a donut chart you can manage them by providing same center as well as radius such that they will synchronize. hope this will work for you

Categories : Javascript

google map create donut polygon from xml
The problem is that the polygons which have parents are not being processed as part of the parents path(s), as it sounds like you are aware in your latest comment. When you have multi-polygons like these parents are intended to be, you pass all their paths at once into the 'paths' property of your google.maps.PolygonOptions object (or when calling Polygon.setPaths() as the first argument) as an array of arrays which each contain a polygon path. The exact segment of code you posted above, change it to the following: var phpscript = "cec_create_xml.php"; // creates xml data for polygons downloadUrl(phpscript, function(data) { var i, poly, id, parent, parentPolys = {}, childPolys = [], polyXml = data.documentElement.getElementsByTagName("polygon"), len = p

Categories : Xml

iterate over slices of an ndarray
something like that? >>> data = np.array([[1,2,3],[4,5,6],[7,8,9]]) >>> for layer in [data[:,i] for i in range(3)]: ... print layer ... [1 4 7] [2 5 8] [3 6 9]

Categories : Python

How to set Image inside of Donut-achartEngine Graph?
This could help.. <RelativeLayout android:layout_width="match_parent" android:layout_height="170dp" > <LinearLayout android:id="@+id/left_graph_for_head_injury" //here to draw donut android:layout_width="match_parent" android:layout_height="170dp" > </LinearLayout> <ImageView //image to place android:layout_width="95dp" android:layout_height="95dp" android:layout_centerInParent="true" android:scaleType="fitXY" android:src="@drawable/inside_donut_head_injury_image" /> </RelativeLayout>

Categories : Android

Can't create donut chart using gwt-google-apis
Looking at the API of latest stable version gwt-visualization-1.1.2, that functionality is not present. The only options specific to a piechart you can set are: void set3D(boolean is3D) void setPieResidueSliceLabel(java.lang.String label) void setPieSliceText(java.lang.String text) void setPieSliceTextStyle(TextStyle textStyle) void setSliceVisibilityThreshold(double angle) You could add an issue or write the functionality yourself adding JSNI methods to PieChart.PieOptions . Take a look at GWTProject if you are unfamiliar with this.

Categories : Gwt

Passing slices to arbitrary functions
First I would suggest using NumPy or pandas and creating a function that would just receive, as @JanneKarila suggested coalesce(a[::3]) But if you have to create an object that can be sliced and that has functions that should also implement slices I would follow the approach the Pandas library did. You have a DataFrame (don't bother with names) object df and you can do slicing on it using df[1:3] But if you want some special slicing then they implemented another object, that has a reference to the first one which also implements slicing and is available as an attribute of the first object df.ix[3:5]. Your implementation would look something like this: class SpecialSlicer(object): def __init__(self, obj): self.obj = obj def __getitem__(self, ...): return sefl.o

Categories : Python

wrapping around slices in Python / numpy
numpy.take in 'wrap' mode will use your indices modulo the length of the array. indices = range(i-2,i+3) neighbourhood = A.take(indices, mode='wrap') See documentation for details numpy.take

Categories : Python

How to get coordinates of slices along the edge of a pie chart?
You can use the following equations to calculate a point along the circumference of a circle: x = cx + r * cos(a) y = cy + r * sin(a) Where (cx, cy) is the center of the circle, r is the radius, and a is the angle. In order for this to work for you, you will need a way to computing the angle based upon the pie slices on your chart - see below. According to the d3 documentation for pie layouts, the pie function returns a list of arcs, so you can process this data to calculate each of your points: pie(values[, index]) Evaluates the pie function on the specified array of values. An optional index may be specified, which is passed along to the start and end angle functions. The return value is an array of arc descriptors value - the data value, returned by the value ac

Categories : Javascript

How to color the slices of amchart piechart?
Tested on Windows Phone 8.0 and 8.0 SDK. Just add a collection of brushes into the PieChart structure. Using XAML <chart:PieChart Height="300" Width="400" TitleMemberPath="Title" ValueMemberPath="Value"> <chart:PieChart.Brushes> <SolidColorBrush Color="Red"/> <!-- color item #1 --> <SolidColorBrush Color="Green"/> <!-- color item #2 --> <SolidColorBrush Color="Blue"/> <!-- color item #3 --> </chart:PieChart.Brushes> <chart:PieChart.DataSource> <local:PieDataCollection> <local:PieData Title="Democrat" Value="123"/> <local:PieData Title="Republic" Value="213"/> <local:PieData Title="independent" Value=

Categories : C#

Python's immutable strings and their slices
That's how slices work. Slices always perform a shallow copy, allowing you to do things like >>> x = [1,2,3] >>> y = x[:] Now it would be possible to make an exception for strings, but is it really worth it? Eric Lippert blogged about his decision not to do that for .NET; I guess his argument is valid for Python as well. See also this question.

Categories : Python

Fast membership in slices of lists
idea you may create a dict. For every element store the sorted list of positions where it occurs. To answer query: binary search first element that greater or equal a, check if it exists and less than b Pseudocode Preprocessing: from collections import defaultdict byvalue = defaultdict(list) for i, x in enumerate(data): byvalue[x].append(i) Query: def has_index_in_slice(indices, a, b): r = bisect.bisect_left(indices, a) return r < len(indices) and indices[r] < b def check(byvalue, x, a, b): indices = byvalue.get(x, None) if not indices: return False return has_index_in_slice(indices, a, b) Complexity is O(log N) per query here if we suppose that list and dict have O(1) "get by index" complexity.

Categories : Python

Anonymous Hash Slices - syntax?
Hash slice syntax is @ <hash-name-or-hash-ref> { LIST } When you are slicing a hash reference, enclose it in curly braces so it doesn't get dereferenced as an array. This gives you: my @values = @{$anonh}{@fields} for a hash reference $anonh.

Categories : Perl

How to draw a donut Chart using dojo on mobile website
As far as I know, there is no such type of chart in dojox.charting. You will probably have to write your own chart type. Have a look at the code in dojox/charting/plot2d/Pie.js and use it as a template. Your should be able to add a filled-in circle in the middle of the pie to make it look like a donut... Example : require([ "dojo/_base/declare", "dojox/charting/Chart", "dojox/charting/plot2d/Pie", "dojox/charting/themes/Claro"], function (declare, Chart, Pie, theme) { var Donut = declare(Pie, { render: function (dim, offsets) { // Call the Pie's render method this.inherited(arguments); // Draw a white circle in the middle var rx = (dim.width - offsets.l - offsets.r) / 2, ry = (dim.height - offse

Categories : Android

Algorithm to select slices of a multidimensional array
In order to get the start in the linear array, you have to use start[0] * numColumns + start[1]. And you have to have a loop, like Even with linear array, you could access an element with multidimensional syntax, because c stores multidimensional array as linear one internally. for(int i = start[0], countx = 0, count < xcount; countx++, i++) { for( int j = start[1], county = 0; county < ycount; county++, j++) { // copy array[i][j] into another array. } }

Categories : Arrays

How to set the distance of the slices in an exploded pie chart (.NET Charting)
This has been asked before here and the answer is no, there is no way - no hacks.

Categories : Dotnet

Slices: Trouble appending to a slice in a struct
append doesn't change the slice you provide but builds a new one. You must use the returned slice : r.RandomSlice = append(r.RandomSlice, 5) More details about append in Effective Go and in the Go blog.

Categories : Arrays

How to plot rectangular slices in a barchart ? coreplot
Set barBasesVary to YES on the bar plot. This will cause the plot to query the datasource for an additional field called CPTBarPlotFieldBarBase. The base value defines one end of the bar and the tip value defines the other end. The location determines the horizontal placement (for vertical bars) as always.

Categories : IOS

Are pointer to slices good "relationships" in Go with GAE Datastore?
I don't think a pointer is a valid type for datastore! From here: https://developers.google.com/appengine/docs/go/datastore/reference An entity's contents are a mapping from case-sensitive field names to values. Valid value types are: - signed integers (int, int8, int16, int32 and int64), - bool, - string, - float32 and float64, - any type whose underlying type is one of the above predeclared types, - *Key, - time.Time, - appengine.BlobKey, - []byte (up to 1 megabyte in length), - structs whose fields are all valid value types, - slices of any of the above. Or maybe... do you have another suggestion? A slice to Player may work (not tested) Or maybe you should search for "The PropertyLoadSaver Interface" in the same URL. It just something like you choose what and how you insert

Categories : Google App Engine

Working with slices of structs concurrently using references
package main import ( "encoding/json" "fmt" "sync" ) type Window struct { Height int64 `json:"Height"` Width int64 `json:"Width"` } type Room struct { mu sync.Mutex Windows []Window `json:"Windows"` } func main() { js := []byte(`{"Windows":[{"Height":10,"Width":20},{"Height":10,"Width":20}]}`) fmt.Printf("Should have 2 windows: %v ", string(js)) var room Room _ = json.Unmarshal(js, &room) var wg sync.WaitGroup // Add meny windows to room for i := 0; i < 10; i++ { wg.Add(1) go func() { defer wg.Done() addWindow(&room) }() } wg.Wait() js, _ =

Categories : Go

CALayer clip CGContextAddArc (making a donut slide/pie chart)
If I understand your question correctly, you want to have a hole in the center and you are trying to use a clipping mask to do that. The only thing therefore you need to do is reverse the direction that you draw the inner path that you tried to clip. Then, because of fill rules, it will cut out a nice hole for you. Your code should look something like this: CGPoint center = CGPointMake((self.bounds.size.width/2) + self.centerOffset, (self.bounds.size.height/2) - self.centerOffset); CGFloat radius = MIN(center.x, center.y) - 25; radius *= self.pieScale; int clockwise = self.startAngle > self.endAngle; /* Clipping should be done first so the next path(s) are not creating the clipping mask */ CGContextMoveToPoint(ctx, center.x, center.y); /* Create outer path going clockwise */ CGContex

Categories : IOS

highcharts donut pie - How to calculate pie size percentages after resize the chart
It looks like a bug, so I reportoed to our developers. https://github.com/highslide-software/highcharts.com/issues/2012

Categories : Jquery

Removing the white line between slices in Flot pie chart
You can add the STROKE Property pie: { radius: 0.2, innerRadius: 0.125, show: true, stroke: { width: 0.1 } } Set the value to 0 totally hide the pie. So you could also add a stroke color, with the value set to the same color as your background : pie: { radius: 0.2, innerRadius: 0.125, show: true, stroke: { width: 0.1, color: '#808080' } } See the Fiddle : http://jsfiddle.net/hSmVH/

Categories : Jquery

hiding individual slices of a flot pie chart based on corresponding names
Listen for clicks on the legend elements. When you get one, match it to the corresponding series (there are many ways to do this) and set the series color to 'transparent' or 'rgba(0, 0, 0, 0)', then redraw.

Categories : Javascript

Finding How Many Slices of the Largest Square from a L * B Piece of Bread I Can Make
Find GCD of l and b. Then number of pieces = (l/gcd) * (b/gcd) To find GCD check out code here : Java: get greatest common divisor

Categories : Java

XCode won't compile with Kinvey : file is universal (3 slices) but does not contain a(n) i386 slice
We ran into this issue awhile back in our project. I believe if you go into the build settings for your main app target and set the property ONLY_ACTIVE_ARCH (Build Active Architecture Only) to NO, that should fix your issue.

Categories : Xcode

Error: 10 $digest() iterations reached! Aborting! during walking through slices of arrays using Angular.js
Please take a look at this stackoverfolow thread, you should make your filter to return the same exact objects since if the object get changed during the repeater, it will cause the error in $digest. .filter("group", function () { return _.memoize(function (items, count) { var out = [], temp = []; for (var i = 0; i < items.length; i++) { temp.push(items[i]); if (temp.length == count) { out.push(temp); temp = []; } } if (temp.length) out.push(temp); return out; }); }); Try it here jsbin

Categories : Javascript

how to center text inside donut chart embedded in combination chart
You can use renderer to add custom text on your chart. Then you can add events using element.on(). See live example: http://jsfiddle.net/sJfuA/2/ $('#container').highcharts({ chart: { events: { load: function() { var chart = this, rend = chart.renderer, pie = chart.series[4], left = chart.plotLeft + pie.center[0], top = chart.plotTop + pie.center[1], text = rend.text("text", left, top).attr({ 'text-anchor': 'middle'}).add(); text.on("mouseover", function() { alert("hover!"); }); } } }, ... });

Categories : Highcharts



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