score:8
I am not sure where you are getting printButton
from but this is how you would do it. You create a Highcharts.setOptions
javascript block and add in the exporting
code:
Highcharts.setOptions({
global: {
useUTC: false
},
exporting: {
buttons: {
contextButton: {
menuItems: [{
text: 'Export to PNG (small)',
onclick: function() {
this.exportChart({
width: 250
});
}
}, {
text: 'Export to PNG (large)',
onclick: function() {
this.exportChart();
},
separator: false
}]
}
}
}
});
This creates only 2 export buttons. To change the type of the export please ready up further on exportChart()
code.
Then you have your chart code later down the page. I would not put the setOptions
in the document ready section. I would put your actual chart in document ready. Working fiddle.
Option 2 Suppose you know that the default export menu items are always going to be in the order they are in right now. Then you can get the export menu items:
var theExportOptions = Highcharts.getOptions().exporting.buttons.contextButton.menuItems;
Now, remove the "print" section:
theExportOptions.splice(0, 1);
Close, but we still have a weird divider there. So, now remove it:
theExportOptions.splice(0, 2);
This seems OK. But, you have to put this bit of code in javascript before you load any chart. I don't like this option because you are dependent on HighCharts always having the same order/amount of export options.
score:0
It's very simple with the help of css
Now look at the above image. I want to hide 2nd(Print Chart) option. All options are displayed by html ul and li(unorder list). So i need to select 2nd child(as i want to hide print option) and make it display none.
<style>
ul.highcharts-menu li:nth-child(2){
display: none !important;
}
</style>
After applying this css the "Print Chart" option will be hide like below image.
You can hide any option by changing child number. For example li:nth-child(3) or li:nth-child(4) etc. I did by this way and sure, this will help you.
Source: stackoverflow.com
Related Query
- Disable Print Chart option only from HighCharts
- Highcharts context menu causes chart to disappear on return from print screen only on Chrome
- Highcharts Chart Bar - How can I display in the chart, only one column from my HTML table?
- How can I pull only specific columns \ cells from csv in <pre> tag, into highcharts pie chart
- Highcharts chart option backgroundColor:'transparent' showing black on IE 8
- Highcharts datetime axis, how to disable time part (show only dates)?
- Change Highcharts tooltip formatter from chart Object , after chart is rendered
- How do I get remove of 'data table' option from High chart export
- Highcharts Column chart with drilldown, remove hyperlink like formatting from x-axis labels
- Highcharts - How can I remove starting and ending padding from area chart
- Add dynamic data to line chart from mysql database with highcharts
- How to make a pie chart from highcharts responsive
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- HighCharts : How to add or remove "chart context menu" from chart container?
- Issues using highcharts node export server from ClojureScript - "0x03 error when performing chart generation"
- How to disable Print Chart button when there is no Chart present
- AJAX displaying values from two different functions in a single Highcharts chart instead of two different ones
- Highcharts - Remove first marker from Area chart in every series
- HighCharts Stock Chart error code 18
- HighCharts pointPlacement option not working in a single column chart
- adding series from existing highcharts chart
- How to generate highcharts chart from multiple local json files
- Highcharts - position column chart from the top
- highcharts chart showing only last element in series
- Creating depth chart using highcharts and creating bids and asks in such a way that bids and asks are created from center of chart
- Highcharts - removing a segment from a pie chart
- passing json values to highcharts from .net code behind
- How to hardcode chart data in my Model then have my Controller pull it from there to display it. Using Highcharts
- How set options from HIGHCHARTS in a chart using vue chartkick
- Multiple Highcharts in one page - only one chart displays
More Query from same tag
- ExtJs Combobox with svg picture (highart) as value
- put labels on the right of the chart area in HighCharts
- render a circle onclick event in highcharts
- How to create a fresh Highcharts instance?
- Jumping on the x axis in Highcharts
- Highchart range selector right align
- Using highcharts x-axis "zones" for datetime series chart
- Removing gaps before first and after last columns in Highcharts
- Highcharts -> Style vertical lines in the navigator
- Highcharts spider chart padding issue
- Set different color for each bubble in Bubble-Map
- Problems with retrieving mysql data into javascript in a specific format
- Highchart GMT and one hour offset
- Inconsistencies with the display of metric notations in Highcharts
- Why heatmap is on top scatter when using boost.js?
- How to transform dict in list with JavaScript to return in Highcharts
- Trying to design with highChart but colors are not showing up
- Spiderweb chart with circular gridline interpolation: Label is seen very far away from Plotline
- Adding options to the Highcharts on button click
- HeighCharts SVG Keep font-size fix
- US Counties map in Highmaps for Angular throws compilation error
- Highcharts: dynamically change the tooltip formatter?
- Multiple series in drilldown
- highcharts splines chart - large data should plot specific data only
- how to display drilldown column highchart using json array objects - 3 level drilldown column highchart
- Highcharts yAxis labels click event
- Internet Explorer 9-11 does not fill g element with color (highcharts)
- How to show current value on two x-axis using Highcharts?
- Highcharts update function not working properly
- Display threshold line even if threshold value is higher than max y-axis value in HighStock