score:2
thank you it is a smart idea for the labels issue, but as i say i cannot use levelisconstant: false because i need a different layout for each level at every moment. with this solution both levels can have a different layout when i am on the top level, but i soon as i drill down i loose the correct layout for the new view.
almost :-)
edit : okay so i finally managed to do it. i think it is impossible to achieve this in the way i was trying to, which was using the parent option for each child point of the serie in order to determine the hierarchy of the tree. so instead of using one serie with a hierarchy, i use one serie for the top level which i link to several series for the level below. i was able the do this thanks to the drilldown option.
i found the solution in the official documentation : http://www.highcharts.com/docs/chart-concepts/drilldown
i adjusted the code and it was all right. here is the solution i came up with (it is a different work from my first link) : http://jsfiddle.net/ff964fog/47/
series: [{
type: 'treemap',
layoutalgorithm: 'squarified',
borderwidth: 3,
data: modulesdata
}],
drilldown: {
series: servicesserie
},
i still have to adjust a few things (like the disappearance of the animations for the bottom level), but in the end i have exactly what i wanted !
score:0
my take on some settings you can use to achieve this (jsfiddle):
series: [{
type: "treemap",
allowdrilltonode: true,
levelisconstant: false,
// ...
levels: [{
level: 1,
datalabels: {
enabled: true
}
// ...
}, {
level: 2,
borderwidth: 0,
datalabels: {
enabled: false
}
}],
data[{
//...
}]
}]
the level 2 settings apply only when viewing from level 1. when drilling down the new view is considered to be level 1 because of levelisconstant: false
.
setting borderwidth: 0
in level 2 is only needed if you want to hide the grid of level 2 when viewing from level 1.
score:0
you can use a custom formatter for plotoptions.treemap.datalabels
. the code bellow is an example that uses this.series.rootnode
and this.point.parent
and compare them to examine if the label should be shown or not:
plotoptions: {
treemap: {
datalabels: {
formatter: function(data) {
if (this.point.parent == (this.series.rootnode || null)) {
return this.key;
}
}
}
}
}
you can use any other property that is available in formatter function. just log (console.log
) this
and data
in the formatter function to see all the properties available:
plotoptions: {
treemap: {
datalabels: {
formatter: function(data) {
console.log(this, data);
}
}
}
}
Source: stackoverflow.com
Related Query
- Highcharts - Hide child labels in a multiple levels and multiple layouts treemap
- Highcharts - how to show/hide multiple data labels on mouseOver and mouseOut
- How to hide specific dots and labels onmouseover in highcharts
- Hide Highcharts labels on resize and enlarge the chart
- Why does highcharts sankey chart sometimes combine multiple nodes with same node name but different Id into one and hide the lines?
- Highcharts data labels not showing on multiple xAxis and yAxis
- HIghcharts Treemap Groupby leaf objects at Level 1(Parent) and group by child at Level1(Sub objects)with custom color coding
- Hide Treemap labels for smaller nodes in Highcharts
- Hide axis and gridlines Highcharts
- How to hide labels in the highcharts in the pie
- Highcharts - labels inside and outside a pie chart
- Javascript Highcharts v3.0.5 - How to hide Y Axis Title when using multiple Y Axis
- Highcharts - How to hide series name and Y value in tooltip
- Highcharts stacked bar chart hide data labels not to overlap
- Highcharts with JSON data and multiple series
- Using HighCharts and DotNet.HighCharts to "Play" Multiple Series
- Highcharts v3.0.1 problems with rotating data labels in IE8 and jQuery v1.7.1
- Highcharts - Global configuration with common code and unique data & Headings
- Highcharts - Multiple Axis Graph not displaying labels
- Swap categories and labels highcharts (bar plots)
- How can I hide and show a category in highcharts
- Change chart type and redraw with multiple series in Highcharts
- Highcharts shared tooltip between charts with multiple series and shared tooltip
- Highcharts - Hide series "points" (labels) on both x- and y-axis
- How to remove the value and number labels from Highcharts angular gauge
- Distance between x-axis labels and the chart in Highcharts
- Hide Data Labels in Pie Chart below 400px width - Highcharts
- HighCharts - Need more space between bottom of chart and Xaxis labels
- Highcharts show the same yAxis start and end value with multiple data series
- Highcharts plotLines with multiple xAxis and yAxis
More Query from same tag
- R highcharts color specific column on chart
- SVG marker on Highcharts path
- How to combine 2 series in area chart - Highchart
- Highcharts over extends parent on resize (using flexbox)
- Rendering Highcharts using Angular js Directives
- Download image from SVG with Jersey
- How to get the last 10 objects only from JSON data
- Month wise category separation in Highcharts
- Highcharts, no animation when updating number of series in chart
- Highchart, how to vertically align in the middle a line?
- Convering yyyy-mm-dd to unix timestamp in array and put it back at the same position after converted it. [Javascript]
- highcharts strange area offset error when combined with xrange
- Can we stack a 2 columns in a single column in basic column Highchart and let the other columns let it be?
- Remove SVG rendered path on Legend Item Click
- Hiding items in highchart legend
- Export button on highcharts to open new tab
- Highcharts and EXTJS 3: Labels in x axis overlap
- Highcharts Compare Date Ranges Bar Chart
- How to Control Highchart.js Dom Elements Through CSS Rules
- Highcharts fold/unfold waterfall
- HighCharts (Stock) Styling Issues (Mobile and Date Selector)
- Highcharts custom SVG marker
- X axis label as Category not showing correctly: Highcharts
- Reactive Function is not working
- Move Highstock columns between x-axis ticks
- HighMaps select map from list - Highcharts.geojson and Highcharts.mapDataIndex issues
- Creating Pie Chart from external JSON not working
- Highcharts series (column) names of x axis
- Highstock MACD Study is using sma instead of ema
- Highcharts bar with non-stacked percent series