Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove "Values" and "series" from highcharts?

I'm using highcharts on my website, which looks great, but I now want to remove these two labels from the chart: enter image description here

I tried disabling all sorts of labels, such as this one:

{
    title: {
        text: 'X axis labels are disabled'
    },
    xAxis: {
        labels: {
            enabled: false
        }
    },

    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]
}

but I can't find a way to remove these specifically.

Here is the fiddle of the image above.

Does anybody know how I can remove these labels?

like image 820
kramer65 Avatar asked Feb 21 '16 21:02

kramer65


People also ask

How do I delete a series in Highcharts?

get('idofseriestoremove'). remove(). This only removes the series but is not removing the associated dotted lines.

How do I destroy Highcharts?

destroy () - Removes the chart and purges memory. This method should be called before writing a new chart into the same container. It is called internally on window unload to prevent leaks. var hc_options = { chart: { renderTo: 'container' }, series: [{ name: 'USD to EUR', data: usdeur }] }; var chart=new Highcharts.

How do I show no data available in Highcharts?

To show 'no data' message on a pie chart, you need to remove data from a chart. Also, the 'no data' feature requires the file no-data-to-display. js to be loaded in the page. If you want to show some kind of info when data is hidden, you can add custom text with Chart.

How do I change the y axis values in Highcharts?

A simpler way to go about this is using the tickInterval attribute: yAxis: { title: { text: 'Percent' }, tickInterval: 10, labels: { formatter: function(){ return this. value + '%'; } } }, That will force your axis intervals to show up as you requested.


1 Answers

The "Values" is the title of the y-axis. It can be disabled like this:

yAxis: {
    title: {
        text: null
    }
}

or

yAxis: {
    title: false
}

The "Series 1" is part of the legend. It can be disabled like this:

legend: {
    enabled: false
}

Or alternatively disable a specific series from being shown in the legend, like this:

series: [{
    showInLegend: false,
    data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5]
}]

See this updated JSFiddle for a live demonstration.

like image 157
Halvor Holsten Strand Avatar answered Nov 13 '22 16:11

Halvor Holsten Strand