I have created a pie chart with AmCharts but can't seem to find how to display the series values in an anti-clockwise direction.
From the documentation I can see there is are startAngle (default -90) and endAngle (default 270) properties, but I can't see how to either use these, or another property so that the values are added in the other direction.
Related
I'm trying to find a way to snap the xAxis in a line chart to the closest min and max data points in the visible chart area.
As you can see in any of the line chart demos, when zooming or panning the chart, the start and end position of the chart will not snap to the nearest data item (i.e. day, or month when grouped etc.). After zooming or panning the chart, the start\end of the chart area will be at some point based on where you zoomed or panned, but very difficult to land it exactly on the interval.
I'd really like to figure out a way to snap the min and max position of the visible chart area to the nearest min and max data points, ideally using short but smooth animation to snap once the zoom\pan event is finished\released.
I figure this is possible somehow by using something like the DateAxis zoomToDates method after a zoom\pan event is triggered, but haven't been able to find a way to do it.
link : D3 Charting Tool: How to add label at right of target line (additional horizontal line) in column chart
I implemented the graph through this link.
The problem is that if there are multiple graphs and the y-axis values are different at the same height, if the horizon value is 10px, then 10px is output regardless of the y-axis range.
If i want to add horizontal lines according to the y-axis range, I'd like to know a solution.
I want to build this kind of chart with d3js (no need in any North, East etc.)
just this kind of data
[{year:2017, data:[10,20,30]}, {year:2016, data:[20,20,30]}]
Is there any example pie with sectors?
Thanks.
I think what might be similar to what you want is:
Sequential Sunburst Diagrams
In the main gallery for d3js you can find some examples for sunburst graphs
D3 has a method for generating arc segments of varying widths specified by inner and outer radius, start and end angles d3.arc
var arc = d3.arc();
arc({
innerRadius: 0,
outerRadius: 100,
startAngle: 0,
endAngle: Math.PI / 2
});
in order to create the kind of diagram you have in mind you'll need to work out what those properties are for each piece of data you have. This is typically achieved using a layout function; you pass an array of your data to the function and it returns an array of values required to create the arc segments.
The process by which you convert the data values to arc properties is where the difficult work lies. I've created a bl.ock giving an example of how you might do this though if you're using this layout you should make sure that the areas rather than arc thickness are proportional to the data values for expedience I haven't.
Refer Animated Donut Chart with Labels, Legend and Tooltips created using d3.js
I don't see any option for creating a Pie/Donut Chart with polylines for marking labels outside the arcs as per the official documentation.
Also it will be great if we can fill the line stoke with same color as that of the point as shown here.
How to create Half pie arc in d3
I'm following an example with full pie chart. How do I create Half pie chart?
code so far
http://tributary.io/inlet/5260888
Solution: http://tributary.io/inlet/5273835
d3's pie layout has functions to set the startAngle and engAngle properties which can create partial pie charts.
I had a similar requirement, however the missing part isn't half, but a changing fraction of the whole. in order to achieve this, I just set the "stroke" and "fill" for the missing segment to "none".