score:1
in chatoptions we can write customize options in the high-charts menu we can customize the dropdown options.
in chart options, we can write like:
exporting: {
buttons: {
contextbutton: {
menuitems: ['downloadpng', 'downloadjpeg', 'downloadpdf', 'downloadsvg'],
},
},
}
example: click here
reference: click here
score:2
you can remove unnecessary options the following way:
if (highcharts.getoptions().exporting) {
let contextbutton = highcharts.getoptions().exporting.buttons.contextbutton;
contextbutton.menuitems = contextbutton.menuitems.filter((item) => {
return item.textkey === 'downloadjpeg' || item.textkey === 'downloadpng';
});
}
score:26
you can manually set exporting.buttons.contextbutton.menuitems
(api) to contain whatever buttons you want.
you'll want to set it to only contain jpg and png like this (short form, textkey
only):
menuitems: ['downloadpng','downloadjpeg']
or for more explicit function calls (long form with objects and onclick
):
menuitems: [{
textkey: 'downloadpng',
onclick: function () {
this.exportchart();
}
}, {
textkey: 'downloadjpeg',
onclick: function () {
this.exportchart({
type: 'image/jpeg'
});
}
}]
as in these jsfiddle demonstrations: short form and long form.
the default for exporting.js
is:
menuitems: [{
textkey: 'printchart',
onclick: function () {
this.print();
}
}, {
separator: true
}, {
textkey: 'downloadpng',
onclick: function () {
this.exportchart();
}
}, {
textkey: 'downloadjpeg',
onclick: function () {
this.exportchart({
type: 'image/jpeg'
});
}
}, {
textkey: 'downloadpdf',
onclick: function () {
this.exportchart({
type: 'application/pdf'
});
}
}, {
textkey: 'downloadsvg',
onclick: function () {
this.exportchart({
type: 'image/svg+xml'
});
}
}]
the additional ones for export-data.js
are:
menuitems: [{
textkey: 'downloadcsv',
onclick: function () {
this.downloadcsv();
}
}, {
textkey: 'downloadxls',
onclick: function () {
this.downloadxls();
}
},{
textkey: 'viewdata',
onclick: function () {
this.viewdata();
}
},{
textkey: 'openincloud',
onclick: function () {
this.openincloud();
}
}]
Source: stackoverflow.com
Related Query
- Disable PDF and SVG download options in Highcharts
- How to use jspdf to print and download the multiple highcharts contents in pdf format
- Export Highcharts to PDF (using javascript and local server - no internet connection)
- Highcharts / jQuery - destroy and rebuild chart with original options
- Using html2canvas to render a highcharts chart to pdf doesn't work on IE and Firefox
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Angular Highcharts - How to enable noData options and update it dynamically
- Highcharts - Global configuration with common code and unique data & Headings
- Weekly PDF generation using PHP and Highcharts
- jspdf is not able to capture the div content properly for highcharts to download as pdf format
- Enable and disable Highcharts tooltip with drill menu
- How do I export the content of a page as either jpg or pdf with Highcharts and scrollable data?
- Change SVG stroke options in Highcharts
- Not able to render the charts in pdf using Wickedpdf and Highcharts in rails 2.3 app
- Disable the label text (min, max, average, bins values) in measure annotation while doing MeasureX in highstocks and highcharts
- Disable tooltip only for months and days in Highcharts
- Change data by download as pdf in Highcharts
- Highcharts SVG Export from Python Server Side Code
- How to click on SVG element in highcharts to download file using Selenium
- Converted PHP code that built an array to JS and now highcharts doesn't work - what did I do wrong?
- Highcharts disable hover effect and select animation
- budling and download json files for highcharts
- Highcharts histogram drilldown: set options for drilldown + first and last column cut-off
- how can I use rangeselector and navigation in highcharts in the given code
- Multiple Highcharts on a PDF page - SVG Page Layout
- Calling Highcharts export to jpeg but the source is https and exporting is http (security warnings issued by browser)
- HighCharts - When I download csv, can I switch data source to new one?
- inconsistent SVG elements from Highcharts making tests fail with Geb/Selenium and PhantomJS
- Exporting Charts on server side with Highcharts and PhantomJS to make a custom PDF
- Is there a way to disable the Title and Subtitle in Highcharts?
More Query from same tag
- Nested table yields unexpected columns for a basic column graph using high charts with 'Data defined in a HTML table'
- pie chart highcharts from django query
- The color of axis is the same as line of series
- Highcharts, trying to regulate maximum height of chart columns NOT including Axes
- Trigger HighCharts Animation on View in Owl Carousel
- HighStocks Array Series
- npm throws this error '"**/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDef'
- Issue with Spider HighChart as it is showing as a line chart sometimes
- How To Dynamically Truncate The Y-Axis Title On Chart Resize/Reflow In Highcharts
- highcharts: disable hover on column chart when i use two chart togheder
- Highcharts column drilldown, assign two different colours to the two different drilldown columns?
- Making Javascript button toggle function work with dropdown selection
- Highcharts chart redraw while exporting
- Gson to get Json value for a pie chart using Highcharts
- Center of chart(pieChart)
- Why isn't Highcharts showing the date formatted on x Axis?
- Highcharts with date and time for x axis (from a database with format YYYYMMDDHHMM)
- Set Opacity using CSS on pie-chart in Highchart
- Pass data in form of variable -Highcharts
- Highcharts - Line breaks from node to node in sankey diagram
- Highstock charts | How do I store a series start and end value in variables?
- HighCharts Linechart MySQL/PHP data for multiple lines
- Higcharts: is there a way to display a graph to another page as image?
- highcharts: margin between two boxplot series
- Highcharts - Multiple master charts in master detail charts
- getting csv data into highcharts
- Highcharts load data with ajax to populate the tooltip
- Formatting Highcharts Series
- Enormous data and PHP errors
- Highcharts showing in some pages, not showing in root pages