第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

在 Angular Highcharts 折線圖中添加自定義按鈕

在 Angular Highcharts 折線圖中添加自定義按鈕

慕桂英3389331 2022-06-09 18:26:32
我正在嘗試在導(dǎo)出屬性的 Angular Highcharts 折線圖中添加 2 個(gè)自定義按鈕exporting: {    enabled: true,    buttons: {        customButton: {            text: 'Custom Button',            click: () => {                alert('You pressed the button!');            },        },        anotherButton: {            text: 'Another Button',            click: () => {                alert('You pressed another button!');            },        },    },}但是這兩個(gè)按鈕沒有顯示。這里可能缺少什么邏輯?
查看完整描述

2 回答

?
郎朗坤

TA貢獻(xiàn)1921條經(jīng)驗(yàn) 獲得超9個(gè)贊

您好,認(rèn)為下面的代碼片段會對您有所幫助:


chart: {

  type: "line",

  renderTo: "chart",

  events: {

    render(events) {

      let chart = this;


      if (chart.customButton) {

        chart.customButton.destroy();

      }

      chart.customButton = chart.renderer

        .button("custom button", 100, 40, () => {

          console.log("clicked.....");

          chart.exportChart({

            type: "application/pdf",

            filename: "line-chart"

          });

        })

        .add();

    }

  }

}

在這里單擊按鈕,您可以實(shí)現(xiàn)導(dǎo)出。此處的示例導(dǎo)出 PDF。


查看完整回答
反對 回復(fù) 2022-06-09
?
www說

TA貢獻(xiàn)1775條經(jīng)驗(yàn) 獲得超8個(gè)贊

exporting.buttons是僅在導(dǎo)出菜單中編輯按鈕的選項(xiàng):https ://api.highcharts.com/highcharts/exporting.buttons

要呈現(xiàn)自定義按鈕,請使用SVGRenderer功能:https ://api.highcharts.com/class-reference/Highcharts.SVGRenderer#button

您可以在渲染回調(diào)中添加這些按鈕- 在初始加載后和每次重繪后調(diào)用:https ://api.highcharts.com/highcharts/chart.events.render


查看完整回答
反對 回復(fù) 2022-06-09
  • 2 回答
  • 0 關(guān)注
  • 311 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號