This question already has an answer here:
How to disable legend in nvd3 or limit it's size
(1 answer)
Closed 7 years ago.
Im working on creating a pie chart using nvd3. I successfully got the pie chart but when the number of slices increase the legends tend to take up lot of space and the pie shrinks. I have decided to remove the legends completely.
i tried somthing like
d3.select(".nv-legendWrap")
.remove();
This hides the legends from being visible but the space is still blank. i want the pie to resize and take up the entire space. How do i do this??
The pie chart looks like this http://i.stack.imgur.com/jkIsG.png
I want the legends specified in the red block to be removed and the pie re-sized to fill the space.
what about hidden the legend by the moment of the creation of the chart:
nv.addGraph(function() {
var chart = nv.models.lineChart().margin({left: 100})
.useInteractiveGuideline(true)
.transitionDuration(350)
.showLegend(false) // <-----Show the legend
.showYAxis(true)
.showXAxis(true);
Related
I'm trying to adapt this code (amCharts 5 Gantt Chart) to my project and want to hide the x-axis labels on this amCharts 5 gannt chart. Any thoughts on how to achieve this?
From their demo code, just before the following...
chart.appear(1000, 100);
Add the following...
xAxis.hide();
If that doesn't work for you, perhaps do it after the chart is shown (chart.appear(1000, 100);)?
More information: https://www.amcharts.com/docs/v5/reference/axislabel/#hide_method
In amCharts 4 column chart, labels on category axis are alternately hidden when user reduces the browser width.
By default the chart automatically hides labels to improve readability. I want to disable it.
Please refer ruining ex. codepen.io/Mishra-Praveen/pen/MWwmVbp
I am getting solution for Amchart 3 not for Amchart4.
categoryAxis.renderer.minGridDistance = 30;
Increasing these numbers will mean likely sparser grid lines and related labels. Decreasing will probably result in denser grid/labels.
The goal is to create a pie chart, where
the percentages (calculated or manually specified) are shown inside the pie.
data is shown upon mousehover.
Clarification: e.g. imagine a set consisting of 2 data labels. One is called apples (containing "15" apples), and the other one is called pears (containing "15" pears), then the percentages, always visible, shown inside the pie would be "50%" and "50%", whereas the data shown on mousehover would be "15" and "15".
Such has been already done in a previous post: Displaying percentage inside pie item for highcharts with JSFiddle 1.
However, would it be possible to
use a semi-circle donut pie chart, instead of a circle pie chart. (what is a semi-circle donut pie chart? -> JSFiddle 2)?
have text labels (data names) on the chart inside the pie chart, such as in Fiddle 2.
*Clarification: e.g. having the data labels "apples" and "pears" on the pie by default, such as "Firefox" and "Chrome" in Fiddle 2.*
Any help would be greatly appreciated, as I find it hard to combine these Fiddles, since I am far underexperienced with JS.
E.g. Fiddle 1 works/starts with $(function () {
var chart = new Highcharts.Chart({,
whereas Fiddle 2 starts with $(function () {
$('#container').highcharts({.
The Highcharts API Reference manual is learning me slowly, as a beginner.
Since I'm not sure which you prefer here is a fiddle you can look at that leverage the highcharts formatter attribute:
formatter: function() {
return Math.round(this.percentage*100)/100 + ' %';
}
I believe what you want is something like this.
I am having an issue with a pie chart I created in highcharts.
Depending on the placement of the data labels the actual chart will grow or shrink.
We need the pie chart to stay the same size so is there a way to keep the pie size constant and force the labels to fit around it or do I just have to place the labels inside each slice?
You will have to set a fixed size for the pie chart. Can be a percentage or a pixel value. For example:
plotOptions: {
pie: {
size: 100
}
},
See this fiddle from the API http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/pie-size/
I'm building a demo chart with highstock displaying 4 axis, two on each side http://jsbin.com/oyicuc/3/edit
I'd like the axis to hide when you click on the series in the legend and for the chart to fill the remaining space. I've used the showempty: false property on the y axis, this works on the outer axis but if you hide the inner axis then the gap where it was remains.
Anybody know if this can be done? Thanks in advance