Highcharts - Removing title off tree maps - javascript

I am attempting to remove the labeling of my treemap. design Although I do want to reveal the name when hovering over the square of the tree-map; I am attempting to remove the titles of each square such as In Store, Retail, Online, Street Vendors etc..... But like mentioned earlier I do want to show the title when hovering over which is why I did not remove the names entirely;
I've tried accomplishing this goal by editing the dataLabels object; and setting enabled: false, I've also adjusted the styling of font and alignment in hopes to affect the text but that did not work either.
Here is a link to my highcharts jsfiddle example:

This can be accomplished by setting the dataLabels option on plotOptions. Like this:
Highcharts.chart('container', {
series: [...],
title: {
text: 'Sector'
},
plotOptions: {
series: {
dataLabels: {
enabled: false
}
}
}
});
Highcharts API

Notice that the dataLabels options object should be defined in the series options object, not the level one.
Demo: https://jsfiddle.net/BlackLabel/hx4pjzg3/
series: [{
dataLabels: {
enabled: false
}
}]
API: https://api.highcharts.com/highcharts/series.treemap.dataLabels

Related

How to remove legend at the bottom of chartjs doughnuts

I'm trying to remove all default labels from chartjs doughnut charts but the one at the bottom doesn't seem to go away
There was initially one legend at the top but I managed to hide that ut now I'm faced with labels at the bottom which completely ruin the chart
here's my options property in my config
options: {
cutoutPercentage: 80,
legend: {
display: false
},
tooltips: {
enabled: false,
},
}
I want all labels and legends to be gone completely so I can define my one with HTML, CSS and custom javascript
Here's a screenshot of what's happened
messed up chart that makes me want to cry
You must have some global settings or other code that is causing the x-axis to be displayed, as it is not configured in your options above and is not the default.
I put together a sample chart that shows the x-axis being displayed similar to yours.
If you turn this off in your options, that should no longer be shown. You can toggle that setting to show/not show in the demo to see the difference.
options: {
cutoutPercentage: 80,
legend: {
display: false
},
tooltips: {
enabled: false,
},
scales: {
xAxes: [{ display: false }] // <-- add this
}
}

Angular. Highcharts. Column Chart. Positioning of Columns on X-Axis

I have a highchart made with Angular.JS. Each column has its own stack level and is essentially managing its own group of data
My series is an array of objects that looks like this:
[{
name: seriesGroup.name,
data: [number],
xAxis: xAxisLevel,
stack: xAxisLevel
}]
The problem I'm having is that highcharts seems to automatically add some offset styling that moves each column out of position. Ideally I want all columns centered correctly like the one for Currency. See image above where you can see the x-positioning that's getting added to the rect tag.
Is there any parameter I can set to highcharts to disable this effect? I have not been able to find anything of the sort in the API docs.
Please take a look at the fiddle for a simplified version:
https://jsfiddle.net/nz0v8w5u/
You can make it setting appropriate plotOptions.series.groupPadding property. In your case 0.5 seems working as expected. Check the code and demo posted below.
Why do you add five xAxis instead of using just one? With one axis highcharts will automatically position columns properly and the code is much easier. Check this example: https://www.highcharts.com/demo/column-stacked
Code:
plotOptions: {
column: {
minPointLength: 1,
groupPadding: 0.5,
stacking: "normal",
dataLabels: {
enabled: false
}
}
}
Demo:
https://jsfiddle.net/BlackLabel/7pL8mj1s/
API reference:
https://api.highcharts.com/highcharts/series.column.groupPadding

How to display legend in Highcharts Waterfall Chart and make the sum column of waterfall appear in multiple colors?

I tried to find a lot about this but didn't get the answer. For waterfall charts in Highcharts
legend: {
enabled: true
}
didn't seem to work. Can you suggest how can we display legend on a waterfall chart? Also, can we have the value of 'y' for every column displayed on top of the column, instead of being displayed on the column? For this change, with most of the other charts,
plotOptions: {
column: {
dataLabels: {
enabled: true
}
}
}
But this didn't work with waterfall charts.
And finally, is there a way we can make the sum bar look like an aggregate of the other bars in terms of color as well? Like, in the example shown -
My code is here - http://jsfiddle.net/yr779/236/
I am not sure what you are asking regards to the legend. Your jsFiddle is showing a legend - you only have one series "Series 1" and it is in the legend. To display the value of each waterfall you need to use the correct plotOptions:
plotOptions: {
waterfall: {
dataLabels: {
enabled: true,
crop: false,
inside: false,
overflow: 'none'
}
}
},

highcharts customize legend for different series

I have 2 pie charts and each have 2 legends. i want to position 2 on right and 2 on left..how would i do that ?
I tried to add legend in a series rather than chart...but it did not work...
chart.addSeries({
name: data.series[i].name,
data: data.series[i].data,
type: data.series[i].type,
showInLegend: true,
legend: {
enabled: true,
floating: true,
verticalAlign: 'bottom',
align:'right',
y:100,
itemStyle: {
textDecoration: 'underline'
}
},
}
});
any clues or guidelines would be appreciated...
Thanks
From what I know, each chart can only have one legend, and that needs to be configured using the "legend" attribute for the entire chart, not per series.
I would suggest using the renderer methods (http://api.highcharts.com/highcharts#Renderer) to display a fixed, HTML-style legend, or use HTML/CSS to create a legend (which would technically live outside the chart) where the items are clickable.
Here is an example I created with a custom legend: https://www.frbatlanta.org/chcs/labor-market-distributions.aspx (see the parts with the checkboxes and drop-down menus). It is easy enough to create a click event from your custom legend to show/hide the associated series.
I'll be glad to edit a fiddle, if you provide one.

ExtJS Area Charts - Instead of stacking the areas on top of each other, how do I super impose all areas together with a different opacity?

I'm creating an area chart using ExtJS 4.1 and everything is rendering fine.
I have two areas and currently one area appears on top of another.
Instead of that behavior, how do I superimpose all the areas? I can change the opacity so that all areas are visible.
The examples given in the API documentation and several online sources show the stacked behavior only. Is that the default and only implementation of the area charts, or am I missing a simple configuration?
As seen in Area Charts Example, instead of all colored areas appearing one after another, I want them all in a single plane.
Kindly provide your inputs and suggestions.
Use Line chart with fill instead. Works for me.
This can be done using creating additional series instead of a single area series with an array of data points in y axis. Got the answer from Sencha forums.
series: [
{
type: 'area',
highlight: false,
axis: 'left',
xField: 'name',
yField: ['data1'],
style: {
opacity: 0.50
}
},
{
type: 'area',
highlight: false,
axis: 'left',
xField: 'name',
yField: ['data2'],
style: {
opacity: 0.70
}
}

Categories