score:11
Ok, I found it myself. I send the series name in a hidden field of a div and when I click the delete button I'm checking if the name matches among the series and if match found I delete it.
var chart = $('#container').highcharts();
var seriesLength = chart.series.length;
for(var i = seriesLength - 1; i > -1; i--)
{
//chart.series[i].remove();
if(chart.series[i].name ==document.getElementById("series_name").value)
chart.series[i].remove();
}
score:0
HighCharts 6.x.x
You can get the Series object by Id using Chart::get
method. Heres the link for documentation - https://api.highcharts.com/class-reference/Highcharts.Chart#get
Also Series has a remove
method to remove the series from the chart - https://api.highcharts.com/class-reference/Highcharts.Series#remove
score:1
This needs more visibility, because this is fairly janky. You could probably just iterate through the series and check the .name against your "passed in name" instead of scanning the document for "series_name".
There really should be a chart.remove(series) (not just index, because the indices remap after you remove one).
score:1
These two simple solutions work for me.
UPDATE : I realized I misunderstood the question. These solutions remove all the ledends.
Hide it using jQuery
$(function () {
// Build the chart.
$('#volume_pie_chart').highcharts({
// Some configuration code...
})
// Hide the legend.
$('.highcharts-legend').hide()
});
Position the legend so that we do not see it
...
},
legend: {
x: 9999, // Make the legend invisible.
y: 9999
},
...
score:19
Well, I don't know if at the time it was possible, but now you have a get
function in the chart
object to which you can pass an id
and retrieve an element within the chart
.
For example:
var chart = new Highcharts.Chart({
chart: { renderTo: 'container' },
series: [
{
id: 'series-1',
data: [1,2,3,4,5,6,7,8,9]
},
{
id: 'series-2',
data: [9,8,7,6,5,4,3,2,1]
}
]
});
//Remove the 'series-2'
chart.get('series-2').remove();
Source: stackoverflow.com
Related Query
- remove series by name or id in highcharts
- How to remove a series in Highcharts by name
- HighCharts Hide Series Name from the Legend
- Proper way to remove all series data from a highcharts chart?
- Highcharts - How to hide series name and Y value in tooltip
- Highcharts - get visible series name dynamically
- How to remove the halo/glow around a marker upon hovering a series in Highcharts
- Highcharts - remove points from series
- Highcharts - Remove first marker from Area chart in every series
- Highcharts - Tooltip and series name are out of their boxes in chrome
- Showing HighCharts series name on x-axis and in legend
- HighCharts - Remove space between series on stacked bar
- How to get Series Name Based on Selection in Highcharts
- Missing series name as label in highcharts heatmaps
- Highcharts - Add Series Name As X-Axis Label
- Treemap in highcharts display series name and value in treemap only
- How to hide series name from tooltip in Highcharts scatter plots for linear regression
- Highcharts single horizontal stacked bar chart with data names (labels) and %-ages always shown and data numbers and series name shown on mousehover
- Highcharts series name with '<' not rendered in tooltip
- Highcharts multiple series remove reserved space
- Highcharts series visibility with csv data source
- highcharts series remove function deletes all original series data (even after stored in new variable)
- Highcharts : How to remove the gap between series and vertical axis?
- Highcharts Line Chart, display series name at the end of line series
- Javascript Highcharts rename or remove series label in chart
- Using image tag as series name in highcharts
- How to have multiple highcharts with different series data in vuejs without repeating code
- Highcharts Series name on X-Axis
- add message on hover series name highcharts
- How to hide Series Name in HighCharts Tooltip when using pointFormatter
More Query from same tag
- Weird character in front of Highcharts tooltip series names
- Highcharts linked views
- Highcharts - connect points with a line in scatter plot on hover
- How to turn Highchart scrollable?
- Is it possible to turn boost mode in highcharts only when client's browser starts to jank?
- How to disable Angular Drop Down if the model is null or empty?
- Highcharts series hover state enables after adding series
- How can I limit the length of a HighCharts PlotLine on the Y-Axis for a BoxPlot?
- Showing partial legend in Highcharts BarChart
- Too many series drawn with unused CSV data column
- Rails: Pie Charts legend in Chartkicks
- Group By DATE_FORMAT in SQL and Return Group of Unix Timestamps
- Highcharts: category positioning to match with datetime columns
- Highcharts , Types of property 'series' are incompatible
- How can you speed up the Highcharts network graph initial animation?
- R Highcharts heatmap with motion, but motion bar is overlapping with x axis
- When adding point on dynamically created Multiple Highchart Graphs on a single page, the plot line draws to the start point instead of last point?
- can zoom be mixed with multiple y-axis in highstock
- disabling click event for a series highchart
- Dynamically add a Highchart point while preserve categories
- Is it possible to change the name of "x" for x data?
- How to "Pause" Highcharts selection event
- Highmaps with rich information in separate container
- Remove padding from HighCharts polar chart
- Dynamically applying plot bands to a Highcharts graph
- Aggregate Total with Highcharts Line Chart
- Javascript: Plotting data from a variable using HighCharts- no data passing
- How to set series-label to false by default and change the color of series label text in highchart
- Plotting data using higcharts in flask web application
- Highcharts get PlotLine by id