I try to solve this problem several times and give up. Now, when I have met him again, I decided to ask for some help.
I have this code for my Legend:
legend: { layout: 'vertical', align: 'right', verticalAlign: 'top', x: -10, y: 100, borderWidth: 0, labelFormatter: function() { if(this.name!='Series 1') { return this.name; } else { return 'Legend'; } } }
If I change the return from 'Legend' to '' the text is not shown but still there is a 'dash' on the top of the legend. If I do not use label formater function I have 'Series 1' + 'dash' like a first row in my legend. How to hide them?
Please, note my version is : Highcharts-2.0.5
This is a simple view of my legend and the dash I want to remove:
get('idofseriestoremove'). remove(). This only removes the series but is not removing the associated dotted lines.
credits: { enabled: false }, that will remove the "Highcharts.com" text from the bottom of the chart. @philfreo 'Credits: false' could produce a undefined error if highcharts didn't do proper checking.
The legend is a box containing a symbol and name for each series item or point item in the chart. Each series (or points in case of pie charts) is represented by a symbol and its name in the legend. It is possible to override the symbol creator function and create custom legend symbols.
Set legend's layout, align and verticalAlign options as follows: legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', itemMarginTop: 10, itemMarginBottom: 10 }, By itemMarginTop/Bottom you can control the padding between the legend items.
How to hide a series from the legend? Highcharts.extend (options, Highcharts.merge (options, { series: [ { index: 2, showInLegend: "false" } ] })); results in a blank chart. In 'Custom code' section create a chart using options from 'Genereated options' section, add showInLegend property and set it to false in series with index 2.
Highcharts.extend (options, Highcharts.merge (options, { series: [ { index: 2, showInLegend: "false" } ] })); results in a blank chart. In 'Custom code' section create a chart using options from 'Genereated options' section, add showInLegend property and set it to false in series with index 2.
The legend is a box containing a symbol and name for each series item or point item in the chart. Each series (or points in case of pie charts) is represented by a symbol and its name in the legend. It is possible to override the symbol creator function and create custom legend symbols. A Highmaps legend by default contains one legend item per...
The legend is a box containing a symbol and name for each series item or point item in the chart. Each series (or points in case of pie charts) is represented by a symbol and its name in the legend. It is possible to override the symbol creator function and create custom legend symbols. Accessibility options for the legend.
If you don't want to show the series names in the legend you can disable them by setting showInLegend:false
.
example:
series: [{ showInLegend: false, name: "<b><?php echo $title; ?></b>", data: [<?php echo $yaxis; ?>], }]
You get other options here.
legend options
other chart options
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With