score:0
Accepted answer
You can create a custom legend by using the SVERenderer tool on the render callback.
Demo: https://jsfiddle.net/BlackLabel/qhr6nsw9/
render() {
let chart = this,
colors = ['#003975', '#F9BD50', '#3FA27E']
chart.series[1].points.forEach((p,i) => {
if (p.category === 0) {
if (p.customRect) {
p.customRect.destroy();
}
p.customRect = chart.renderer.rect(chart.plotSizeX + chart.plotLeft + 10, 100 + i * 50, 20, 20, 5)
.attr({
fill: colors[i],
zIndex: 3
})
.add();
if (p.customText) {
p.customText.destroy();
}
p.customText = chart.renderer.label(p.t, chart.plotSizeX + chart.plotLeft + 40, 100 + i * 50).add()
}
})
}
API: https://api.highcharts.com/class-reference/Highcharts.SVGRenderer#label
API: https://api.highcharts.com/highcharts/chart.events.render
Source: stackoverflow.com
Related Query
- Highcharts create legend for waterwall and stack column chart
- HighCharts - Single legend for two columns in a Stack Column chart
- How to create a column range chart in Highcharts using range and navigator functions?
- How to format my json data for stack column chart in HighCharts
- Legend for each point in column chart in highcharts
- Highcharts - Column chart with legend for each data
- How to create a legend for bar colors in a Highcharts bar chart
- How to display legend in Highcharts Waterfall Chart and make the sum column of waterfall appear in multiple colors?
- Highcharts connecting scatter chart and pie chart with single legend
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Proper x-axis for Highcharts stack group column
- Highcharts Stack Column Sum Positive and Negative Together
- highcharts - precision for stacked column chart data labels
- Highcharts - Display legend for Pie chart in two columns
- Overlapping and rounded stack in stacked column graph in Highcharts
- Make stack label disabled for a column in stacked column graph in Highcharts
- How to create a table for legend of a Stacked Chart in Highcharts?
- How to center highcharts pie chart and legend on a page?
- Change legend symbol in Column Chart in highcharts
- Show tootip and select pie slice on legend click of pie chart in HighCharts
- Drilldown for grouped column chart in highcharts
- Highcharts - Column chart with empty columns for date in x-axis
- How to use Highcharts React to create chart with multiple lines for same XAxis?
- Highcharts - where to place style and changing style for one wedge in a pie chart
- Column Chart Show datalabel for null values - Highcharts
- Highcharts series showing different data for 'column' and 'line' chart
- Highcharts show max., min., and average for each serie in legend
- Highcharts no longer animates and readjusts/rescales chart upon addition and removal of series in legend after upgrading to jQuery 1.10
- Column chart with negative values and categories on xAxis in HighCharts
- How to have first level as column chart and second level as Fixed placement columns in drill down highcharts
More Query from same tag
- Highcharts series data select point video sync
- HighCharts Column Chart: Data Labels on Stacks Overlap
- Need total value of two columns on Tooltip High charts
- How to add a horizontal line in Column bar chart in Highcharts plugin?
- Highmaps svg path issue - Data not flowing into certain counties on US map
- Highcharts.js - Dynamically disable given category
- Performing styling action on specific data in a highcharts graph
- iScroll 4 and highcharts compatibility issue
- HIghcharts, button text undefined
- Resetting Highcharts to initial state
- Highchart - yAxis - 1,000 should be displayed like 1000
- HighCharts + reveal.js chart size
- How can I make a graph with highcharts from csv file?
- Highcharts: markers not displayed
- How to ignore hidden series when clicking on a legend using highcharts?
- Smooth formula curves in highcharts
- Reserve space for text in exported Highchart
- Changing number of columns based on the zoom level : HighChart (column chart type)
- Having Several Units on Highcharts Spiderweb
- How to give plotlines text styles on opposite side instead of default
- Change highcharts data label position
- Forcing yAxis.max is not respected in Highcharts
- How could I sort each group of columns from low to high
- is it possible to add a filter to highcharts?
- Hide inactive dates from datetime X-Axis
- Passing a JavaScript function from JSON encoded PHP
- Highcharter package not found - highchart function not available
- JSON string to Highcharts
- Dynamically change startAngle value in HighCharts
- Dynamically display percent on y-axis using highchart